I'm pondering over doing indentation by using an AST created with an external (non-emacs) tool. But so far I do not really know where to start. Are there emacs packages which already did this? Any tips and hints are welcome.


You could try to implement the LSP (language Server protocol) and use lsp-mode in conjunction with this. lsp-mode brings support for many languages already, but I'm not sure, if the LSP interface supports indentation.


There is emacs-tree-sitter, which is a package that uses tree-sitter a parser generator tool that can be use to get a AST of some supported languages. Also emacs-tree-sitter support the option of get the AST of some languages so you can manipulate it and get some info, the documentation is interesting.

Good luck!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.