Whats the best way to achieve something like code folding, or the type of cycling that org-mode uses. What would be the best solution in elisp to create this type of behavi
If you are doing some JavaScript and using js2-mode.el, you can:
js2-mode.el
C-c C-f: toggle hide/show all
C-c C-f
C-c C-e: hide element
C-c C-e
C-c C-s: show element
C-c C-s
emacs comes with hs-minor-mode which fascilitates code folding between balanced expressions http://www.emacswiki.org/emacs/HideShow