summaryrefslogtreecommitdiff
path: root/lisp/bindings.el
diff options
context:
space:
mode:
authorJuri Linkov <juri@linkov.net>2021-02-17 20:04:42 +0200
committerJuri Linkov <juri@linkov.net>2021-02-17 20:04:42 +0200
commit12409c9064c386a496dcbdca76b790108f6c1cad (patch)
tree6b10d190e518cb2e69a3dfc729dff7767d5ab3e3 /lisp/bindings.el
parent734396aa04cd57173f1a604397244ed84f3f56a8 (diff)
downloademacs-12409c9064c386a496dcbdca76b790108f6c1cad.tar.gz
emacs-12409c9064c386a496dcbdca76b790108f6c1cad.tar.bz2
emacs-12409c9064c386a496dcbdca76b790108f6c1cad.zip
New transient mode 'repeat-mode' to allow shorter key sequences (bug#46515)
* doc/emacs/basic.texi (Repeating): Document repeat-mode. * lisp/repeat.el (repeat-exit-key): New defcustom. (repeat-mode): New global minor mode. (repeat-post-hook): New function. * lisp/bindings.el (undo-repeat-map): New variable. (undo): Put 'repeat-map' property with 'undo-repeat-map'. (next-error-repeat-map): New variable. (next-error, previous-error): Put 'repeat-map' property with 'next-error-repeat-map'. * lisp/window.el (other-window-repeat-map): New variable. (other-window): Put 'repeat-map' property with 'other-window-repeat-map'. (resize-window-repeat-map): New variable. (enlarge-window, enlarge-window-horizontally) (shrink-window-horizontally, shrink-window): Put 'repeat-map' property with 'resize-window-repeat-map'.
Diffstat (limited to 'lisp/bindings.el')
-rw-r--r--lisp/bindings.el17
1 files changed, 17 insertions, 0 deletions
diff --git a/lisp/bindings.el b/lisp/bindings.el
index 2f4bab11cf5..7111ae6612c 100644
--- a/lisp/bindings.el
+++ b/lisp/bindings.el
@@ -950,6 +950,12 @@ if `inhibit-field-text-motion' is non-nil."
;; Richard said that we should not use C-x <uppercase letter> and I have
;; no idea whereas to bind it. Any suggestion welcome. -stef
;; (define-key ctl-x-map "U" 'undo-only)
+(defvar undo-repeat-map
+ (let ((map (make-sparse-keymap)))
+ (define-key map "u" 'undo)
+ map)
+ "Keymap to repeat undo key sequences `C-x u u'. Used in `repeat-mode'.")
+(put 'undo 'repeat-map 'undo-repeat-map)
(define-key esc-map "!" 'shell-command)
(define-key esc-map "|" 'shell-command-on-region)
@@ -1036,6 +1042,17 @@ if `inhibit-field-text-motion' is non-nil."
(define-key ctl-x-map "`" 'next-error)
+(defvar next-error-repeat-map
+ (let ((map (make-sparse-keymap)))
+ (define-key map "n" 'next-error)
+ (define-key map "\M-n" 'next-error)
+ (define-key map "p" 'previous-error)
+ (define-key map "\M-p" 'previous-error)
+ map)
+ "Keymap to repeat next-error key sequences. Used in `repeat-mode'.")
+(put 'next-error 'repeat-map 'next-error-repeat-map)
+(put 'previous-error 'repeat-map 'next-error-repeat-map)
+
(defvar goto-map (make-sparse-keymap)
"Keymap for navigation commands.")
(define-key esc-map "g" goto-map)