Code folding in Emacs

Christopher Done picture Christopher Done · Jul 30, 2009 · Viewed 10.2k times · Source

Possible Duplicate:
How to achieve code folding effects in emacs

An excellent feature of Dreamweaver is code folding of any lines of text -- recursively!

It's fantastic, I can fold any text or code, regardless of language. I work with existing systems; I don't edit well-written code or code in one language etc. mostly HTML mixed with god-knows-what. Folding lines makes understanding a lot easier and quicker. Sadly, this is the only feature I like in Dreamweaver.

Is there any code folding for Emacs in a similar aim?

Answer

quark picture quark · Jul 30, 2009

There's folding mode, a minor mode. Unfortunately it's intrusive: you have to manually annotate the folds with specialized comments, which clutter the code when you aren't using the mode (or when sharing code with others who don't use it). A better mode would not change your code to work.

Let me add: there's a duplicate of this that's worth a look: How to achieve code folding effects in Emacs.