From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" 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: Sat, 08 Oct 2022 13:24:26 -0400 Message-ID: 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> <83wn9eu8qu.fsf@gnu.org> <53e1c03a-25da-c772-1801-8c8cb8ee0df3@gmx.at> <125e8395-b083-6825-d6b7-73ec15b433c8@gmx.at> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26341"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: Eli Zaretskii , 58175@debbugs.gnu.org, miha@kamnitnik.top To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 08 19:26:48 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 1ohDb5-0006db-35 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 08 Oct 2022 19:26:47 +0200 Original-Received: from localhost ([::1]:54538 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ohDb3-0000hj-Sq for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 08 Oct 2022 13:26:45 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53072) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ohDZQ-00007H-6b for bug-gnu-emacs@gnu.org; Sat, 08 Oct 2022 13:25:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42310) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ohDZO-0004in-Eu for bug-gnu-emacs@gnu.org; Sat, 08 Oct 2022 13:25:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ohDZO-0003PZ-A8 for bug-gnu-emacs@gnu.org; Sat, 08 Oct 2022 13:25:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 08 Oct 2022 17:25: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.166524987913078 (code B ref 58175); Sat, 08 Oct 2022 17:25:02 +0000 Original-Received: (at 58175) by debbugs.gnu.org; 8 Oct 2022 17:24:39 +0000 Original-Received: from localhost ([127.0.0.1]:41388 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ohDZ1-0003Os-7Z for submit@debbugs.gnu.org; Sat, 08 Oct 2022 13:24:39 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:19332) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ohDYw-0003OP-O2 for 58175@debbugs.gnu.org; Sat, 08 Oct 2022 13:24:35 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 1538880636; Sat, 8 Oct 2022 13:24:29 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 82F5F8006F; Sat, 8 Oct 2022 13:24:27 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1665249867; bh=x75tJ4Pdk4Uev628iG1ENn5PXmloRLfcCKIBYMzLeLI=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=O3kUuaoNgqEnTIW1Gp66qe9/8g9hrD4nRCVea5nIX7sPQQ2sYIMy7IVzOEj6BZofg aUowxmtZIK1rvsCwILIq79xOM8L4A+WjbRdTxttY+NxE85HgSjEEZs7mv5FQ8zA0fS 98efrAzfsbwOytRtv5SDBgv10cPDOEPemig+3saRZBZUxzH5bxM/wl4p8OlWxO8pQ9 JH5WNy4UJtYJ7AaWAO/VjizZnf14cRvei5IGzIADbnZi7aMllIrsWbsB2D3dfdFfFy IVMPc7O2mFJ6uSirj18oyeY1rWJST1ra282usIZtOVBU3iujCyxbeZVTnfUyyzAP3M v0pF/eWEUcTKA== Original-Received: from pastel (65-110-220-202.cpe.pppoe.ca [65.110.220.202]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 3D918120873; Sat, 8 Oct 2022 13:24:27 -0400 (EDT) In-Reply-To: <125e8395-b083-6825-d6b7-73ec15b433c8@gmx.at> (martin rudalics's message of "Sat, 8 Oct 2022 12:05:25 +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:244927 Archived-At: > 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