From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: OrgStruct for Python source code Date: Wed, 19 Mar 2014 18:03:49 +0100 Message-ID: <87y506p1ca.fsf@bzg.ath.cx> References: <2014-03-19T17-48-05@devnull.Karl-Voit.at> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39390) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WQJvv-00064c-Q6 for emacs-orgmode@gnu.org; Wed, 19 Mar 2014 13:05:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WQJvq-0006bM-ID for emacs-orgmode@gnu.org; Wed, 19 Mar 2014 13:05:39 -0400 Received: from rs249.mailgun.us ([209.61.151.249]:48898) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WQJvp-0006bG-RB for emacs-orgmode@gnu.org; Wed, 19 Mar 2014 13:05:34 -0400 In-Reply-To: <2014-03-19T17-48-05@devnull.Karl-Voit.at> (Karl Voit's message of "Wed, 19 Mar 2014 17:54:11 +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: Karl Voit Cc: news1142@Karl-Voit.at, emacs-orgmode@gnu.org Hi Karl, Karl Voit writes: > 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? simply turn on orgstruct-mode in a python buffer and try M-x org-cycle RET on a def: it will fold it. `orgstruct-heading-prefix-regexp' comes on top of that, if needed, but as long as `outline-regexp' is properly set, orgstruct-mode gives you the cycling commands. For example, this is the bindings I have for emacs-lisp: (global-set-key (kbd "C-M-]") (lambda () (interactive) (org-cycle t))) (global-set-key (kbd "M-]") (lambda () (interactive) (ignore-errors (end-of-defun) (beginning-of-defun)) (org-cycle))) HTH, -- Bastien