summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorStefan Kangas <stefankangas@gmail.com>2022-09-12 16:53:26 +0200
committerStefan Kangas <stefankangas@gmail.com>2022-09-13 11:06:40 +0200
commit4f9902eb0c1105406353c8639c6a2f728bcd68b8 (patch)
treeb6642aed288b40719dcc6d987e9cdc9f4d8fbecc /lisp
parentcbbecd46fda2c07b5e00d5ad63e7487680cd5b36 (diff)
downloademacs-4f9902eb0c1105406353c8639c6a2f728bcd68b8.tar.gz
emacs-4f9902eb0c1105406353c8639c6a2f728bcd68b8.tar.bz2
emacs-4f9902eb0c1105406353c8639c6a2f728bcd68b8.zip
Prefer defvar-keymap in tab-line.el
* lisp/tab-line.el (tab-line-tab-map, tab-line-add-map) (tab-line-tab-close-map, tab-line-left-map, tab-line-right-map): Prefer defvar-keymap.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/tab-line.el68
1 files changed, 29 insertions, 39 deletions
diff --git a/lisp/tab-line.el b/lisp/tab-line.el
index 3e3b4c95595..94e8f29a95f 100644
--- a/lisp/tab-line.el
+++ b/lisp/tab-line.el
@@ -135,45 +135,35 @@ function `tab-line-tab-face-group'."
:group 'tab-line-faces)
-(defvar tab-line-tab-map
- (let ((map (make-sparse-keymap)))
- (define-key map [tab-line down-mouse-1] 'tab-line-select-tab)
- (define-key map [tab-line mouse-2] 'tab-line-close-tab)
- (define-key map [tab-line down-mouse-3] 'tab-line-tab-context-menu)
- (define-key map "\C-m" 'tab-line-select-tab)
- map)
- "Local keymap for `tab-line-mode' window tabs.")
-
-(defvar tab-line-add-map
- (let ((map (make-sparse-keymap)))
- (define-key map [tab-line down-mouse-1] 'tab-line-new-tab)
- (define-key map [tab-line down-mouse-2] 'tab-line-new-tab)
- (define-key map "\C-m" 'tab-line-new-tab)
- map)
- "Local keymap to add `tab-line-mode' window tabs.")
-
-(defvar tab-line-tab-close-map
- (let ((map (make-sparse-keymap)))
- (define-key map [tab-line mouse-1] 'tab-line-close-tab)
- (define-key map [tab-line mouse-2] 'tab-line-close-tab)
- map)
- "Local keymap to close `tab-line-mode' window tabs.")
-
-(defvar tab-line-left-map
- (let ((map (make-sparse-keymap)))
- (define-key map [tab-line down-mouse-1] 'tab-line-hscroll-left)
- (define-key map [tab-line down-mouse-2] 'tab-line-hscroll-left)
- (define-key map "\C-m" 'tab-line-new-tab)
- map)
- "Local keymap to scroll `tab-line-mode' window tabs to the left.")
-
-(defvar tab-line-right-map
- (let ((map (make-sparse-keymap)))
- (define-key map [tab-line down-mouse-1] 'tab-line-hscroll-right)
- (define-key map [tab-line down-mouse-2] 'tab-line-hscroll-right)
- (define-key map "\C-m" 'tab-line-new-tab)
- map)
- "Local keymap to scroll `tab-line-mode' window tabs to the right.")
+(defvar-keymap tab-line-tab-map
+ :doc "Local keymap for `tab-line-mode' window tabs."
+ "<tab-line> <down-mouse-1>" #'tab-line-select-tab
+ "<tab-line> <mouse-2>" #'tab-line-close-tab
+ "<tab-line> <down-mouse-3>" #'tab-line-tab-context-menu
+ "RET" #'tab-line-select-tab)
+
+(defvar-keymap tab-line-add-map
+ :doc "Local keymap to add `tab-line-mode' window tabs."
+ "<tab-line> <down-mouse-1>" #'tab-line-new-tab
+ "<tab-line> <down-mouse-2>" #'tab-line-new-tab
+ "RET" #'tab-line-new-tab)
+
+(defvar-keymap tab-line-tab-close-map
+ :doc "Local keymap to close `tab-line-mode' window tabs."
+ "<tab-line> <mouse-1>" #'tab-line-close-tab
+ "<tab-line> <mouse-2>" #'tab-line-close-tab)
+
+(defvar-keymap tab-line-left-map
+ :doc "Local keymap to scroll `tab-line-mode' window tabs to the left."
+ "<tab-line> <down-mouse-1>" #'tab-line-hscroll-left
+ "<tab-line> <down-mouse-2>" #'tab-line-hscroll-left
+ "RET" #'tab-line-new-tab)
+
+(defvar-keymap tab-line-right-map
+ :doc "Local keymap to scroll `tab-line-mode' window tabs to the right."
+ "<tab-line> <down-mouse-1>" #'tab-line-hscroll-right
+ "<tab-line> <down-mouse-2>" #'tab-line-hscroll-right
+ "RET" #'tab-line-new-tab)
(defcustom tab-line-new-tab-choice t