]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/tab-bar.el: Add repeat-map keymaps.
authorJuri Linkov <juri@linkov.net>
Mon, 5 Apr 2021 21:18:59 +0000 (00:18 +0300)
committerJuri Linkov <juri@linkov.net>
Mon, 5 Apr 2021 21:18:59 +0000 (00:18 +0300)
* lisp/tab-bar.el (tab-bar-switch-repeat-map): New keymap used for
'tab-next' and 'tab-previous'.
(tab-bar-move-repeat-map): New keymap used for 'tab-move'.
https://lists.gnu.org/archive/html/emacs-devel/2021-03/msg01103.html

lisp/tab-bar.el

index 2e27b293c5e5f388375cb4efb355cc3ae7a3b84b..f3c2fb7ed9680b17560d4ec4d69364e439a3c7e5 100644 (file)
@@ -2075,6 +2075,28 @@ When `switch-to-buffer-obey-display-actions' is non-nil,
 (define-key tab-prefix-map "\C-r" 'find-file-read-only-other-tab)
 (define-key tab-prefix-map "t" 'other-tab-prefix)
 
+(defvar tab-bar-switch-repeat-map
+  (let ((map (make-sparse-keymap)))
+    (define-key map "o" 'tab-next)
+    (define-key map "O" 'tab-previous)
+    map)
+  "Keymap to repeat tab switch key sequences `C-x t o o O'.
+Used in `repeat-mode'.")
+(put 'tab-next 'repeat-map 'tab-bar-switch-repeat-map)
+(put 'tab-previous 'repeat-map 'tab-bar-switch-repeat-map)
+
+(defvar tab-bar-move-repeat-map
+  (let ((map (make-sparse-keymap)))
+    (define-key map "m" 'tab-move)
+    (define-key map "M" (lambda ()
+                          (interactive)
+                          (setq repeat-map 'tab-bar-move-repeat-map)
+                          (tab-move -1)))
+    map)
+  "Keymap to repeat tab move key sequences `C-x t m m M'.
+Used in `repeat-mode'.")
+(put 'tab-move 'repeat-map 'tab-bar-move-repeat-map)
+
 \f
 (provide 'tab-bar)