emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] OrgStruct for Python source code


From: Karl Voit
Subject: [O] OrgStruct for Python source code
Date: Wed, 19 Mar 2014 17:54:11 +0100
User-agent: slrn/0.9.9 (Linux)

Hi!

I am evaluating methods to fold Python source code. I stumbled over
orgstruct-mode which looks quite cool to me. My first test with 

    (setq orgstruct-heading-prefix-regexp "^[ ]*##[ ]+\*[ ]")

worked out of the box.

Unfortunately, this attempt requires a comment linke for each
Python-def in order to be able to fold at def-borders.

IMHO it would be very cool if I could come up with a regexp which
folds at the def-definitions like

    (setq orgstruct-heading-prefix-regexp "^[ ]*def .+(.*)\s-*$")

-> optional white spaces followed by "def " and a name. Then the
parenthesis with optional arguments followed by optional
whitespaces.

This should fold all defs. Unfortunately, this does not work at my
side. Did I make a mistake or do I have to limit myself to matching
comment lines only?

Thanks!

-- 
mail|git|SVN|photos|postings|SMS|phonecalls|RSS|CSV|XML to Org-mode:
       > get Memacs from https://github.com/novoid/Memacs <

https://github.com/novoid/extract_pdf_annotations_to_orgmode + more on github




reply via email to

[Prev in Thread] Current Thread [Next in Thread]