diff options
| -rw-r--r-- | lisp/tab-bar.el | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el index 180db4d3e0c..92e11dec394 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." | |||
| 174 | (when x-position | 174 | (when x-position |
| 175 | (unless (catch 'done | 175 | (unless (catch 'done |
| 176 | (map-keymap | 176 | (map-keymap |
| 177 | (lambda (_key binding) | 177 | (lambda (key binding) |
| 178 | (when (eq (car-safe binding) 'menu-item) | 178 | (when (eq (car-safe binding) 'menu-item) |
| 179 | (when (> (+ column (length (nth 1 binding))) x-position) | 179 | (when (> (+ column (length (nth 1 binding))) x-position) |
| 180 | ;; TODO: handle close | 180 | (if (get-text-property (- x-position column) 'close-tab (nth 1 binding)) |
| 181 | (unless (get-text-property (- x-position column) 'close-tab (nth 1 binding)) | 181 | (let* ((close-key (vector (intern (format "C-%s" key)))) |
| 182 | (close-def (lookup-key keymap close-key))) | ||
| 183 | (when close-def | ||
| 184 | (call-interactively close-def))) | ||
| 182 | (call-interactively (nth 2 binding))) | 185 | (call-interactively (nth 2 binding))) |
| 183 | (throw 'done t)) | 186 | (throw 'done t)) |
| 184 | (setq column (+ column (length (nth 1 binding)))))) | 187 | (setq column (+ column (length (nth 1 binding)))))) |