From: miha--- 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: 58175@debbugs.gnu.org
Subject: bug#58175: 29.0.50; M-x window-swap-states during an active mark leaves behind a region overlay
Date: Thu, 29 Sep 2022 21:17:56 +0200 [thread overview]
Message-ID: <8735cauh0b.fsf@miha-pc> (raw)
In-Reply-To: <83a66if2r0.fsf@gnu.org>
[-- Attachment #1: Type: text/plain, Size: 1800 bytes --]
Eli Zaretskii <eliz@gnu.org> writes:
>> Date: Thu, 29 Sep 2022 19:29:46 +0200
>> From: miha--- via "Bug reports for GNU Emacs,
>> the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
>>
>> 1. 'C-h e' to display *Messages* in a new window
>> 2. 'C-SPC C-n' to mark an active region
>> 3. 'M-x window-swap-states'
>> 4. 'C-g C-n' to deactivate the mark
>>
>> Notice how the region overlay stays there.
>
> "There" where?
In the *GNU Emacs* buffer, where we have originally marked a region in
step 2.
> What did you expect to happen in the above scenario, and why?
I expect the overlay to disappear after deactivating the mark with 'C-g'
in step 4.
>> window-state-put sets 'internal-region-overlay' window parameter to nil
>> without removing the actual region overlay
>
> Where in the code do you see that? I see this:
>
> (with-current-buffer (window-buffer window-1)
> (dolist (overlay (overlays-in (point-min) (point-max)))
> (let ((window (overlay-get overlay 'window)))
> (cond
> ((not window))
> ((eq window window-1)
> (overlay-put overlay 'window window-2))
> ((eq window window-2)
> (overlay-put overlay 'window window-1))))))
>
> AFAIU, this _swaps_ the 'window' property of the overlays, so that the
> overlay now belongs (and should be visible) in the other window.
> Which is what I should expect.
Indeed the overlay is shown in the correct window after step 3. The
problem is that it doesn't disappear after step 4
('redisplay--update-region-highlight' doesn't remove it).
> What am I missing?
Perhaps you forgot to deactivate the mark in step 4? If there is
anything unclear in the bug recipe, go ahead and ask.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 861 bytes --]
next prev parent reply other threads:[~2022-09-29 19:17 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 [this message]
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
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=8735cauh0b.fsf@miha-pc \
--to=bug-gnu-emacs@gnu.org \
--cc=58175@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=miha@kamnitnik.top \
/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.