From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs 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 Message-ID: <83a66if2r0.fsf@gnu.org> References: <86sfkaay2d.fsf@miha-pc> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34481"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 58175@debbugs.gnu.org To: miha@kamnitnik.top Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Sep 29 20:36:24 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1odyOV-0008no-B8 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 29 Sep 2022 20:36:23 +0200 Original-Received: from localhost ([::1]:38500 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1odyOU-0006Q4-7q for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 29 Sep 2022 14:36:22 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50648) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odyOA-0006Od-7F for bug-gnu-emacs@gnu.org; Thu, 29 Sep 2022 14:36:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40499) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1odyO9-0000Ac-Vi for bug-gnu-emacs@gnu.org; Thu, 29 Sep 2022 14:36:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1odyO9-00057S-Qh for bug-gnu-emacs@gnu.org; Thu, 29 Sep 2022 14:36:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 29 Sep 2022 18:36:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58175 X-GNU-PR-Package: emacs Original-Received: via spool by 58175-submit@debbugs.gnu.org id=B58175.166447652919635 (code B ref 58175); Thu, 29 Sep 2022 18:36:01 +0000 Original-Received: (at 58175) by debbugs.gnu.org; 29 Sep 2022 18:35:29 +0000 Original-Received: from localhost ([127.0.0.1]:39577 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1odyNc-00056c-Qy for submit@debbugs.gnu.org; Thu, 29 Sep 2022 14:35:29 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:35754) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1odyNY-00056L-NA for 58175@debbugs.gnu.org; Thu, 29 Sep 2022 14:35:27 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:40948) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odyNQ-0008Qi-5D; Thu, 29 Sep 2022 14:35:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=FDC2XzPIoy0+Bxm3y/mD6JviivNfPJNdeFg3V3U+S2g=; b=h2fnI49A34Ji mPMPegG/1hMJW4sPP8hvwZebaHoImnP1EV5Burr+t5DUTKCxHTs8pjC/pfaR0FBKd5cAOxQq5R0Od aWKzVkXtJ8DP92XUbk3nZm6+uwnshusb4aA6F6f+5LoD4tC3AOFc+aB9RbFT1POAy7AERen9nHUwx iKNrbzp5DdFdEndp8K+AabeXt/PppSGVtJowsmxuYCnYLi3F/fWyfAJ12WfQTtzRlh3R7Rcy2+qDX IjpJC1XQLnL0Tpc30v0Eveam/4ByjsMobFfG4fsB4t21Qx34cyvOKR2VtStro+N96l7f2lMlURX8B K9K3eiYhk2Vs2BZ+XnWmgA==; Original-Received: from [87.69.77.57] (port=3770 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odyNI-0007tF-KJ; Thu, 29 Sep 2022 14:35:14 -0400 In-Reply-To: <86sfkaay2d.fsf@miha-pc> (bug-gnu-emacs@gnu.org) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:243943 Archived-At: > Date: Thu, 29 Sep 2022 19:29:46 +0200 > From: miha--- via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > 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?