Subject: bug#73027: Fwd: 31.0.50; tab-bar-formal-global erased global-modeline-string's mouse hover/click action menu

From: Eli Zaretskii <[email-masked]>
Date: Sat, 21 Sep 2024 12:15:24 +0300

> Cc: [email-masked]
> From: Juri Linkov <[email-masked]>
> Date: Tue, 10 Sep 2024 09:38:06 +0300
> 
> >> Also please eval these calls and show their return values.
> >
> > 1. (mu4e--modeline-string) :
> >
> > #(" 🌀0/0 " 1 2 (help-echo "mu4e favorite bookmark 'Unread messages':
> 
> Thanks for the reproducible test case.
> 
> The problem is that the mode-line keymap can't be used without
> replacing the symbol 'mode-line' with 'tab-bar'.  This means that
> this recipe doesn't work:
> 
> ```elisp
> (defun mu4e--modeline-string ()
>   #(" 🌀0/0 "
>   0 5 (help-echo "mu4e favorite bookmark"
>        mouse-face mode-line-highlight
>        keymap (mode-line . (keymap (mouse-1 . mu4e-jump-to-favorite)
>                                    (mouse-2 . mu4e-jump-to-favorite)
>                                    (mouse-3 . mu4e-jump-to-favorite))))))
> 
> (add-to-list 'global-mode-string '(:eval (mu4e--modeline-string)) t)
> 
> (defun mu4e-jump-to-favorite ()
>   (interactive)
>   (message "DONE"))
> 
> (setopt tab-bar-format (append tab-bar-format '(tab-bar-format-align-right
>                                                 tab-bar-format-global)))
> (tab-bar-mode)
> ```
> 
> But after remapping the symbol 'mode-line' with 'tab-bar',
> it works nicely:
> 
> ```elisp
> (defun mu4e--modeline-string ()
>   #(" 🌀0/0 "
>   0 5 (help-echo "mu4e favorite bookmark"
>        mouse-face mode-line-highlight
>        keymap (keymap (tab-bar . (keymap (mouse-1 . mu4e-jump-to-favorite)
>                                          (mouse-2 . mu4e-jump-to-favorite)
>                                          (mouse-3 . mu4e-jump-to-favorite)))))))
> ```

Should we close this bug with the above workaround?  Or would we like
to solve it in some other way?