[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 468c871: * lisp/tab-bar.el (tab-bar-handle-mouse): Handle close b
From: |
Juri Linkov |
Subject: |
master 468c871: * lisp/tab-bar.el (tab-bar-handle-mouse): Handle close button. |
Date: |
Sun, 15 Dec 2019 18:08:52 -0500 (EST) |
branch: master
commit 468c8719945f3dc92a24d2ecc32f3f24f2f49491
Author: Juri Linkov <address@hidden>
Commit: Juri Linkov <address@hidden>
* lisp/tab-bar.el (tab-bar-handle-mouse): Handle close button.
---
lisp/tab-bar.el | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el
index 180db4d..92e11de 100644
--- a/lisp/tab-bar.el
+++ b/lisp/tab-bar.el
@@ -174,11 +174,14 @@ on a console which has no window system but does have a
mouse."
(when x-position
(unless (catch 'done
(map-keymap
- (lambda (_key binding)
+ (lambda (key binding)
(when (eq (car-safe binding) 'menu-item)
(when (> (+ column (length (nth 1 binding))) x-position)
- ;; TODO: handle close
- (unless (get-text-property (- x-position column)
'close-tab (nth 1 binding))
+ (if (get-text-property (- x-position column) 'close-tab
(nth 1 binding))
+ (let* ((close-key (vector (intern (format "C-%s"
key))))
+ (close-def (lookup-key keymap close-key)))
+ (when close-def
+ (call-interactively close-def)))
(call-interactively (nth 2 binding)))
(throw 'done t))
(setq column (+ column (length (nth 1 binding))))))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master 468c871: * lisp/tab-bar.el (tab-bar-handle-mouse): Handle close button.,
Juri Linkov <=