G. Milde | 21 Apr 2008 12:56
Picon

Re: automatic folding of python source

On 21.04.08, Joachim Schmitz wrote:

> I use the folding mode with python src files heavily by inserting my own  
> fold-marks (###(,###). But if I share my Programms with others, I am  
> always asked what these ugly comments mean.

> Is there a possibility to autmatic fold any Python file, like many of  
> the Python-IDE's do ?

None that I know of. However, I am in the procass of creating 

* a generic fold mode based on regular expressions that shall support
  several levels of folding.

  Some building blocks already available:

  http://jedmodes.sf.net/mode/filter-buffer/filter-buffer.sl
     Hide/Show lines based on regular expressions (uses pcre).

  http://jedmodes.sf.net/mode/folding-keypad-bindings/folding-keypad-bindings.sl
     Use the Number-Block keys for (un)folding and navigation.

* a fold mode based on underlined section headings (according to the
  reStructuredText syntax).

  This way you can have a custom structure with nice (and understandable
  to all) comments.

  http://jedmodes.sf.net/mode/rst/rst-outline.sl
     Outline/Folding using reStructuredText section headings as markers.

  This mode must still be extended to recognise headings commented with
  the current modes comment string.

Feedback and ideas on what exactly such a mode shall do are welcome.

Günter


Gmane