I combined org-mode with lisp-mode to achieve beautiful code folding in emacs for lisp code: lisp-orgi-mode.
Basically, I use ‘;’ instead of ‘*’ as the heading character. For comments, I just put a space before the ‘;’, making it ‘ ;’ so it doesn’t count as a heading…
However, doing the same thing with python-mode doesn’t work… Probably because the ‘#’ character used by python comments interferes with org-mode settings…
Anyone been able to combine the functionality successfully ?
I know people have combined python-mode with outline-mode (link), but ouline-mode isn’t as good as org-mode…
Edit: Got it working nicely with outline-magic: python-magic.el
I use hideshow-org (and a small introduction here) for this purpose, and I think it works really, really good.
These are some additional, but useful snippets: