emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 63cbb54: Mark page navigation commands as repeatable


From: Lars Ingebrigtsen
Subject: master 63cbb54: Mark page navigation commands as repeatable
Date: Fri, 20 Aug 2021 11:50:22 -0400 (EDT)

branch: master
commit 63cbb54d7e163f74657dba46829262282ccda0df
Author: Davide Masserut <dm@mssdvd.com>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Mark page navigation commands as repeatable
    
    * doc/emacs/basic.texi (Repeating): Document page navigation
    repeatability.
    
    * lisp/bindings.el (page-navigation-repeat-map): Add new map
    (bug#50137).
    * lisp/bindings.el (forward-page):
    (backward-page): Mark as repeatable.
    
    Copyright-paperwork-exempt: yes
---
 doc/emacs/basic.texi | 17 +++++++++--------
 lisp/bindings.el     | 11 +++++++++++
 2 files changed, 20 insertions(+), 8 deletions(-)

diff --git a/doc/emacs/basic.texi b/doc/emacs/basic.texi
index ba8d822..6bf1809 100644
--- a/doc/emacs/basic.texi
+++ b/doc/emacs/basic.texi
@@ -887,15 +887,16 @@ z z z}.  The first @kbd{C-x z} repeats the command once, 
and each
 subsequent @kbd{z} repeats it once again.
 
 @findex repeat-mode
-  Also you can activate @code{repeat-mode} that temporarily enables
-a transient mode with short keys after a limited number of commands.
+  Also you can activate @code{repeat-mode} that temporarily enables a
+transient mode with short keys after a limited number of commands.
 Currently supported shorter key sequences are @kbd{C-x u u} instead of
 @kbd{C-x u C-x u} to undo many changes, @kbd{C-x o o} instead of
 @kbd{C-x o C-x o} to switch several windows, @kbd{C-x @{ @{ @} @} ^ ^
 v v} to resize the selected window interactively, @kbd{M-g n n p p} to
-navigate @code{next-error} matches.  Any other key exits transient mode
-and then is executed normally.  The user option @code{repeat-exit-key}
-defines an additional key to exit this transient mode.  Also it's
-possible to break the repetition chain automatically after idle time
-by customizing the user option @code{repeat-exit-timeout} to a number
-of seconds.
+navigate @code{next-error} matches, and @kbd{C-x ] ] [ [} to navigate
+through pages.  Any other key exits transient mode and then is
+executed normally.  The user option @code{repeat-exit-key} defines an
+additional key to exit this transient mode.  Also it's possible to
+break the repetition chain automatically after idle time by
+customizing the user option @code{repeat-exit-timeout} to a number of
+seconds.
diff --git a/lisp/bindings.el b/lisp/bindings.el
index 0345944..b67c6ad 100644
--- a/lisp/bindings.el
+++ b/lisp/bindings.el
@@ -1434,6 +1434,17 @@ if `inhibit-field-text-motion' is non-nil."
 
 (define-key ctl-x-map "[" 'backward-page)
 (define-key ctl-x-map "]" 'forward-page)
+
+(defvar page-navigation-repeat-map
+  (let ((map (make-sparse-keymap)))
+    (define-key map (kbd "]") #'forward-page)
+    (define-key map (kbd "[") #'backward-page)
+    map)
+  "Keymap to repeat page navigation key sequences.  Used in `repeat-mode'.")
+
+(put 'forward-page 'repeat-map 'page-navigation-repeat-map)
+(put 'backward-page 'repeat-map 'page-navigation-repeat-map)
+
 (define-key ctl-x-map "\C-p" 'mark-page)
 (define-key ctl-x-map "l" 'count-lines-page)
 (define-key ctl-x-map "np" 'narrow-to-page)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]