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: Mon, 21 Oct 2024 10:14:41 +0200 Message-ID: References: <87setpdv21.fsf@gmail.com> <87v7yeykr0.fsf@gmail.com> <19ca7821-e034-4ae5-9ff6-570243329d74@gmx.at> <87r09224pe.fsf@gmail.com> <87ikudk62k.fsf@gmail.com> <0d879e95-c37e-416d-b439-daa6384c4f30@gmx.at> <878qv8kws2.fsf@gmail.com> <87ed4xvf60.fsf@gmail.com> <861q0qfnhr.fsf@mail.linkov.net> <878quxdant.fsf@gmail.com> <86zfndi6wh.fsf@mail.linkov.net> <87zfncuqhu.fsf@gmail.com> <86v7y00w68.fsf@mail.linkov.net> <87y12smubh.fsf@gmail.com> <96ea5140-9043-4c1b-97f3-4c534296355e@gmx.at> <87frotqx90.fsf@gmail.com> <87y12iyidd.fsf@gmail.com> <87ttd6rofo.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="3543"; 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 Mon Oct 21 10:15:55 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 1t2nZz-0000jl-KK for ged-emacs-devel@m.gmane-mx.org; Mon, 21 Oct 2024 10:15:55 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t2nYx-0007cU-M7; Mon, 21 Oct 2024 04:14:51 -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 1t2nYw-0007cF-1a for emacs-devel@gnu.org; Mon, 21 Oct 2024 04:14:50 -0400 Original-Received: from mout.gmx.net ([212.227.15.18]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t2nYu-0002xI-9v; Mon, 21 Oct 2024 04:14:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.at; s=s31663417; t=1729498482; x=1730103282; i=rudalics@gmx.at; bh=kjwnvVDTasjN9c8vT8tCQn8y4cpzeCzAAXfJTI3QTyM=; 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=iKcNQbmcGV6re8uEd4brL/ZQE6/IUpsPblMSZI/XXLPHZjB1rv4j5S/ZbAHhxie1 cmXcgwOJre/fzUai2fOtV9c3rmY9RMP6sbl2bZDKN6BMUb36HAs1O1i9F4sU6JVrp w/HD7LSw9QX1Owi1LsUDnYr9cUfJMeZVC1n7yw8O6ttdhB0Wta5t1xDFnvU2FJk+N uJvrjAe9zopFfBNBj5fwiq4Xp3tiToCGZeXQuVLUyg1UAOkS83uN159IVfGnhr09M IVwL4u1BjMkgVzfXtAvIgH7a8ryOM9n0SKoTwYnrXF2lB5RL3dyHqZ+w613YQGIZo 97ifoOFMf+Th+W05uA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from [192.168.31.113] ([213.142.97.123]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MXXuH-1tPjJt1h7f-00UCL9; Mon, 21 Oct 2024 10:14:42 +0200 Content-Language: en-US In-Reply-To: <87ttd6rofo.fsf@gmail.com> X-Provags-ID: V03:K1:8c2LUjpcoamNvkpLronQahvAgFzvjKMdU0+3GWBb/kWrsJ/5lCE goHtRMeYkLeHOkQYO9L+gooUE8m8lpqRri1ZRBFkerzTT0EiNVjBiOo0S0siCR7VxTRftXn XvmFr3nFb+9RK117kKspbcUf/sc9VOTuVAPRj+OObAedB8fkPMN2KYcDbEd+XG7uaNE0UIe SMENqZQMb3OiTYytrbHRw== UI-OutboundReport: notjunk:1;M01:P0:5VDDzOfIbJA=;x7Z1q4ODro0IOpVUoG+ZZlIA2s4 8hlJ8gp4/fQpJiFvmsQegLX1hm5gEXi4aUzbnJQ2xyj9zDyMzbnTuJKOCYYoWeCFvG+uLgtcc q/H7pAj5pTC3qv3K65mBKiHEa7TiQVSaj1TtDliG9sE3+WK6qUmXajP+29/ZiWPE1X5LRBNpr MrsXd6qERHcTeXeyXxEHjQx91LiefR4JzQ57ODWldysheizIK8KkXRO9j0RMMFj9pXf0fxlH+ jlBkR2zm1012ix+A+QBXGa38atzDgCS7hO7izcRFePX1AHFqsnjH4VHf+VUzhikb0UrFag03A zD8EqetNQmgHWKh0v11yZbOnmowQCGdrmF7dqz3YCu9ciPlvYPo8JDYNr6AmD9Orcof1elIJs ZZOjkFd/G0s7Mgyw13i9g6aYLS2mz/a3AfYkMuQu9haccpIdtEQVOAUotG/ivLhvjae+fMLk/ 1jgd4YAWCs68wMx2YbpnJUE3aE6bOVTQXmPn7zXTJNsG7iC4tzJmF3gT4cuTR4tUqBYp/TGRX 89EBb4CaxaGQMWpkf0E3LWkzR+dJWDQEE6ejdGo/KJ9h0lQD/qnJRXTFWpFjNO2fye7QOSHbf /n84R2ed0IWYqoKX3ifj++Ye3ZdDd57RDow6AHaexJTaENiAeXzSkVox2mO8/SgFy/VAo8ZxL M5s0HEb6qeHd9VnXoYU9+SvmdghaAOBKdn0zaLD6wQtX5MhLuI/AzNSpatvMHY8H4H/ckLXKz v9r+wuHGZr6BkeRbGLKZgkyRZM3YVPh1aYCxKPtpG303zQzGM7omJ5ChVid2KIvtJJiX/1tt Received-SPF: pass client-ip=212.227.15.18; 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_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_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:324701 Archived-At: > I thought that for each layout, there is only one possible window tree > that will match it. I think so too. But there are infinite many ways to obtain that layout. >> Your strategy of deleting windows piecemeal destroys the original window >> structure in a quite chaotic way. > > The problem is that it will fail when only acting upon a partial subtree. I see. I think I have to give 'delete-other-windows' an additional argument say MAIN so it checks whether WINDOW is in MAIN's subtree and puts WINDOW in the place of MAIN in that subtree. You would call it with MAIN set to the root of the subtree and WINDOW to fwin. Note again: When you delete windows one by one you may change the parents of the windows that remain but you want to delete afterwards. But 'split-window' should work with the parent windows that existed _before_ you started deleting. So maybe you should first try to experiment with 'delete-other-windows' as it is now and then we can try to fix 'delete-other-windows' the way I sketched above. > I see what you mean here, I knew I should done something like this from > the start when I had to flatten the window subtree. > > Seems like this will require a rewrite of the windows--transpose-1 > (Yay!), but it should be doable, I have an idea of what I could do. I cannot exclude that one can also get good results by using your current approach. As I said above, there are many ways to obtain a specific layout. > btw, is there a major perfomance/memory footprint of the patches you are > adding In which sense? Reusing windows should reduce GC overhead since you create less new windows and produce less obsolete ones. Everything else is negligible. martin