]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/tab-bar.el: Support mouse clicks for multi-item 'global-mode-string'.
authorJuri Linkov <juri@linkov.net>
Mon, 6 May 2024 16:43:50 +0000 (19:43 +0300)
committerEshel Yaron <me@eshelyaron.com>
Mon, 6 May 2024 16:57:14 +0000 (18:57 +0200)
(tab-bar-format-global): Split elements of 'global-mode-string'
to separate items of the tab bar, so events for each item are
handled separately (bug#70086).

(cherry picked from commit 9ecd65a6607aaaaf4ef74f52e252ab1c64dcbdff)

lisp/tab-bar.el

index 2e3d9a6b4ac8ac2decba26ccce1d4e15ccd27bbf..26023f24389405bee383ff8fc239c8257a4c6b23 100644 (file)
@@ -1119,7 +1119,9 @@ When `tab-bar-format-global' is added to `tab-bar-format'
 then modes that display information on the mode line
 using `global-mode-string' will display the same text
 on the tab bar instead."
-  `((global menu-item ,(format-mode-line global-mode-string) ignore)))
+  (mapcar (lambda (string)
+            `(global menu-item ,(format-mode-line string) ignore))
+          global-mode-string))
 
 (defun tab-bar-format-list (format-list)
   (let ((i 0))