BACK or Mathematics Department Home


emacs folding mode
folding.el provides a folding mode for emacs, that is a mode in which regions of text can be folded away (hidden from view in emacs). This is very useful in editing large documents. (Authorship of the code historically is documented in the file. Most recent contribs to this version are D Woodcock (c 1996) and myself (c 1996 to present).)

basic usage is that something like (example for .tex file):

%{{{ fold name
lots of text over many lines
%}}}

appearing as raw text, would in folding mode appear folded simply as

%{{{ fold name...

...but this can be "opened" or "entered" by a suitable click.
Such folds can be arbitrarily nested (TL combinatorics! ;-).


Development/Issues
Emacs-24: folding mode (as I have had it) is broken in emacs-24
what to do?
This begs the question of
how folding.el is _supposed_ to work.
e.g
kill-region (fld-kill-region) is modified from the default emacs lisp command (to avoid breaking folding mode by deleting an unmathced set of fold marks).
...And this throws an error in emacs-24. One thing to say about this is that simply reverting to the default kill-region and risking fold breaking is an option!
...Although kill-region (default) would not work if asked to kill a region containing a complete folded fold (as we might reasonably do). So, better proceed as below.

(fld-)kill-region
...calls the command

...
the above mod is implemeted in the latest test version (still in testing for now).
More to follow.

BACK