emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] OrgStruct for Python source code


From: Bastien
Subject: Re: [O] OrgStruct for Python source code
Date: Wed, 19 Mar 2014 18:03:49 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Hi Karl,

Karl Voit <address@hidden> 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



reply via email to

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