From mboxrd@z Thu Jan 1 00:00:00 1970 From: Karl Voit Subject: OrgStruct for Python source code Date: Wed, 19 Mar 2014 17:54:11 +0100 Message-ID: <2014-03-19T17-48-05@devnull.Karl-Voit.at> Reply-To: news1142@Karl-Voit.at Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35205) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WQJlB-0005b3-6D for emacs-orgmode@gnu.org; Wed, 19 Mar 2014 12:54:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WQJl5-0001rY-9k for emacs-orgmode@gnu.org; Wed, 19 Mar 2014 12:54:33 -0400 Received: from plane.gmane.org ([80.91.229.3]:33433) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WQJl4-0001qK-W4 for emacs-orgmode@gnu.org; Wed, 19 Mar 2014 12:54:27 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1WQJl0-0003Wi-RK for emacs-orgmode@gnu.org; Wed, 19 Mar 2014 17:54:22 +0100 Received: from mail.michael-prokop.at ([88.198.6.110]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 19 Mar 2014 17:54:22 +0100 Received: from news1142 by mail.michael-prokop.at with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 19 Mar 2014 17:54:22 +0100 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org 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