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


Message #65 received at 58175 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: martin rudalics <rudalics <at> gmx.at>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 58175 <at> debbugs.gnu.org, miha <at> kamnitnik.top
Subject: Re: bug#58175: 29.0.50; M-x window-swap-states during an active
 mark leaves behind a region overlay
Date: Sat, 08 Oct 2022 13:24:26 -0400
> What we talk about here is this form in 'window--state-put-2':
>
>       (dolist (parameter (window-parameters window))
> 	(set-window-parameter window (car parameter) nil))

Yes.

> which has no equivalent in 'set-window-configuration'.
>
> The distinction is due to the fact that 'set-window-configuration' works
> on already existing (albeit temporarily deleted) windows while
> 'window-state-put' as a rule has to work on pristine windows.

But the above `dolist` does nothing on pristine windows.
So it's been put there explicitly for the case of non-pristine windows.

> Maybe that aspect is biting us here and we should leave pre-existing
> parameters alone as you suggest.

It seems like the simpler option, yes.

> But doesn't the fact that 'set-window-configuration' handles a nil value
> of a parameter distinctly from "no value for that parameter has been
> stored yet" mean that it handles window parameters specially, unlike
> other window components or the way we handle frame parameters?

I don't follow.  AFAIK the special handling of nil there is simply an
optimization to avoid adding useless nil entries in the parameter list.

> And haven't we discussed these issues already here
> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=10348
>
> and here?
>
> https://lists.gnu.org/archive/html/emacs-diffs/2012-01/msg00140.html

Thanks for these links.

It was very helpful for me to re-read what those past Stefan and Martin
guys had to say.  Tho it seems they didn't talk very much about what
happens to the poor window-parameters of the target windows, they only
talked about the parameters of the source windows and how/if they should
be transferred to a target window (potentially via a file).

The current bug report points out that we should also pay attention to
the parameters of the target window (because we overwrite them or throw
them away).

>> AFAIK the current code works fine with `set-window-configuration`.
>> And indeed `set-window-configuration` behaves the way I suggest
>> `window-state-put` should behave:
>>
>> 	  /* Restore any window parameters that have been saved.
>> 	     Parameters that have not been saved are left alone.  */
>
> But 'set-window-configuration' does not DTRT when the region overlay
> parameter is made persistent.

But that's because that window parameter should *not* be persistent.


        Stefan





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.