0

I am currently maintaining a fork of a major mode and I usually get by through reusing snippets other people have written that provides indention for similar languages. However, this does lead to a lot of duplicated code and or errors, since my new code is not that far from the original.

Does Emacs provide some sort of library/package in which I can specify start/end of blocks and other rules for indention and then delegate the indention to this package/library?

2

The main part of indenting is the parsing. There is the Simple Minded Indentation Engine for this kind of stuff.

The manual also gives an example for the indentation rules.

octave-mode in octave.el is an example for a mode that uses SMIE

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.