Subject: bug#56662: 29.0.50; Funny region highlights when highlight-nonselected-windows is t

From: Eli Zaretskii <[email-masked]>
Date: Thu, 21 Jul 2022 09:22:01 +0300

> From: Kévin Le Gouguec <[email-masked]>
> Cc: Visuwesh <[email-masked]>,  [email-masked]
> Date: Wed, 20 Jul 2022 22:16:26 +0200
> 
> (1) Haven't been able to find a reproducible recipe, but on occasion,
>     when hitting C-SPC in window-2, the highlighting in window-1
>     sometimes "snaps" and updates to match the mark I just set in
>     window-2.

Probably because you did something that deactivated the mark there.
It's very easy to deactivate the mark.  Which is why this feature is
only good for very short periods of time, and shouldn't be expected to
DTRT in any scenario except temporarily having more than one window
with highlight -- unless you never display the same buffer in several
windows.

>     I kind of wish there was a third value for this user option;
>     e.g. (setq highlight-nonselected-windows 'lazy) to signify "keep
>     highlighting as-is when leaving the window, and never update it
>     until the window becomes current again"? 🤷

How would that work, if you take into consideration that the region is
between the mark and point?

And again, are you talking about the same buffer displayed in several
windows, or are you talking about different buffers?  For the latter
case, I think the problems you describe don't exist.

> If any of (2) makes sense, could this bug remain open as a wishlist
> item?

I don't see how it could work, but maybe I'm missing something.

In any case, does someone volunteer to work on this?  Because if not,
we'll just have another bug report that is open forever.