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: Add function to rotate/transpose all windows Date: Tue, 19 Nov 2024 18:48:45 +0100 Message-ID: <02432e6c-6ee2-4c68-9ebb-246f6be88918@gmx.at> References: <87setpdv21.fsf@gmail.com> <877c9ersei.fsf@gmail.com> <51068b75-e12d-4161-9a63-8c280e8b2668@gmx.at> <8734k1gnt9.fsf@gmail.com> <8a2007d9-d501-404b-966d-57a7a51310ef@gmx.at> <87ses0r81d.fsf@gmail.com> <69658762-5fc7-4a9d-9262-528dfd9e93cd@gmx.at> <87wmhb2yew.fsf@gmail.com> <801bbd24-8f79-48a4-9615-f5ef21b2341e@gmx.at> <87ikstsu7f.fsf@gmail.com> <68dc98d6-42c0-431a-aefe-eecb02991764@gmx.at> <875xosy316.fsf@gmail.com> <87bjyfcncu.fsf@gmail.com> <87cyiuefxs.fsf@gmail.com> <878qthewbq.fsf@gmail.com> <8599bc67-b05d-4afc-8e6e-1ba64a30054e@gmx.at> <87frnp2x85.fsf@gmail.com> <823c7cca-63d4-4568-94bc-11f5949d6c5c@gmx.at> <87h683muss.fsf@gmail.com> 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="19007"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: Juri Linkov , Eli Zaretskii , emacs-devel@gnu.org To: Pranshu Sharma Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Nov 19 18:49:14 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 1tDSLi-0004qL-Pt for ged-emacs-devel@m.gmane-mx.org; Tue, 19 Nov 2024 18:49:14 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tDSLP-00080K-Bz; Tue, 19 Nov 2024 12:48:55 -0500 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 1tDSLN-00080B-Dq for emacs-devel@gnu.org; Tue, 19 Nov 2024 12:48:53 -0500 Original-Received: from mout.gmx.net ([212.227.15.15]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tDSLK-0001Se-VH; Tue, 19 Nov 2024 12:48:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.at; s=s31663417; t=1732038526; x=1732643326; i=rudalics@gmx.at; bh=44p6mtyu/+dVcxQtdZf1LJb5l/9r26LitlLEYJvEbKk=; h=X-UI-Sender-Class:Message-ID:Date:MIME-Version:Subject:To:Cc: References:From:In-Reply-To:Content-Type: Content-Transfer-Encoding:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=FcZk3ERMcf8fh+1dLHFrt2eNtfPmntWBiNia1slOrjYTS4GctDZ9nN/dt2hsnX/h n+1GtZtQiKlf+pJCJOPUB6K5c87Yq9ehm+PWhvtCC3WB4nH5+RNJHFkK+BJlnEtQg dVg8Qsw9mzsTCrn0M7pO0jTmev1139yo7FTI1tmFFWW7jLoDbMQHG5jy7mMrrE7xi vtfwRvJ9L3Q44f3JpilqOpRL5cT3dtfLNUDZMzFCB8OU3Jq0h07U4H0/sNCIoKEc0 jd0QMp3BCgMsrLKZfQbcCLpUA9NFsQZbAdX+3vgATz+V6yGSPB1FjYR06jkt33pnC p+xciTZBnAOweQVWyA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from [192.168.31.113] ([213.142.96.141]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1M9Wuk-1t7y9q21XY-00DEQH; Tue, 19 Nov 2024 18:48:46 +0100 Content-Language: en-US In-Reply-To: <87h683muss.fsf@gmail.com> X-Provags-ID: V03:K1:5VQ/KDEzuz/iz+iy7YhaFbYIZ1nBQkyXn98t8xQfSZT2bSOzvFA Dz/dKjKQGcLFwNy+IbH8Osl/owglzC9QUZYs5jyCZi1ozj7Wu5UB6uVemddfyoydaNM+CXU PPQaU/Mton/ZmlG7g/3vD3V+NNxJeePucY9KYUOjy/YgSnagsdTA9wBd+l7NTLA5StGpNeR kSHLJC5Y88FgF7ORpCVmg== UI-OutboundReport: notjunk:1;M01:P0:Zha7dsvSfAo=;CCyK597n2vDPrvPOJDXLmcj1kjQ 3HGZsLPauvZNxo4SzdxEhevvuJZr5s1PoPmO7uo5O4enRZ1cN/HPEjQjPh0MlOvaaX3h0mdLY DdTYwLeFX+Z0P0jx1yvSWO1p8trkFpCh40bi8fJbHshA022B3bXJZMycktJ19/QI0RG5ox/LA JfgSBePoWvFLc6usU4EuxSMwe6zYBRolEjyFLQW/EXRF0av7wM9TUcGWXVwGGLQORxaGII/ZP 5yTaY4jH0cuFqcLWxcWNcdRHSEcWZB22YFyK/ZYWwtWNBAZQY6RjsfZogzBakYr22XQRyDTU4 P1in6GyTzfbHJkf70Yx5IVG4w05eZVvZM+8dKWZtG20dZe9HmcqI6Ikr2VA3wK21TWWprArwX GqvclrO7mMtqpaXv+/lGtShKBQNY2H0PC0qhyODFZqhNXIXSqIyC0qvYQTOrjWXhcU9nTX0p2 XWozbn0fVAhRUu2R1kbOUuwFsuKMQkN2wNfJVNeYGBqXFP3Uhwp5KI6O5+qzFp6T9shovXhcd bnqHNhGDcpAmDBS5pYAB+WPW4BgEmBwhAxv7sjCQz+nXPAmVSiJlwoVaaOn/xbOwik0ZoZvbk 5x5of3yxN/0hF2n+ygZjbJGCQixlHwru4Nyd7XwCXJQAYaAPWCX31N5HHJajzme8HpPLYvwqs 7YQs2MxPE5gdhuL6xYXXfCUJc9Bfu80+58aqtB8WFL85c2cDmOMPmWGsImuI8XO/ZIWfJm10M djyry/B8CTP4ckQhLIx0G3eAX7uxOgJ/9olzkrGuC/DLRB8qGzt3fNZ/58Q2f+YVNvYYF4f6 Received-SPF: pass client-ip=212.227.15.15; envelope-from=rudalics@gmx.at; helo=mout.gmx.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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:325510 Archived-At: > Thanks, the whole explenation really helped me, I now fixed the thing so > that it preserves parents windows as well. I tested it with the: > C-x {3 2 o o 2} grid split and the parent window's were same before and > after transposing. Good. It already works with my standard scenario. It does not yet work with C-x 2 C-x o C-x 3 C-x 3 which gets me from ((# . #) (# . #) (# . #) (# . #)) before ((# . #) (# . #) (# . #) (# . #)) after 'rotate-windows-clockwise'. Initially, the parent window 16 hat three children 15, 18, 17 afterwards 15 and 18 got a new parent 19. I suppose you have to do the same I did: When calling 'split-window' do _not_ set the combination limit when the window to split has a previous sibling with the same parent as the window to split. window-rotate.el uses (or limit (not prev) (not (eq (window-alist-parent prev) (window-alist-parent window))))) where 'prev' is the previous sibling of the window to split. > I don't see any technical reason on not > being able to get the window-combination-limit of a dead window. It > would be helpful if this and alike functions would be able to work on > dead windows. I have done that here for a couple of functions but for historical reasons it will never work for 'window-buffer', 'window-top-child' and 'window-left-child'. My code for 'window-combination-limit' is: DEFUN ("window-combination-limit", Fwindow_combination_limit, Swindow_combination_limit, 1, 1, 0, doc: /* Return combination limit of window WINDOW. WINDOW can be any internal window - a window that does not show a buffer and has not shown a buffer before. If the return value is nil, child windows of WINDOW can be recombined with WINDOW's siblings. A return value of t means that child windows of WINDOW are never (re-)combined with WINDOW's siblings. */) (Lisp_Object window) { struct window *w = decode_any_window (window); if (WINDOW_LEAF_P (w) || !NILP (w->old_buffer)) error ("Combination limit is meaningful for internal windows only"); return w->combination_limit; } martin