all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: martin rudalics <rudalics@gmx.at>,
	58175@debbugs.gnu.org, miha@kamnitnik.top
Subject: bug#58175: 29.0.50; M-x window-swap-states during an active mark leaves behind a region overlay
Date: Tue, 04 Oct 2022 16:27:13 -0400	[thread overview]
Message-ID: <jwv4jwjqr8g.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <83bkqrv8af.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 04 Oct 2022 19:54:32 +0300")

>>  > Looks like the internal-region-overlay window parameter, which is
>>  > important for correct workings of region-highlight, isn't copied
>>  > correctly to the other window as part of swapping state, because its
>>  > value ends up as "overlay N in no buffer", i.e. the overlay's buffer
>>  > is lost in transition.
>> 
>> If you want a window parameter to get copied when swapping window states,
>> you have to explicitly mark it as "persistent".  For example with:
>> 
>> (push '(internal-region-overlay . t) window-persistent-parameters)

Hmm... I must say I misunderstood the report when I read it originally.
Now that I see a bit more clearly what it's about I wonder why we'd have
to do something special (w.r.t `internal-region-overlay`) for
`window-swap-states` compared to what we do (i.e. nothing at all) when
we do `set-window-buffer`.

More specifically, AFAICT the code that uses `internal-region-overlay`
just tries to reuse that info to try and reduce memory churn, but it
should work correctly even when `internal-region-overlay` points to the
wrong buffer or even if it's not an overlay at all.

IOW, I suspect the bug is in `redisplay-(un)highlight-region-function`
and adding `internal-region-overlay` to `window-persistent-parameters`
would likely just cover it for that use-case but it could
reoccur elsewhere.


        Stefan






  reply	other threads:[~2022-10-04 20:27 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-29 17:29 bug#58175: 29.0.50; M-x window-swap-states during an active mark leaves behind a region overlay miha--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-09-29 18:34 ` Eli Zaretskii
2022-09-29 19:17   ` miha--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-09-29 19:19     ` Eli Zaretskii
2022-10-02 16:50       ` Eli Zaretskii
2022-10-04  8:23         ` martin rudalics
2022-10-04 16:54           ` Eli Zaretskii
2022-10-04 20:27             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2022-10-04 21:03               ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-04 21:25                 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-05  5:42                   ` Eli Zaretskii
2022-10-06 12:25                     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-07  8:17                       ` martin rudalics
2022-10-07 19:28                         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-08 10:05                           ` martin rudalics
2022-10-08 17:24                             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-09 14:05                               ` martin rudalics
2022-10-05  7:36             ` martin rudalics
2022-10-05  8:28               ` Eli Zaretskii
2022-10-06  7:48                 ` martin rudalics
2022-10-06  8:13                   ` Eli Zaretskii
2022-10-07  8:09                     ` martin rudalics

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=jwv4jwjqr8g.fsf-monnier+emacs@gnu.org \
    --to=bug-gnu-emacs@gnu.org \
    --cc=58175@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=miha@kamnitnik.top \
    --cc=monnier@iro.umontreal.ca \
    --cc=rudalics@gmx.at \
    /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.