Subject: Re: bug#58175: 29.0.50; M-x window-swap-states during an active mark leaves behind a region overlay

From: martin rudalics <[email-masked]>
Date: Tue, 4 Oct 2022 10:23:49 +0200

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

martin