GNU bug report logs - #58175
29.0.50; M-x window-swap-states during an active mark leaves behind a region overlay

Previous Next

Package: emacs;

Reported by: miha <at> kamnitnik.top

Date: Thu, 29 Sep 2022 17:17:02 UTC

Severity: normal

Found in version 29.0.50

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: miha <at> kamnitnik.top
Cc: 58175 <at> 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:34:59 +0300
> 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 <at> 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?

What did you expect to happen in the above scenario, and why?

> 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.

What am I missing?




This bug report was last modified 2 years and 304 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.