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: Wed, 05 Oct 2022 11:28:30 +0300 Message-ID: <83k05eu11t.fsf@gnu.org> References: <86sfkaay2d.fsf@miha-pc> <83a66if2r0.fsf@gnu.org> <8735cauh0b.fsf@miha-pc> <837d1mf0op.fsf@gnu.org> <83fsg6186y.fsf@gnu.org> <83bkqrv8af.fsf@gnu.org> <4b64c2c5-4613-c690-d32d-ce21e36faba0@gmx.at> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25977"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 58175@debbugs.gnu.org, monnier@iro.umontreal.ca, miha@kamnitnik.top To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Oct 05 10:29:34 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 1ofzmX-0006aS-Hi for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 05 Oct 2022 10:29:33 +0200 Original-Received: from localhost ([::1]:57396 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ofzmW-0002NW-Fc for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 05 Oct 2022 04:29:32 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51960) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ofzm2-0002Lp-F9 for bug-gnu-emacs@gnu.org; Wed, 05 Oct 2022 04:29:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56740) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ofzm2-0001FV-6y for bug-gnu-emacs@gnu.org; Wed, 05 Oct 2022 04:29:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ofzm2-0002AL-22 for bug-gnu-emacs@gnu.org; Wed, 05 Oct 2022 04:29:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 05 Oct 2022 08:29:02 +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.16649585258299 (code B ref 58175); Wed, 05 Oct 2022 08:29:02 +0000 Original-Received: (at 58175) by debbugs.gnu.org; 5 Oct 2022 08:28:45 +0000 Original-Received: from localhost ([127.0.0.1]:55818 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ofzlk-00029n-Vg for submit@debbugs.gnu.org; Wed, 05 Oct 2022 04:28:45 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:36222) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ofzlh-00029a-T0 for 58175@debbugs.gnu.org; Wed, 05 Oct 2022 04:28:43 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:48246) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ofzla-0001Df-PP; Wed, 05 Oct 2022 04:28:34 -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=JWJ0qFjxy+LJ2GCp5DpyxpNEAKGIrIyEtuPqTwp4dR8=; b=ODuSBSY04KM3 PiFSE8Zlad2R86I27sAlI/MGlt3uGlrh+DTONkqlLoHM0SOzz4j1rlpIMDxav/+pL7iyLd2nDfQyi rYOeBx6DxFuf4CJ6KxYlhbFz0S54prvKtzGSUI3nRL9Ynqt31xFcnMvB4BGdToDHleH+8WhmE4frM +2FwuS2sR/CXAvpY7rsaDWG6tdGiv7+/AgiRAcvvNhbnwF4IjJrIGd3Nsq1jo9BxhVAzQ9QWEKFWw wNXeqtFVdIZ5clqwcFCy9BOcVdb9VNJ2nsJ0vhdQnYqHQjiqKXWnKcCR9uN87TljYIVXCRxY9+niD gsXmCZT0hCN450adhGAoDw==; Original-Received: from [87.69.77.57] (port=4342 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 1ofzlZ-0003ib-U1; Wed, 05 Oct 2022 04:28:34 -0400 In-Reply-To: <4b64c2c5-4613-c690-d32d-ce21e36faba0@gmx.at> (message from martin rudalics on Wed, 5 Oct 2022 09:36:40 +0200) 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:244496 Archived-At: > Date: Wed, 5 Oct 2022 09:36:40 +0200 > Cc: miha@kamnitnik.top, 58175@debbugs.gnu.org, monnier@iro.umontreal.ca > From: martin rudalics > > Now keeping the mark active when restoring a window configuration is > problematic in the first place since it restores the mark from the saved > state while taking point from the current state possibly ending up in > some arbitrarily specified region. OTOH deactivating the mark in such > case is hardly feasible because restoring a window configurations should > be barely perceptible for the user. In the scenario described in this bug report, point is copied to the new window, so the result is as expected. Deactivating the mark also does the expected job. So it looks like adding internal-region-overlay to the persistent window parameters is a good solution in this case. I suggest that you try that, maybe you will see some problems that I missed. > > If the former, I guess the above should be done > > globally when Emacs is dumped? > > I would try to get rid of the window parameter used here. Active region > highlighting is an activity that affects the selected window only and > not any window. The 'window' property of any overlay used for it must > always refer to the selected window and not any other window. So I see > no use for window parameters here which are mainly useful for overriding > a global variable or the local value of the buffer shown in a window. So you are saying we should redesign how region overlay is implemented and managed? I'd prefer not to go there. > I'd rather use one global overlay and move it (by setting its 'window' > property) whenever 'window-selection-change-functions' tell me that the > selected window has changed. But maybe I'm missing something here. highlight-nonselected-windows, I guess? How can we have a single global overlay and still support that option?