all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: "Rudolf Adamkovič" <salutis@me.com>
Cc: 59505@debbugs.gnu.org
Subject: bug#59505: 29.0.50; Compact mode line breaks mouse interactions
Date: Wed, 23 Nov 2022 22:48:14 +0200	[thread overview]
Message-ID: <83r0xtxur5.fsf@gnu.org> (raw)
In-Reply-To: <m2h6yqkrja.fsf@me.com> (bug-gnu-emacs@gnu.org)

> 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	other threads:[~2022-11-23 20:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-23  8:23 bug#59505: 29.0.50; Compact mode line breaks mouse interactions Rudolf Adamkovič via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-23 20:48 ` Eli Zaretskii [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83r0xtxur5.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=59505@debbugs.gnu.org \
    --cc=salutis@me.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.