bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#59505: 29.0.50; Compact mode line breaks mouse interactions


From: Eli Zaretskii
Subject: bug#59505: 29.0.50; Compact mode line breaks mouse interactions
Date: Wed, 23 Nov 2022 22:48:14 +0200

> Date: Wed, 23 Nov 2022 09:23:53 +0100
> From:  Rudolf Adamkovič via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> 
> 
> I noticed that
> 
>   (setq mode-line-compact t)
> 
> breaks mouse interaction with the mode line.
> 
> For instance, when I hover the mouse over a mode shown in the mode line,
> Emacs often highlights zero, one, two, or even three modes, instead of
> always highlighting the one under the mouse cursor.

This is a limitation of how mode-line-compact is implemented.  It starts by
producing a string using format-mode-line.  If you try this:

  M-: (insert (format-mode-line mode-line-format)) RET

and hover the mouse over the inserted string, you will see the same issue
there.  The technical reason for this is that the original mode line is made
of several separate Lisp string, which allows Emacs to highlight each of
those parts separately, whereas the result of format-mode-line is a single
Lisp string, where a sequence of characters that have the same mouse-face
property will react together to the hovering mouse.

So unless someone comes up with a better idea of how to compact the mode
line, we will have to live with this limitation.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]