Subject: Re: bug#41130: bug#41198: 27.0.60; [PATCH] heading cycling command for outline

From: Howard Melman <[email-masked]>
Date: Wed, 20 May 2020 10:12:23 -0400

Yuan Fu <[email-masked]> writes:

>> On May 19, 2020, at 6:36 PM, Stefan Kangas <[email-masked]> wrote:
>> 
>> Yuan Fu <[email-masked]> writes:
>> 
>>>> In Bug#41130, I also suggest to add the same keybinding as in org-mode:
>>>> TAB and S-TAB.  Could you add such keybindings to outline-mode-map in
>>>> your patch?
>>> 
>>> It seems that the outline-mode bindings all live under C-c. Maybe C-c
>>> TAB and C-c S-TAB? Should I ask on emacs-devel for for suggestions?
>> 
>> I think it is better to use the same keys as org-mode, since one
>> important motivation for this feature is precisely to align the
>> outline-mode keybindings with org-mode.  This aspect would be
>> significantly diminished by using other keys, IMHO.
>> 
>> My impression was that also there was consensus around (or at least no
>> objections to) that idea the last time we discussed it.  I would
>> therefore propose to just add TAB and S-TAB to the patch, but allow a
>> week or two before pushing to give others a chance to comment here.

My original motivation was just to use org's cycling concept
to avoid having to remember all of outlines various commands
and bindings. So regardless of where these commands end up,
I think just having them is a big win. Of course if they
exist, aligning them with org bindings would be very nice.

The idea was to use this for code folding in programming
modes. S-TAB doesn't typically have a binding so it's safe
to use and aligns with org-mode.  

TAB is more problematic as it's typically bound to indenting
commands. I don't think context awareness would solve the
issue as you could want to indent or cycle when point is on
a "heading".  But if the other bindings (I think from
bug#41198) for M-right and M-left were included they could
substitute for indenting.

So in a programming mode with outline-minor-mode enabled:
- S-TAB can be used anywhere for global cycling
- TAB on a heading is used for cycling
- TAB not on a heading is used to indent
- M-right and M-left anywhere can be used to indent/unindent

I think this aligns with org-mode ('m not an org mode
user). If someone is bothered by having to use M-arrows for
indentation in this case, the answer is to not use
outline-minor-mode in a programming mode or rebind outline-cycle.

> A minor thing: if the motivation is to align with Org mode, should I
> change the text message to align with Org mode? It prints “show all”,
> “hide all”, etc (because they make sense), but Org mode prints stuff
> like “CHILDREN”, “SUBTREE”, etc.

IMHO consistency with outline terms is more important
here. It would be helpful if outline and org agreed on
terms. If they don't, then perhaps this could use both with
org terms in parenthesis.

-- 

Howard