Code folder with Emacs

Diez B. Roggisch deets at nospam.web.de
Fri Mar 21 05:34:09 EDT 2008


Grant Edwards schrieb:
> Has anybody figured out how to do code folding of Python source
> files in emacs?  
> 
> I tried "hide-show" minor mode, but it doesn't really work for
> Python code: the only think it knows how to hide/show are
> function bodies.  It can't do normal things like hide/show a
> code block like it can for other languages.
> 
> Google also found my "folding mode", but that's based on
> user-inserted tokens and isn't syntax aware.
> 

I just recently started hacking in emacs, to enhance the python-mode and 
  make pdb work with persisten breakpoints (by that I mean BPs that 
survive one debug-session).

Code-folding isn't currently on my agenda, but an interesting idea. 
given that e.g. ecb already has structural analysis buffers, there are 
python-aware code parsers (cedet?)

So it shouldn't be too hard. The only interesting/important thing would 
be to integrate it with ecb because I wouldn't want several parse-runs 
at once.


BTW, I can highly recommend flymake for running pylint over the sources! 
That really helps me a lot these days!

Diez



More information about the Python-list mailing list