Subject: Re: bug#50679: 28.0.50; outline-minor-mode-cycle should be able to only cycle at the begining of a line

From: Juri Linkov <[email-masked]>
Date: Tue, 21 Sep 2021 20:58:01 +0300

> FWIW, I think it would be nice to provide a simple way to define other
> “speed keys” in `outline-minor-mode [1], or even provide some
> pre-configured ones [2].
>
> [2]: I personally use these speed keys in outline-minor-mode, which are
> probably very similar to those from Org mode:
>
>         "<tab>" 'outline-cycle
>         "<backtab>" 'outline-cycle-buffer
>         "f" 'outline-forward-same-level
>         "b" 'outline-backward-same-level
>         "n" 'outline-next-visible-heading
>         "p" 'outline-previous-visible-heading
>         "u" 'outline-up-heading
>         "F" 'outline-move-subtree-down
>         "B" 'outline-move-subtree-up
>         "@" 'outline-mark-subtree

But this means you can't type all these keys on heading lines?
This is why I confugured it not to use self-inserting keys:

  (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)
          :filter ,(lambda (cmd)
                     (when (outline-on-heading-p))
                       cmd))))))

> Looking at the code, it seems that adding bindings to
> `outline-mode-cycle-map` would achieve precisely that, but the name
> of the keymap doesn't reflect that.

Do you suggest different keymaps?  And indeed, these two are
quite different beasts each with own problems.  So we need both
outline-mode-cycle-map and outline-minor-mode-cycle-map.