From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Pranshu Sharma Newsgroups: gmane.emacs.devel Subject: Re: Add function to rotate/transpose all windows Date: Tue, 12 Nov 2024 23:50:29 +1000 Message-ID: <875xosy316.fsf@gmail.com> References: <87setpdv21.fsf@gmail.com> <87iktld1bd.fsf@gmail.com> <87r085r2gl.fsf@gmail.com> <87zfms6z1a.fsf@gmail.com> <71571413-02ba-4e3c-ad43-35c110811fab@gmx.at> <875xpfns32.fsf@gmail.com> <0a2f09a0-4115-4421-a391-30d27e7d0821@gmx.at> <87ses9k9wo.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> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8570"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Juri Linkov , Eli Zaretskii , emacs-devel@gnu.org To: martin rudalics Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Nov 12 15:29:08 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 1tArtE-00025s-85 for ged-emacs-devel@m.gmane-mx.org; Tue, 12 Nov 2024 15:29:08 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tArsT-0005do-7r; Tue, 12 Nov 2024 09:28:21 -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 1tArHi-0003G8-GR for emacs-devel@gnu.org; Tue, 12 Nov 2024 08:50:22 -0500 Original-Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tArHf-0003DT-PK; Tue, 12 Nov 2024 08:50:21 -0500 Original-Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-2113da91b53so40280165ad.3; Tue, 12 Nov 2024 05:50:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1731419418; x=1732024218; darn=gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=oVwzeD+c5Y4U9ceR93EeKewuQ1WHKXvQG+okCyAbS8Y=; b=jdOfgEYXs4WNQWlVVv9Svdr+6ISino337nn2KrazYvw64PSwx41jvmkxaEm+Y2UtPT HnCSvvzG47Wc88Nkb1DIksJgtLj5uOO3yUEyRxdi+OCPwIt1TQJAmDFRFBIXHVCJ+9/e nfZSUnzcArEvt2dURmZaqzulxP9P30QrhX3DQ1eW5LW5glVBMFxOHCVe0hw5HfApBnlb 5J6krqDjyvqOR+j+u/T9MlVdGPfHTalRgJJXOf0M1nFLP7P9T/z6Zbt/OUYqgmfXu71K H5fjV3dgSObSl8HfUQJ9soRn92gEuiTKyjREmToVucihkjDcrkBNHbAlf175pcFzar7n ZLfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731419418; x=1732024218; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=oVwzeD+c5Y4U9ceR93EeKewuQ1WHKXvQG+okCyAbS8Y=; b=D4HdYuQsPqBb2hrz+PCLgy71P01DgZ0cL2E/BLaFLXYGS/vkmok4XUf5RltSt4/7j2 5w7HGuvm81dV2XznAe/bCIsQ+bAzFYycpg8yXg6IVCKpcSOebw3zFS8RR5Y26fg54pZN 4QihWNbd2m7lr7fHbR9Dubd8X2HBAIe0ZuBr1vfMBedeldoY1ORp3bpGSx30tfjd+KQQ JtDGdtFzu71RmlxU5QaN4S5J5ZCxwY/BxYie2/LX8FZuu5JJpZ6NsgkcXOMv3iaVN6aB W5qFtAw2kELs7oTEz2zSDzYC+/tYVjNHq/4ihGI3L8H/AzqVV+NCoI1XZN0utoNfoq/l /ffg== X-Forwarded-Encrypted: i=1; AJvYcCUwn+skUcC0PvlQg5f1OVUkG8TPo6/DaW4e+yzKFN2x7JAyfkfbqP5nakF2Qs5bevh6PEVc2zrBBppi8So=@gnu.org, AJvYcCWMwwm/KEdWpn1oZZw3pAJWOt4nk6r/JkLjFJjJOOMMwOX4L/6botoly4kA0kHrlmi8xVPL@gnu.org X-Gm-Message-State: AOJu0Yxjpfnzke46aQUon9eh7ZnkQ/E02KbG+Zd0ZZky0oT9U6T/Gqf8 sKY3pB4Dpjj54z46bGmrvfncW9aZtQuZYIUQCT+Yz+fjdFr0ACTY0UqDOw== X-Google-Smtp-Source: AGHT+IFTNrs9Q09erPwIB9+nuZfcUtt7B/1RsFqUPKO5jyExa6EZB+84PWH+ioca1/zwUH/wK6CmUw== X-Received: by 2002:a17:902:db11:b0:20c:d5c5:4039 with SMTP id d9443c01a7336-21183ccf12cmr233374205ad.10.1731419417634; Tue, 12 Nov 2024 05:50:17 -0800 (PST) Original-Received: from pranshu-ThinkPad-E560 ([2001:8003:7816:8300:fd4f:9c03:a443:14cb]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21177e580dcsm94043935ad.190.2024.11.12.05.50.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Nov 2024 05:50:17 -0800 (PST) In-Reply-To: <68dc98d6-42c0-431a-aefe-eecb02991764@gmx.at> (martin rudalics's message of "Mon, 11 Nov 2024 17:55:37 +0100") Received-SPF: pass client-ip=2607:f8b0:4864:20::635; envelope-from=pranshusharma366@gmail.com; helo=mail-pl1-x635.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Tue, 12 Nov 2024 09:28:19 -0500 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:325426 Archived-At: martin rudalics writes: >>> IIRC I fixed that earlier by binding 'window-combination-limit' >>> appropriately. >> >> I still wasn't able to get it work using that, but what I think will >> work is `window-combination-resize'. > > This won't do what you want - it will simply give all windows the same > relative size, something 'balance-windows' does. But you want to > preserve the relative sizes of windows. Try with my algorithm - it > preserves proportional sizes quite well. I see, I don't quite get how your algorithim works, so I'll just use the reverse list and split at root window approach which also works. They should have same result, but this one will have less moving parts. > >> It is simply not possible then to rotate or transpose windows if they >> are fixed size, imagine a fixed size top level split function, how would >> that get rotated? > > Emcas ignores the fixed-sizeness when it has no other choice. Like when > you delete a window and the only remaining window on the frame is of > fixed size. But first of all flipping windows should always preserve > fixed sizes. And rotating windows should at least try to do that. > Flipping windows won't change the size using the current approach, but the window will be split to match it's old height, idk if that will give bug or not. I would rather it just simply doesn't work with fied windows, instead of confusing the user who probably doesnt even know emacs has fixed windows. >> I think maybe we can do a map windows at the start to check if any are >> fixed size, and if yes then we stop. >> >> So so far, my game plan is I won't do any of the window alist stuff, >> rather just the normal window-pixel-tree but include internal windows as >> well. > > The alist approach has one decisive advantage: When you later find out > that you would like to know a specific window property before you delete > windows you can simply add that property. With the pixel-tree approach > you will have to add it to the pixel tree and get one "a" more in the > ca..rs you use for accessing the tree's elements. wdym by the last sentence? Using my approach, I will anyways be able to modify the return value of window-pixel-sizes while checking for fixed size windows, but it probably won't be in alist form. This will allow me to lose the helper functions like window-alist-parent. Also, the only thing I'm checking for is if a window is atomic and fixed size, right? to check the fixed size, I'll just use window-fixed-size-p, and to check if atomic (window-parameter window 'window-atom). I think the window atomic facility should hve more interactive commands, can imagine it being quite useful.