emacs-devel
[Top][All Lists]
Advanced

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

Re: Suggestion: Put C-h N (news) in org-mode


From: Jambunathan K
Subject: Re: Suggestion: Put C-h N (news) in org-mode
Date: Mon, 03 Sep 2012 00:20:36 +0530
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux)

Stefan Monnier <address@hidden> writes:

>> Subject line pretty much says it all --
>> Old-style outline mode is suboptimal compared to org-mode --
>> and worse, launching C-h N and trying outline-based
>> nav fails.
>
> I'm not necessarily opposed to it, but I'd like to hear some more
> concrete reasons why the difference would be good (and why for those
> particular files).
> E.g. an alternative is to move some of Org's functionality into Outline,
> or even make outline-mode into an alias for org-mode.

Org-mode's `org-cycle' and `org-global-cycle' are definitely it's
strengths.  I have the attached snippet (see below) in my .emacs.

Whether I am in `outline-mode' (NEWS) or `outline-minor-mode' (*.el
files), I don't have to use or remember outline mode's key bindings for
folding or unfolding at all [1].

It would really be a convenience if the snippet below were moved to
vanilla Emacs, so that I don't have to carry it around with me.

    (add-hook 'emacs-lisp-mode-hook
              (lambda ()
                (outline-minor-mode)))

    (add-hook 'outline-minor-mode-hook
              (lambda ()
                (define-key outline-minor-mode-map [(control tab)] 
                  (lambda nil
                    (interactive)
                    (call-interactively 'org-cycle)
                    (recenter-top-bottom 4)))
                (define-key outline-minor-mode-map [backtab]
                  (lambda nil 
                    (interactive)
                    (call-interactively 'org-global-cycle)
                    (recenter-top-bottom 4)))))

    (add-hook 'outline-mode-hook
      (lambda ()
        (define-key outline-mode-map [(tab)] 'org-cycle)
        (define-key outline-mode-map [backtab] 'org-global-cycle)))

Footnotes: 

[1] Remember folding helps not only with viewing but also with
organizing (and hence facilitates easy re-factoring).  To collect a
bunch of defuns under a single outline just fold the whole file so that
the names of defuns are visible, C-k, C-k, C-k and C-y them away.
-- 



reply via email to

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