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