JFold: Emacs Just Fold It Extension

After tried many code folding extensions in Emacs, I realized that the only way for me not to dump Emacs is to make one, it is the last chance for me to work in the Emacs environment so that I can go through the huge source code base (a hotpot of php, javascript, html, css, smarty template, xml, you name it) for web developings.

If you are a web engineer who believes folding is an indispensable part in morden text/code editing, and for whatever reasons stick to Emacs, you might want to give it a try, and good luck.


JFold is an Emacs Minor Mode to support code/text folding for Emacs version 23 and above, with the following features:



Download the jfold elisp file, make sure emacs can find it, and put (require 'jfold-mode) into .emacs fle, and that is all.


"\M-x jfold-mode"
Load/unload jfold buffer local mode.
Toggle folding of the region enclosed by the nearest xml/html or brace tag pair.
Toggle folding of the region enclosed by the nearest sexp symbol pair (for functions, big if/switch blocks, etc.). NOTE: the cursor has to be on the sexp symbols.
Unfold all the currently folded regions.
Fold all the currently created regions.
Unfold all the currently folded regions, and release the internal memory (overlays) for all created regions
Unfold the current region, and release its internal memory.
List the properties of the current folded/unfolded region.
Three way of navigation for the current region: jump to the close tag, the open tag, the orginal position, etc.



Issues & Workaround


This software is distributed under the term of GPLv3+.