From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.devel Subject: Re: [ELPA] Brief v5.90: neighboring window merge on deletion Date: Mon, 25 Mar 2024 10:40:54 +0100 Message-ID: References: <86il1cvp7o.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12961"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: Juri Linkov , Emacs developers To: =?UTF-8?B?6Lev5a6i?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Mar 25 10:41:57 2024 Return-path: Envelope-to: ged-emacs-devel@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 1rogq4-00039W-Ji for ged-emacs-devel@m.gmane-mx.org; Mon, 25 Mar 2024 10:41:56 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rogpD-0002KH-IZ; Mon, 25 Mar 2024 05:41:03 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rogpB-0002K1-Oy for emacs-devel@gnu.org; Mon, 25 Mar 2024 05:41:01 -0400 Original-Received: from mout.gmx.net ([212.227.17.20]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rogp9-0006h8-MM for emacs-devel@gnu.org; Mon, 25 Mar 2024 05:41:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.at; s=s31663417; t=1711359655; x=1711964455; i=rudalics@gmx.at; bh=b+WGI9P2+p8yLx/A3qFzG+BKsIMunCdXujbRV0x3WTQ=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From: In-Reply-To; b=Jt3d2msPsFZVrRhRc1zPb6Ajpq0K9aKGsRuIqstpeu3IU1fU5SGNyOoxlRC1spmD euNoohiMtxyHX3a1RRtCB4YJSho0/rL4yIekS3PZyT1vD5XeZsRcw+tEXNi01SBGZ dJFc/NoGM+lI4o7JOZLfEr/ENMK9KGALHemeSROAISBp4BOWcrmsoJ/5EO7ddbpCy SzGOUfwpbVfk1gNF43ktko5e8gpYjOXcZ694oGKB9Uwnw9RtFa3rR8AMD2Fh9ZVEG bVkPfxIuRNQSzh29BmO5ryvAE+TeEzJghX4ytn6+aKlo3Kd1xe3lHpBSX0t5qwmdz XOJQ1p5cZJe0hbBR8w== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from [192.168.31.113] ([212.95.5.240]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MyKDU-1snHAJ33zY-00yhuB; Mon, 25 Mar 2024 10:40:55 +0100 Content-Language: en-US In-Reply-To: X-Provags-ID: V03:K1:cqd5Vh6Y03pfuNp8oHbAiOomYOa4ntTImPcPR+uhpc4MqOGZuNs iJVNEYDRtPPqiOo/6HdcZ826dAvOjocvgkOUCMenRYILxqgjixkknah/GwU6iXJf1VB9EAe DHe6N13x5avG/rTpLL6HU0iWP3Boh2FN9IAFqdm3AlW3sJL5BztNc9KEf0Ix07iLSY5JvxM L2LFHxrpyiJkx0aVFgKlA== UI-OutboundReport: notjunk:1;M01:P0:WT7LBxGU+dE=;Of9/AmKNsm4vASTodGBCSX9rf9T oyeVjzTYsCxdGUqfma7HGrmmBI8x0T7icOkF5X3vbWNDXfJWyyAFCxZNwv8l4VG6Wd3FjD84C yGL6IJdgAExjfAewI4fJDWrOWflNaSP+H1PW7TfKy3HU/k2MmfnEyAWzWwZEox1yupG8xgAB9 vzGFwoR8yy3iFF5bRvMvdmCH8PQtURPHAPEYDj0sebrHMGW4gQhgiwrhsQm5ANzSV8Ai8VtQv D6QBy51f+d1UpZqHwNctdyLTE4kM69641Gx5OnMkcR0kIV301dP9coKxe9c7nHYEznFm4gj+C xqPUNq2pcfL9O1EZHvXw5k0lukCZBcRVXEJf59YMGkIaqYuzRMxLD1r76Fd3Psdug+smRe3Xi elJ0yLcaHwb6UZx4VDdvxnvc+dy/YncP71uhlSLAwjVRy1DsLlaDy8uJ2Wk7OCmFuF+FIZYI5 2kUwWFOm4bY7pwyXqh26+H1ZryIyJitsUH2pQZsiyLw2g/xg1V68YTh0pgA4Ni0wb3d2fnNiJ M4Pg/As33Qzi9XjPyXKO7IuPG7jvSB7gmAfTTlfVy9ebxnUKTM4NW5ofrUmg9GPZOkLqlshk4 tWnfjT9C96nbyUK9wN9EaR1HMpaUX2FI1yICLlSYYRv0zXNWpsXnveHQeXewwZZssfh3MPYC3 8Y1dPjKF4Ketk9SFoSzCzkVu1eyo+5Y70QX/SOX1CBntSDxXgi2WcrL2ZGR2ILoxY/hTwtcQX OJ3do4WExlF2HXQIYUUxyJaeK6TNozCtRSLRfmaP5KsPBVSj7p3YyMsH7fkw5Poz4SVcMMw6 Received-SPF: pass client-ip=212.227.17.20; envelope-from=rudalics@gmx.at; helo=mout.gmx.net X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:317278 Archived-At: >> This means that buffer overlays with a 'window' property will not work >> correctly in any of the new ones. > > Overlay is a good point, but can be saved before reconstruction and > restored afterwards in the affected windows. My code try to restore as > many window properties as possible but the overlay is surely a missed > one. It will be taken care of in my next release. The problem is not a new one - it's been present in 'window-state-put' ever since. It could be easily mitigated with the help of the 'clone-of' window parameter which would have to be processed here in xdisp.c's load_overlay_strings Lisp_Object window = Foverlay_get (overlay, Qwindow); if (WINDOWP (window) && XWINDOW (window) != it->w) continue; but I never got around to do that. >> Moreover, if such windows were stored in Lisp variables, they would be >> considered dead although they apparently still exist like the ones in >> the lower part of your frame. > > If some code store windows in variables, Emacs native window deletion > will also make it dead, Right - but IIUC your code pretends that such a window is alive, yet with another identity. Still, the same problem exists with configurations produced by 'window-state-put' and the only remedy I see is to use the 'clone-of' parameter and maybe some special function like 'windows-equal-p' that would handle it. > besides, Emacs does not seem to provide a hook > for deleting windows 'window-state-change-functions' is called in such case but it does not provide you with a list of the windows that have been deleted. The Elisp manual says: Note that window change functions provide no information about which windows have been deleted since the last time they were run. If necessary, applications should remember any window showing a specific buffer in a local variable of that buffer and update it in a function run by the default values of any of the hooks that are run when a window buffer change was detected. We could provide a frame-based 'window-old-window-list' though if you think it's needed. > thus codes that store windows in variables should > always consider the possibility if a window is dead. I know the point > is that my window reconstruction makes it appear to be still alive. As > with most other features, it can be configured to default OFF and switch > back to native Emacs window deletion behavior when causing problems. > But so far I haven't met such a problem yet. If there is such a case I > hope the designers who store windows in variables provide hooks so that > I can add support on this. martin