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.

Full log


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




This bug report was last modified 3 years and 359 days ago.

Previous Next


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