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

From: Yuan Fu <[email-masked]>
Date: Tue, 19 May 2020 21:37:26 -0400

> 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.
> 
> But, if you really want to, of course you could also ask on emacs-devel.
> Worst case, we get to have another round of bikeshedding. ;-)

I added TAB and S-TAB bindings. Though S-TAB appears to be <backtab> on my machine (Mac) for both terminal and GUI so I bound that instead. Is that so for other machines? To reduce the possible allergy, I made the TAB binding conditional—only invokes outline-cycle when point is on a heading.

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.

> 
>>> I think we also need ChangeLog in the commit message, an entry in NEWS,
>>> and updates to the manual.
>> 
>> I updated NEWS and the manual. For ChangeLog, I thought that’s
>> automatically generated from commit messages?
> 
> That is my understanding too.
> 
> But I only saw a diff attached, not a patch with a commit message.  That
> is what I tried to say, but I could've been more clear.
> 
> (CONTRIBUTE suggests using `git format-patch -1' to email a patch, which
> includes the commit message.)

Ah sorry, I switched to a new way to generate patches and didn’t notice that the commit message is gone. It is included this time.

> 
>> +@findex outline-cycle
>> +@findex outline-cycle-buffer
>> +  Outline also provides two convenience commands to cycle the
>> +visibility of each heading and the whole buffer.  @code{outline-cycle}
>> +cycles the current heading between "hide all", "subheadings", and
>> +"show all" state.  @code{outline-cycle-buffer} cycles the whole buffer
>> +between "only top-level headings", "all headings and subheadings", and
>> +"show all" states.
> [...]
>> +*** New commands to cycle heading visibility.
>> +'outline-cycle' cycles the current heading between "hide all",
>> +"subheadings", and "show all" state. 'outline-cycle-buffer' cycles the
>> +whole buffer between "only top-level headings", "all headings and
>> +subheadings", and "show all" states.
> 
> Looks good to me (but should refer to the above keybindings if they're
> added).

Yuan