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.devel Subject: Re: Add function to rotate/transpose all windows Date: Thu, 26 Sep 2024 17:22:08 +0300 Message-ID: <86o74aa41b.fsf@gnu.org> References: <87setpdv21.fsf@gmail.com> <86zfnxcg57.fsf@gnu.org> <877cb09ln4.fsf@gmail.com> <9005cccc-7545-4257-b2c0-885a13d3bde2@gmx.at> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15922"; mail-complaints-to="usenet@ciao.gmane.io" Cc: pranshusharma366@gmail.com, emacs-devel@gnu.org To: martin rudalics Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Sep 26 16:22:44 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 1stpOF-0003zg-P8 for ged-emacs-devel@m.gmane-mx.org; Thu, 26 Sep 2024 16:22:43 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1stpNn-00004w-DD; Thu, 26 Sep 2024 10:22:15 -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 1stpNl-0008Vk-Qm for emacs-devel@gnu.org; Thu, 26 Sep 2024 10:22:13 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1stpNl-0005pT-6I; Thu, 26 Sep 2024 10:22:13 -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=k4nkALJLP4zdn9KdsLwnirBx/JRafmEiQ7RXMZ8wHUw=; b=ABONc/Z0NenA gUxZOE7N0hmCwlb5ERKgw9zvs2ovfqgSiLQcEIejYzLaxXJ/2/fThveTDkSb94fHX47hLdSyp7kDJ 54nqGN/kCFwDh65155c2wnfldZu/PIKMK2yLEhTU21JgeNx4tuEoXfxBS1SZ6UNZ6BOxHRxBnkY+f /d+P4KYWhM/OVs7+SVgaqmv3eGQIKuwLpluDxe/qH/pNRzDtIpS9LS1xfNeHBbhLXZRZbNowBS154 V55AV+xN/1P7mhtYH0LPeB7wH9wX+Z+4ZowaNvU9yfAR9VgVoI1TO/6AJGFh59bmY3Gvib4Ih83tj ev1nuFt4nOZos0wj6c6mlg==; In-Reply-To: <9005cccc-7545-4257-b2c0-885a13d3bde2@gmx.at> (message from martin rudalics on Thu, 26 Sep 2024 16:10:48 +0200) 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:324109 Archived-At: > Date: Thu, 26 Sep 2024 16:10:48 +0200 > Cc: Eli Zaretskii , emacs-devel@gnu.org > From: martin rudalics > > I attach a function 'resurrect-window' that rotate/transpose/flip > functions can call to resurrect the previous windows after having > deleted them. Tested with: > > (let ((dead (split-window nil nil t))) > (set-window-buffer dead "*Messages*") > (message "%s" (next-window)) > (sit-for 2) > (delete-window dead) > (let ((live (split-window))) > (resurrect-window dead live) > (message "%s" (next-window)))) Thanks. > +DEFUN ("resurrect-window", Fresurrect_window, Sresurrect_window, 2, 2, 0, > + doc: /* Resurrect dead window DEAD in lieu of live window LIVE. > +DEAD must denote a dead window that was a live window before it was > +deleted. LIVE must denote a live window. Put the window object of DEAD > +in the place of LIVE such that the resulting window inherits LIVE's > +geometric properties and its position within the window tree while all > +other properties including the buffer and its positions, decorations and > +parameters are inherited from DEAD. > + > +DEAD must have been on the same frame as LIVE and its old buffer must be > +still live. If LIVE was selected or its frame's selected window, select > +DEAD or make it its frame's selected window instead. */) This doc string needs to be more detailed in what it means to "put the window object of DEAD in the place of LIVE". For example, it currently keeps silent about what happens to LIVE after the call. > + /* Add WINDOW to table of dead windows so when killing a buffer WINDOW > + mentions, all references to that buffer can be removed and the > + buffer be collected. */ There's no WINDOW argument. I think you meant LIVE instead. Finally, this needs to be documented in the ELisp manual and called out in NEWS.