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: Sun, 06 Oct 2024 12:54:13 +1000 Message-ID: <87ldz2aqlm.fsf@gmail.com> References: <87setpdv21.fsf@gmail.com> <878qvcgqpu.fsf@gmail.com> <0138d382-8e63-4b53-8c2c-fece826a7d0a@gmx.at> <87plooaw1w.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> <32650808-7cf9-4288-91b5-c7d78663de8f@gmx.at> <8734ldlcpk.fsf@gmail.com> <874j5s76y8.fsf@gmail.com> <87zfnjlx9v.fsf@gmail.com> <0d462f2c-2e33-4eed-8785-daae61f89ee3@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="14243"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , emacs-devel@gnu.org To: martin rudalics Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Oct 06 06:29:41 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 1sxItp-0003ac-DI for ged-emacs-devel@m.gmane-mx.org; Sun, 06 Oct 2024 06:29:41 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sxIt8-0000OT-9I; Sun, 06 Oct 2024 00:28:58 -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 1sxHPb-0001mn-3d for emacs-devel@gnu.org; Sat, 05 Oct 2024 22:54:23 -0400 Original-Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sxHPZ-00070Z-EY; Sat, 05 Oct 2024 22:54:22 -0400 Original-Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-20b8be13cb1so35994215ad.1; Sat, 05 Oct 2024 19:54:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728183259; x=1728788059; 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=4opxRPZr/9+FMpqQD2yuNLXsWjmU+8A1l1mUq2Fuz08=; b=jvJxssyGmAtdG2OEr3+jVoeSAP0X/PDbnn0Ov1xPr4lPSng1I62IhQze/CbRgupzV8 WbJXHknUsehG/xC1GrP7yAGZRIEM0RKiL3TtmzHVzpiKqpbS08uOle0ycKeOHaVHjKn1 cOGeKRx/kbXNY9bZPvQg591xR3G/cj5Y7ElgR31Rx/rbzCRz5LMB71WA66BnjAnTtcjt 7/bZHbgvpgwV8ZwV6tawWyRL2+2z/6kHmalfPAqvDkRTlZdzKkILAXZ50O3tRxeAIher Kglh4oE1OW4tjs/DXNu9P4bO/ACsAGIbhfwo7nQSEKqn7umgYrQquaj7VQu9nFil4a11 nAhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728183259; x=1728788059; 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=4opxRPZr/9+FMpqQD2yuNLXsWjmU+8A1l1mUq2Fuz08=; b=Rx+Pl26djAyFNM8tEq+u5+tGbITxRKq49F+6ONXZsNhrdz/Uct7gpBRQVnjGTOkMjK ncIQSRlNTymzX+fBvmYisPImHm5xgbbygb/07zvR4Ne7SxAfrSDI+ygJn/k5ZouaJxZD RRONE05sBHayxpBoZ7wXISYt0n+RAJ/DXkyARffnitGu5ihDL0H1nwqrqUnM0pjgxgRc vbg4n3slFPfDJFkRaciGyJjrUDsVNrt0rxSA0mmwJUC+3QO/UcBvCTZIqrwaL1QbpmBi kUQi0qebmiQiAjP3iffNxEY4qREZkd5dGihfOWxYUbaCTYPUW2fDeXCUUNTC8TmCfg/B lAew== X-Forwarded-Encrypted: i=1; AJvYcCXo0uQfAIfUDRJBB/+WycxG2UPE/Kcb3T9aRKutvoiE4+A+ASW2nTzWhmFLaGOeMYvJPNrJW0BfpMvvIw==@gnu.org X-Gm-Message-State: AOJu0YzeK3GdnUwQvk5hIh08GJ18v8c/vRQ0C/+wIJoT3PjqCDPn/IkU 1oYtzWERedQUNyQvpo/FofGW9x9TwLXdjQZIG1L4ssbRYiMWFesZFM+wxuA/ X-Google-Smtp-Source: AGHT+IGrAHFDKF/tyR691j3KuhQYFwEeJsXJ10GqV+Uq9zAb4W10K3kYuPj8V16ZrMV6I2NILdP8Dg== X-Received: by 2002:a17:902:da8b:b0:205:6a9b:7e3e with SMTP id d9443c01a7336-20bff19b31bmr100932155ad.56.1728183259014; Sat, 05 Oct 2024 19:54:19 -0700 (PDT) Original-Received: from pebl ([2001:8003:7816:8300:9709:4c06:f9a0:8175]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e20aebbbafsm2622609a91.20.2024.10.05.19.54.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Oct 2024 19:54:18 -0700 (PDT) In-Reply-To: <0d462f2c-2e33-4eed-8785-daae61f89ee3@gmx.at> (martin rudalics's message of "Sat, 5 Oct 2024 16:43:39 +0200") Received-SPF: pass client-ip=2607:f8b0:4864:20::629; envelope-from=pranshusharma366@gmail.com; helo=mail-pl1-x629.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: Sun, 06 Oct 2024 00:28:54 -0400 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:324342 Archived-At: martin rudalics writes: >> Say window window-tree-pixel-sizes retruns: >> >> ((t (918 . 562) (# (442 . 562)) (#> *scratch*> (476 . 562)))) >> >> Then if you C-x 1, and then: >> (window-rebuild-tree >> '((t (918 . 562) (# (442 . 562)) (#> *scratch*> (476 . 562))))) >> >> It should rebuild the whole thing to the orignal > > Yes. That would be useful to (1) make a window state and store it > somewhere (2) arbitrarily alter the frame's configuration and (3) put > the state back into its frame. It's obviously the same thing > 'save-window-excursion' does but there's a twist: When a frame gets > deleted, you cannot restore the window configuration in it. > 'window-build-tree' could do it and 'undelete-frame' could use it. It > has one drawback: We can't collect the dead windows as long as the saved > state needs them. BTW I have no idea why 'undelete-frame-mode' does not > try to resurrect a deleted frame as we do with windows. I was thinking more about making it easier to programticly change the layout, as window-configurations are in C source, which is far from userland. This would make it possible to do stuff like recursivly go through window tree and do whatver you want, eg make vertical split windows a bit larger. >>> One thing 'window-tree-pixel-sizes' should then possibly do is to >>> include the identity of internal windows so 'window-rebuild-tree' >>> could resurrect them as well. >> >> idk what you mean by this, is the identity not included in window object >> itself, as in does refer argument not work with it? > > No. Look at your your example above: All we know about the parent > window is what type of combination it is and what sizes it has. Do you mean the windows lile #, that are not included in (window-tree) and return nil in window-live-p? If so, what do we need to know about them apart from sizes, transpose-windows and that know nothing about them and still work. >> also I found that when using tabs from tab-bar-mode, calling functions >> like flip windows 2 times in a row will fuck up the tabs. > > In what sense does it "fuck up the tabs"? > It just makes them dissapear in gui, and in terminal it makes them blank. Try this: C-x t n C-x 2 C-x 3 M-x flip-windows C-x z