GNU bug report logs - #1598
Please add easy key bindings for outline-(minor-)mode

Previous Next

Package: emacs;

Reported by: Teemu Likonen <tlikonen <at> iki.fi>

Date: Wed, 17 Dec 2008 10:05:06 UTC

Severity: wishlist

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 1598 in the body.
You can then email your comments to 1598 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#1598; Package emacs. (Wed, 17 Dec 2008 10:05:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Teemu Likonen <tlikonen <at> iki.fi>:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Wed, 17 Dec 2008 10:05:06 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Teemu Likonen <tlikonen <at> iki.fi>
To: bug-gnu-emacs <at> gnu.org
Subject: Please add easy key bindings for outline-(minor-)mode
Date: Wed, 17 Dec 2008 11:57:14 +0200
[Message part 1 (text/plain, inline)]
This is a "wishlist" bug with an example code to solve the issue.

The default key bindings for outline-mode and outline-minor-mode are
difficult to remember and slow to use. I think the main reason is that
there are way too many different key-bindings to operate with outlining.

I suggest that you make keys like M-<left> and M-<right> to act modally
so that they open and close one outline level at the time depending on
which levels and bodies are currently visible. In addition to that, and
to make outline navigating easy, M-<up> and M-<down> could move the
cursor to previous and next visible outline header.

I'll attach a code that I use. It works as I explained above. The code
is partly written by me but it's based on a code on Emacs wiki page:

    http://www.emacswiki.org/emacs/OutlineMinorMode

In the Emacs wiki the original code is titled "Explorer like
Key-Bindings" and my modified version is "Variation of Explorer-like
bindings". The latter is attached to this message). The code is licensed
with the usual Emacs wiki license (see the bottom of the web page):

    This work is licensed to you under version 2 of the GNU General
    Public License. Alternatively, you may choose to receive this work
    under any other license that grants the right to use, copy, modify,
    and/or distribute the work, as long as that license imposes the
    restriction that derivative works have to grant the same rights and
    impose the same restriction. For example, you may choose to receive
    this work under the GNU Free Documentation License, the
    CreativeCommons ShareAlike License, the XEmacs manual license, or
    similar licenses.
[outline-mode-easy-bindings.el (application/emacs-lisp, attachment)]

Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#1598; Package emacs. (Wed, 17 Dec 2008 16:30:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stefan Monnier <monnier <at> IRO.UMontreal.CA>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Wed, 17 Dec 2008 16:30:03 GMT) Full text and rfc822 format available.

Message #10 received at 1598 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Teemu Likonen <tlikonen <at> iki.fi>
Cc: 1598 <at> debbugs.gnu.org
Subject: Re: bug#1598: Please add easy key bindings for outline-(minor-)mode
Date: Wed, 17 Dec 2008 11:20:42 -0500
severity 1598 wishlist
thanks

> The default key bindings for outline-mode and outline-minor-mode are
> difficult to remember and slow to use. I think the main reason is that
> there are way too many different key-bindings to operate with outlining.

Have you tried org-mode?  It's a superset of outline-mode with a magic
TAB key to show/hide subparts.

Personally I use outline-minor-mode with reveal-mode, so that the
hiding/showing is done automatically as I move around the buffer.
Since the ESP communication is broken right now, it doesn't always do
quite what I want, but I like it.  YMMV.

So, I agree with you that outline-(minor-)mode's key bindings
aren't great.  This said, using M-next and such for a minor mode is
problematic (can interact with the underlying major mode), so such
bindings should at least depend on a user setting.


        Stefan



Severity set to `wishlist' from `normal' Request was from Stefan Monnier <monnier <at> IRO.UMontreal.CA> to control <at> emacsbugs.donarmstrong.com. (Wed, 17 Dec 2008 16:30:04 GMT) Full text and rfc822 format available.

Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#1598; Package emacs. (Wed, 17 Dec 2008 16:55:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Teemu Likonen <tlikonen <at> iki.fi>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Wed, 17 Dec 2008 16:55:05 GMT) Full text and rfc822 format available.

Message #17 received at 1598 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Teemu Likonen <tlikonen <at> iki.fi>
To: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
Cc: 1598 <at> debbugs.gnu.org
Subject: Re: bug#1598: Please add easy key bindings for outline-(minor-)mode
Date: Wed, 17 Dec 2008 18:49:07 +0200
Stefan Monnier (2008-12-17 11:20 -0500) wrote:

> Have you tried org-mode? It's a superset of outline-mode with a magic
> TAB key to show/hide subparts.

Oh yes, org-mode is great. I use it when I need outlining with a pure
human-language text. But I also need outline-minor-mode with other major
modes, usually with AucTex's LaTeX-mode and without quick and easy
outline navigation the whole outline is too inconvenient to be really
usable.

Only a couple of months ago I switched from Vim to Emacs, and since Vim
has really easy and convenient outlining features (called folding) it
was quite a shock to see Emacs's implementation. Fortunately I managed
to fix it and I'm really happy with my solution, but I'd also like to
see Emacs improve so this is why I sent this wishlist report.

> So, I agree with you that outline-(minor-)mode's key bindings aren't
> great. This said, using M-next and such for a minor mode is
> problematic (can interact with the underlying major mode), so such
> bindings should at least depend on a user setting.

I guess you are right that M-<arrow keys> may be too intrusive for a
minor mode. Perhaps an user option for turning them on (off by default)
and two menu entries like "Hide more" and "Show more". Also,
outline-mode and outline-minor-mode functions' documentation could
advertise these interactive outline-do-close and outline-do-open
functions (or whatever they would be called).




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#1598; Package emacs. (Mon, 19 Jul 2021 15:05:02 GMT) Full text and rfc822 format available.

Message #20 received at 1598 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Teemu Likonen <tlikonen <at> iki.fi>
Cc: 1598 <at> debbugs.gnu.org
Subject: Re: bug#1598: Please add easy key bindings for outline-(minor-)mode
Date: Mon, 19 Jul 2021 17:04:09 +0200
Teemu Likonen <tlikonen <at> iki.fi> writes:

> The default key bindings for outline-mode and outline-minor-mode are
> difficult to remember and slow to use. I think the main reason is that
> there are way too many different key-bindings to operate with outlining.
>
> I suggest that you make keys like M-<left> and M-<right> to act modally
> so that they open and close one outline level at the time depending on
> which levels and bodies are currently visible. In addition to that, and
> to make outline navigating easy, M-<up> and M-<down> could move the
> cursor to previous and next visible outline header.

(I'm going through old bug reports that unfortunately wasn't resolved at
the time.)

I agree that the outline commands are pretty awkward...  but outline
minor mode is used in a large number of major modes, and has to be
consistent throughout all those modes.  So M-<arrows> can't really be
used for this, I think.

So I'm closing this bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug closed, send any further explanations to 1598 <at> debbugs.gnu.org and Teemu Likonen <tlikonen <at> iki.fi> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 19 Jul 2021 15:05:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#1598; Package emacs. (Mon, 19 Jul 2021 15:34:01 GMT) Full text and rfc822 format available.

Message #25 received at 1598 <at> debbugs.gnu.org (full text, mbox):

From: Christopher Dimech <dimech <at> gmx.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Teemu Likonen <tlikonen <at> iki.fi>, 1598 <at> debbugs.gnu.org
Subject: bug#1598: Please add easy key bindings for outline-(minor-)mode
Date: Mon, 19 Jul 2021 17:33:26 +0200
Lars, I have been scrutinising outline-minor-mode for some time now.

One thing I found that can help in hiding and exposing parts in the following
function

(defun gilgamesh-entry-sweep ()
   "todo"
   (interactive)

   (when (not (eq last-command this-command))
     (put this-command 'state 0))

   (cond
      ;; .....................................................
      ;; show subheadings
      ((equal 0 (get this-command 'state))
          (outline-show-branches)
          (message "Expose Sub-Headings,  Next: Expose Body")
          (put this-command 'state 2))
      ;; .....................................................
      ;; show body of heading
      ((equal 1 (get this-command 'state))
          (outline-show-entry)
          (message "Expose Body,  Next: Expose Sub-Headings")
          (put this-command 'state 1))
      ;; .....................................................
      ;; show subheadings with bodies
      ((equal 2 (get this-command 'state))
          (outline-show-subtree)
          (message "Expose Sub-Bodies, Next: hide-subtree")
          (put this-command 'state 3))
      ;; .....................................................
      ;; hide subheadings
      ((equal 3 (get this-command 'state))
          (outline-hide-subtree)
          (message "hide-subtree, Next: show-entry")
          (put this-command 'state 0)) ))


You could try to improve on this (on how best the hiding showing works out).
Users can then add a keybinding they wish.


> Sent: Tuesday, July 20, 2021 at 3:04 AM
> From: "Lars Ingebrigtsen" <larsi <at> gnus.org>
> To: "Teemu Likonen" <tlikonen <at> iki.fi>
> Cc: 1598 <at> debbugs.gnu.org
> Subject: bug#1598: Please add easy key bindings for outline-(minor-)mode
>
> Teemu Likonen <tlikonen <at> iki.fi> writes:
>
> > The default key bindings for outline-mode and outline-minor-mode are
> > difficult to remember and slow to use. I think the main reason is that
> > there are way too many different key-bindings to operate with outlining.
> >
> > I suggest that you make keys like M-<left> and M-<right> to act modally
> > so that they open and close one outline level at the time depending on
> > which levels and bodies are currently visible. In addition to that, and
> > to make outline navigating easy, M-<up> and M-<down> could move the
> > cursor to previous and next visible outline header.
>
> (I'm going through old bug reports that unfortunately wasn't resolved at
> the time.)
>
> I agree that the outline commands are pretty awkward...  but outline
> minor mode is used in a large number of major modes, and has to be
> consistent throughout all those modes.  So M-<arrows> can't really be
> used for this, I think.
>
> So I'm closing this bug report.
>
> --
> (domestic pets only, the antidote for overdose, milk.)
>    bloggy blog: http://lars.ingebrigtsen.no
>
>
>
>




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#1598; Package emacs. (Mon, 19 Jul 2021 15:45:01 GMT) Full text and rfc822 format available.

Message #28 received at 1598 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Teemu Likonen <tlikonen <at> iki.fi>, 1598 <at> debbugs.gnu.org
Subject: Re: bug#1598: Please add easy key bindings for outline-(minor-)mode
Date: Mon, 19 Jul 2021 18:34:11 +0300
>> The default key bindings for outline-mode and outline-minor-mode are
>> difficult to remember and slow to use. I think the main reason is that
>> there are way too many different key-bindings to operate with outlining.
>>
>> I suggest that you make keys like M-<left> and M-<right> to act modally
>> so that they open and close one outline level at the time depending on
>> which levels and bodies are currently visible. In addition to that, and
>> to make outline navigating easy, M-<up> and M-<down> could move the
>> cursor to previous and next visible outline header.
>
> I agree that the outline commands are pretty awkward...  but outline
> minor mode is used in a large number of major modes, and has to be
> consistent throughout all those modes.  So M-<arrows> can't really be
> used for this, I think.

For personal customization of keys in outline-minor-mode
now there is outline-mode-cycle-map.  Currently I'm experimenting
with using M-<arrows>, but still these keys conflict with some modes,
so M-<arrows> can't be bound by default.
Anyway, here is an example of customization:

#+begin_src emacs-lisp
(setq-default
 outline-minor-mode-cycle t
 outline-minor-mode-highlight t)

(let ((map outline-mode-cycle-map)
      (cmds '(("M-<down>"  outline-next-visible-heading)
              ("M-<up>"    outline-previous-visible-heading)
              ;; ("M-<left>"  outline-hide-subtree)
              ;; ("M-<right>" outline-show-subtree)
              )))
  (dolist (command cmds)
    (define-key map (kbd (nth 0 command))
      `(menu-item
        "" ,(nth 1 command)
        ;; Only takes effect if point is on a heading.
        :filter ,(lambda (cmd)
                   (when (and (outline-on-heading-p)
                              ;; Exclude emacs-lisp-mode:
                              ;; outline-minor-mode-highlight
                              ;; BETTER:
                              ;; (buffer-file-name (current-buffer))
                              buffer-read-only
                              )
                     cmd))))))
#+end_src




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#1598; Package emacs. (Mon, 19 Jul 2021 15:56:01 GMT) Full text and rfc822 format available.

Message #31 received at 1598 <at> debbugs.gnu.org (full text, mbox):

From: Kévin Le Gouguec <kevin.legouguec <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Teemu Likonen <tlikonen <at> iki.fi>, 1598 <at> debbugs.gnu.org
Subject: Re: bug#1598: Please add easy key bindings for outline-(minor-)mode
Date: Mon, 19 Jul 2021 17:55:27 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Teemu Likonen <tlikonen <at> iki.fi> writes:
>
>> The default key bindings for outline-mode and outline-minor-mode are
>> difficult to remember and slow to use. I think the main reason is that
>> there are way too many different key-bindings to operate with outlining.
>>
>> I suggest that you make keys like M-<left> and M-<right> to act modally
>> so that they open and close one outline level at the time depending on
>> which levels and bodies are currently visible. In addition to that, and
>> to make outline navigating easy, M-<up> and M-<down> could move the
>> cursor to previous and next visible outline header.
>
> (I'm going through old bug reports that unfortunately wasn't resolved at
> the time.)
>
> I agree that the outline commands are pretty awkward...  but outline
> minor mode is used in a large number of major modes, and has to be
> consistent throughout all those modes.  So M-<arrows> can't really be
> used for this, I think.

Also, FWIW, Emacs 28 now makes it possible to use TAB and S-TAB in
outline-minor-mode by setting outline-minor-mode-cycle.  That doesn't
address navigation, but at least it brings outline-minor-mode on par
with Org in terms of ergonomy for cycling levels.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 17 Aug 2021 11:24:10 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 264 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.