emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* OrgStruct for Python source code
@ 2014-03-19 16:54 Karl Voit
  2014-03-19 17:03 ` Bastien
  0 siblings, 1 reply; 5+ messages in thread
From: Karl Voit @ 2014-03-19 16:54 UTC (permalink / raw)
  To: emacs-orgmode

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-03-20  1:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-19 16:54 OrgStruct for Python source code Karl Voit
2014-03-19 17:03 ` Bastien
2014-03-19 19:39   ` Karl Voit
2014-03-20  1:19     ` Ilya Shlyakhter
2014-03-20  1:30       ` Ilya Shlyakhter

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).