GNU bug report logs - #47878
Mark outline commands as repeatable

Previous Next

Package: emacs;

Reported by: Philip Kaludercic <philipk <at> posteo.net>

Date: Sun, 18 Apr 2021 19:01:02 UTC

Severity: wishlist

Tags: fixed

Fixed in version 28.0.50

Done: Juri Linkov <juri <at> linkov.net>

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 47878 in the body.
You can then email your comments to 47878 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-gnu-emacs <at> gnu.org:
bug#47878; Package emacs. (Sun, 18 Apr 2021 19:01:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Philip Kaludercic <philipk <at> posteo.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 18 Apr 2021 19:01:02 GMT) Full text and rfc822 format available.

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

From: Philip Kaludercic <philipk <at> posteo.net>
To: bug-gnu-emacs <at> gnu.org
Subject: Mark outline commands as repeatable
Date: Sun, 18 Apr 2021 19:00:17 +0000
[Message part 1 (text/plain, inline)]
This is a suggested extension for repeat-mode. outline-mode, especially
outline-minor-mode commands are somewhat inconvenient to access ("C-x @
C-<something>" requires me to change modifiers mid-input twice). When
repeat-mode is enabled, this would allow me to access all outline keys
in just one key-press.

One might want to discuss if outline-mode-prefix-map should be directly
marked as the repeat-map or if a subset should be used. My approach
requires less effort but might be more confusing.

-- 
	Philip K.

[0002-Mark-outline-mode-keys-as-repeatable.patch (text/x-diff, inline)]
From 060f1a9facd4e30bd0bca5b405dc6e544dca3cf9 Mon Sep 17 00:00:00 2001
From: Philip K <philipk <at> posteo.net>
Date: Sun, 18 Apr 2021 20:34:18 +0200
Subject: [PATCH 2/4] Mark outline-mode keys as repeatable

---
 lisp/outline.el | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lisp/outline.el b/lisp/outline.el
index bce9c6b9e4..f5fbfb5b98 100644
--- a/lisp/outline.el
+++ b/lisp/outline.el
@@ -1274,6 +1274,12 @@ outline-cycle-buffer
       (setq outline--cycle-buffer-state 'show-all)
       (message "Show all")))))
 
+;;; mark all commands bound in `outline-mode-prefix-map' as
+;;; repeatable.
+(dolist (command (mapcar #'cdr (cdr outline-mode-prefix-map)))
+  (when (commandp command)
+    (put command 'repeat-map 'outline-mode-prefix-map)))
+
 (provide 'outline)
 (provide 'noutline)
 
-- 
2.30.2


Severity set to 'wishlist' from 'normal' Request was from Stefan Kangas <stefan <at> marxist.se> to control <at> debbugs.gnu.org. (Mon, 19 Apr 2021 07:39:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47878; Package emacs. (Mon, 19 Apr 2021 20:51:02 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: Philip Kaludercic <philipk <at> posteo.net>
Cc: 47878 <at> debbugs.gnu.org
Subject: Re: bug#47878: Mark outline commands as repeatable
Date: Mon, 19 Apr 2021 23:45:17 +0300
> This is a suggested extension for repeat-mode. outline-mode, especially
> outline-minor-mode commands are somewhat inconvenient to access ("C-x @
> C-<something>" requires me to change modifiers mid-input twice). When
> repeat-mode is enabled, this would allow me to access all outline keys
> in just one key-press.
>
> One might want to discuss if outline-mode-prefix-map should be directly
> marked as the repeat-map

Is it possible to get the name of the keymap whose keys were bound to
and invoked the current command?  If such function exists, then the
feature of marking the whole keymap as repeatable could be discussed.

> or if a subset should be used. My approach requires less effort
> but might be more confusing.

Indeed, a subset would be more preferable since it reduces the number
of keys that users might want to use outside of the repeating sequence,
e.g. to type C-l to recenter instead of outline-hide-leaves.

To solve this problem the whole set of keys could be split to groups
of repeatable keymaps:

1. navigation keymap:

C-c @ C-b       outline-backward-same-level
C-c @ C-f       outline-forward-same-level
C-c @ C-n       outline-next-visible-heading
C-c @ C-p       outline-previous-visible-heading
C-c @ C-u       outline-up-heading

This would be the most useful keymap to make navigation keys repeatable.

2. editing keymap:

C-c @ RET       outline-insert-heading
C-c @ C-v       outline-move-subtree-down
C-c @ C-^       outline-move-subtree-up
C-c @ @         outline-mark-subtree
C-c @ C-<       outline-promote
C-c @ C->       outline-demote

Only outline-promote/outline-demote and 
outline-move-subtree-down/outline-move-subtree-up
could be repeatable.

3. visibility keymap:

C-c @ C-a       outline-show-all
C-c @ C-e       outline-show-entry
C-c @ TAB       outline-show-children
C-c @ C-k       outline-show-branches
C-c @ C-s       outline-show-subtree
C-c @ C-c       outline-hide-entry
C-c @ C-d       outline-hide-subtree
C-c @ C-l       outline-hide-leaves
C-c @ C-o       outline-hide-other
C-c @ C-q       outline-hide-sublevels
C-c @ C-t       outline-hide-body

I doubt if these keys need to be repeatable.
We have new Org-like short keys TAB and S-TAB
that are more convenient to use in outline-mode
and in outline-minor-mode.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47878; Package emacs. (Wed, 21 Apr 2021 13:54:02 GMT) Full text and rfc822 format available.

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

From: Philip Kaludercic <philipk <at> posteo.net>
To: Juri Linkov <juri <at> linkov.net>
Cc: 47878 <at> debbugs.gnu.org
Subject: Re: bug#47878: Mark outline commands as repeatable
Date: Wed, 21 Apr 2021 13:53:28 +0000
Juri Linkov <juri <at> linkov.net> writes:

>> This is a suggested extension for repeat-mode. outline-mode, especially
>> outline-minor-mode commands are somewhat inconvenient to access ("C-x @
>> C-<something>" requires me to change modifiers mid-input twice). When
>> repeat-mode is enabled, this would allow me to access all outline keys
>> in just one key-press.
>>
>> One might want to discuss if outline-mode-prefix-map should be directly
>> marked as the repeat-map
>
> Is it possible to get the name of the keymap whose keys were bound to
> and invoked the current command?  If such function exists, then the
> feature of marking the whole keymap as repeatable could be discussed.
>
>> or if a subset should be used. My approach requires less effort
>> but might be more confusing.
>
> Indeed, a subset would be more preferable since it reduces the number
> of keys that users might want to use outside of the repeating sequence,
> e.g. to type C-l to recenter instead of outline-hide-leaves.
>
> To solve this problem the whole set of keys could be split to groups
> of repeatable keymaps:
>
> 1. navigation keymap:
>
> C-c @ C-b       outline-backward-same-level
> C-c @ C-f       outline-forward-same-level
> C-c @ C-n       outline-next-visible-heading
> C-c @ C-p       outline-previous-visible-heading
> C-c @ C-u       outline-up-heading
>
> This would be the most useful keymap to make navigation keys repeatable.
>
> 2. editing keymap:
>
> C-c @ RET       outline-insert-heading
> C-c @ C-v       outline-move-subtree-down
> C-c @ C-^       outline-move-subtree-up
> C-c @ @         outline-mark-subtree
> C-c @ C-<       outline-promote
> C-c @ C->       outline-demote
>
> Only outline-promote/outline-demote and 
> outline-move-subtree-down/outline-move-subtree-up
> could be repeatable.

I am not sure if these two maps are necessarily detached. When I want to
move a few subtrees, it might be natural for me to assume that I can
also move between them without having to invoke C-x @ ... again.

> 3. visibility keymap:
>
> C-c @ C-a       outline-show-all
> C-c @ C-e       outline-show-entry
> C-c @ TAB       outline-show-children
> C-c @ C-k       outline-show-branches
> C-c @ C-s       outline-show-subtree
> C-c @ C-c       outline-hide-entry
> C-c @ C-d       outline-hide-subtree
> C-c @ C-l       outline-hide-leaves
> C-c @ C-o       outline-hide-other
> C-c @ C-q       outline-hide-sublevels
> C-c @ C-t       outline-hide-body
>
> I doubt if these keys need to be repeatable.
> We have new Org-like short keys TAB and S-TAB
> that are more convenient to use in outline-mode
> and in outline-minor-mode.

That makes sense, I just found out about outline-minor-mode-cycle and it
probably does make these keys superfluous for most uses. Removing these
keys seems to also open up a lot of key bindings that would otherwise
maybe annoy users if they are bound in transient maps (especially C-a,
C-e, C-k, C-s, C-c).

-- 
	Philip K.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47878; Package emacs. (Wed, 21 Apr 2021 19:29:01 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: Philip Kaludercic <philipk <at> posteo.net>
Cc: 47878 <at> debbugs.gnu.org
Subject: Re: bug#47878: Mark outline commands as repeatable
Date: Wed, 21 Apr 2021 22:20:27 +0300
>> 1. navigation keymap:
>>
>> C-c @ C-b       outline-backward-same-level
>> C-c @ C-f       outline-forward-same-level
>> C-c @ C-n       outline-next-visible-heading
>> C-c @ C-p       outline-previous-visible-heading
>> C-c @ C-u       outline-up-heading

Maybe also it would make sense to add single key equivalents,
so e.g. next visible headings could be visited with
C-c @ n n n n …

>> This would be the most useful keymap to make navigation keys repeatable.
>>
>> 2. editing keymap:
>>
>> C-c @ RET       outline-insert-heading
>> C-c @ C-v       outline-move-subtree-down
>> C-c @ C-^       outline-move-subtree-up
>> C-c @ @         outline-mark-subtree
>> C-c @ C-<       outline-promote
>> C-c @ C->       outline-demote
>>
>> Only outline-promote/outline-demote and 
>> outline-move-subtree-down/outline-move-subtree-up
>> could be repeatable.
>
> I am not sure if these two maps are necessarily detached. When I want to
> move a few subtrees, it might be natural for me to assume that I can
> also move between them without having to invoke C-x @ ... again.

Ok, let's put navigation and editing keys into one repeatable keymap
(maybe without outline-insert-heading and outline-mark-subtree).

>> 3. visibility keymap:
>>
>> C-c @ C-a       outline-show-all
>> C-c @ C-e       outline-show-entry
>> C-c @ TAB       outline-show-children
>> C-c @ C-k       outline-show-branches
>> C-c @ C-s       outline-show-subtree
>> C-c @ C-c       outline-hide-entry
>> C-c @ C-d       outline-hide-subtree
>> C-c @ C-l       outline-hide-leaves
>> C-c @ C-o       outline-hide-other
>> C-c @ C-q       outline-hide-sublevels
>> C-c @ C-t       outline-hide-body
>>
>> I doubt if these keys need to be repeatable.
>> We have new Org-like short keys TAB and S-TAB
>> that are more convenient to use in outline-mode
>> and in outline-minor-mode.
>
> That makes sense, I just found out about outline-minor-mode-cycle and it
> probably does make these keys superfluous for most uses. Removing these
> keys seems to also open up a lot of key bindings that would otherwise
> maybe annoy users if they are bound in transient maps (especially C-a,
> C-e, C-k, C-s, C-c).

Indeed, these are among the most frequently used keys.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47878; Package emacs. (Wed, 21 Apr 2021 20:52:01 GMT) Full text and rfc822 format available.

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

From: Philip Kaludercic <philipk <at> posteo.net>
To: Juri Linkov <juri <at> linkov.net>
Cc: 47878 <at> debbugs.gnu.org
Subject: Re: bug#47878: Mark outline commands as repeatable
Date: Wed, 21 Apr 2021 20:50:59 +0000
[Message part 1 (text/plain, inline)]
Juri Linkov <juri <at> linkov.net> writes:

>> I am not sure if these two maps are necessarily detached. When I want to
>> move a few subtrees, it might be natural for me to assume that I can
>> also move between them without having to invoke C-x @ ... again.
>
> Ok, let's put navigation and editing keys into one repeatable keymap
> (maybe without outline-insert-heading and outline-mark-subtree).
>
>> That makes sense, I just found out about outline-minor-mode-cycle and it
>> probably does make these keys superfluous for most uses. Removing these
>> keys seems to also open up a lot of key bindings that would otherwise
>> maybe annoy users if they are bound in transient maps (especially C-a,
>> C-e, C-k, C-s, C-c).
>
> Indeed, these are among the most frequently used keys.

I've implemented your suggestions. Letting the editing map inherit from
the navigation map doesn't seem like a good idea, as long as repeat-mode
overwrites the repeat-map, because that makes commands disappear all of
a sudden. The extra keys without control are convenient, but it does
write a lot into the mini-buffer.

-- 
	Philip K.

[0001-Make-outline-commands-repeatable.patch (text/x-diff, inline)]
From df388bbf31f7970fe38190503b20eb60e944e131 Mon Sep 17 00:00:00 2001
From: Philip K <philipk <at> posteo.net>
Date: Wed, 21 Apr 2021 22:17:27 +0200
Subject: [PATCH] Make outline commands repeatable

* outline.el (outline-navigation-repeat-map): Add new map
(outline-editing-repeat-map): Add new map
---
 lisp/outline.el | 39 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)

diff --git a/lisp/outline.el b/lisp/outline.el
index bce9c6b9e4..fa7c1a27d9 100644
--- a/lisp/outline.el
+++ b/lisp/outline.el
@@ -1274,6 +1274,45 @@ outline-cycle-buffer
       (setq outline--cycle-buffer-state 'show-all)
       (message "Show all")))))
 
+(defvar outline-navigation-repeat-map
+  (let ((map (make-sparse-keymap)))
+    (define-key map (kbd "C-b") #'outline-backward-same-level)
+    (define-key map (kbd "b") #'outline-backward-same-level)
+    (define-key map (kbd "C-f") #'outline-forward-same-level)
+    (define-key map (kbd "f") #'outline-forward-same-level)
+    (define-key map (kbd "C-n") #'outline-next-visible-heading)
+    (define-key map (kbd "n") #'outline-next-visible-heading)
+    (define-key map (kbd "C-p") #'outline-previous-visible-heading)
+    (define-key map (kbd "p") #'outline-previous-visible-heading)
+    (define-key map (kbd "C-u") #'outline-up-heading)
+    (define-key map (kbd "u") #'outline-up-heading)
+    map))
+
+(dolist (command '(outline-backward-same-level
+                   outline-forward-same-level
+                   outline-next-visible-heading
+                   outline-previous-visible-heading
+                   outline-up-heading))
+  (put command 'repeat-map 'outline-navigation-repeat-map))
+
+(defvar outline-editing-repeat-map
+  (let ((map (make-sparse-keymap)))
+    (define-key map (kbd "C-v") #'outline-move-subtree-down)
+    (define-key map (kbd "v") #'outline-move-subtree-down)
+    (define-key map (kbd "C-^") #'outline-move-subtree-up)
+    (define-key map (kbd "^") #'outline-move-subtree-up)
+    (define-key map (kbd "C->") #'outline-demote)
+    (define-key map (kbd ">") #'outline-demote)
+    (define-key map (kbd "C-<") #'outline-promote)
+    (define-key map (kbd "<") #'outline-promote)
+    map))
+
+(dolist (command '(outline-move-subtree-down
+                   outline-move-subtree-up
+                   outline-demote
+                   outline-promote))
+  (put command 'repeat-map 'outline-editing-repeat-map))
+
 (provide 'outline)
 (provide 'noutline)
 
-- 
2.30.2


Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47878; Package emacs. (Wed, 21 Apr 2021 21:17:02 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: Philip Kaludercic <philipk <at> posteo.net>
Cc: 47878 <at> debbugs.gnu.org
Subject: Re: bug#47878: Mark outline commands as repeatable
Date: Thu, 22 Apr 2021 00:15:32 +0300
> I've implemented your suggestions. Letting the editing map inherit from
> the navigation map doesn't seem like a good idea, as long as repeat-mode
> overwrites the repeat-map, because that makes commands disappear all of
> a sudden.

Thanks, I've tested your patch, and everything works swimmingly,
so now pushed to master.  Please close this feature request
when you think everything is done here.

> The extra keys without control are convenient, but it does
> write a lot into the mini-buffer.

Displaying the keys is customizable now, so this is less problematic.




Added tag(s) fixed. Request was from Stefan Kangas <stefan <at> marxist.se> to control <at> debbugs.gnu.org. (Sun, 25 Apr 2021 11:18:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47878; Package emacs. (Mon, 03 May 2021 10:31:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: Philip Kaludercic <philipk <at> posteo.net>, 47878 <at> debbugs.gnu.org
Subject: Re: bug#47878: Mark outline commands as repeatable
Date: Mon, 03 May 2021 12:30:37 +0200
Juri Linkov <juri <at> linkov.net> writes:

>> I've implemented your suggestions. Letting the editing map inherit from
>> the navigation map doesn't seem like a good idea, as long as repeat-mode
>> overwrites the repeat-map, because that makes commands disappear all of
>> a sudden.
>
> Thanks, I've tested your patch, and everything works swimmingly,
> so now pushed to master.  Please close this feature request
> when you think everything is done here.

Skimming this thread, it's not clear whether there's anything more to do
here or not...

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47878; Package emacs. (Mon, 03 May 2021 17:05:02 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Philip Kaludercic <philipk <at> posteo.net>, 47878 <at> debbugs.gnu.org
Subject: Re: bug#47878: Mark outline commands as repeatable
Date: Mon, 03 May 2021 19:44:29 +0300
tags 47878 fixed
close 47878 28.0.50
thanks

>>> I've implemented your suggestions. Letting the editing map inherit from
>>> the navigation map doesn't seem like a good idea, as long as repeat-mode
>>> overwrites the repeat-map, because that makes commands disappear all of
>>> a sudden.
>>
>> Thanks, I've tested your patch, and everything works swimmingly,
>> so now pushed to master.  Please close this feature request
>> when you think everything is done here.
>
> Skimming this thread, it's not clear whether there's anything more to do
> here or not...

I believe this could be closed now.




bug marked as fixed in version 28.0.50, send any further explanations to 47878 <at> debbugs.gnu.org and Philip Kaludercic <philipk <at> posteo.net> Request was from Juri Linkov <juri <at> linkov.net> to control <at> debbugs.gnu.org. (Mon, 03 May 2021 17:05:03 GMT) Full text and rfc822 format available.

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

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

Previous Next


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