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: Sat, 28 Sep 2024 20:53:47 +1000 Message-ID: <87plooaw1w.fsf@gmail.com> References: <87setpdv21.fsf@gmail.com> <86zfnxcg57.fsf@gnu.org> <877cb09ln4.fsf@gmail.com> <9005cccc-7545-4257-b2c0-885a13d3bde2@gmx.at> <86o74aa41b.fsf@gnu.org> <3d4546ac-70d9-4865-b42d-0dc50cb0f3a7@gmx.at> <878qvcgqpu.fsf@gmail.com> <0138d382-8e63-4b53-8c2c-fece826a7d0a@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="16093"; 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 Sat Sep 28 13:20:24 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 1suVUt-0003zd-Be for ged-emacs-devel@m.gmane-mx.org; Sat, 28 Sep 2024 13:20:23 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1suVU4-00033b-Jr; Sat, 28 Sep 2024 07:19:32 -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 1suV5H-0008ID-QB for emacs-devel@gnu.org; Sat, 28 Sep 2024 06:53:55 -0400 Original-Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1suV5G-0001vs-7x; Sat, 28 Sep 2024 06:53:55 -0400 Original-Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-20aff65aa37so25307925ad.1; Sat, 28 Sep 2024 03:53:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727520832; x=1728125632; 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=I8jEgYPZMz7Ad82Yv5oYBqbc2pdIuF/HI1u8pW7BpbI=; b=jJeyxw62o4hYhEImAs/g621kO+55QsFlADd2/FOeTKnDjSvdT60Q3THHoOh6m4LJEZ fhVc+01fBlhVwZ9dh1D77FDmeQgXiaB70VtzrClXPPLtpjh2CjOLE3fFUCmGZXeBODgR V8S0/pu4GQo0Ero23CrS3+Dahb98Rx9sbWqwzUxGAmVjW+M0h9bEBBUKeyCYR5hZdoHB lP7jT1UBtAE2pnT2Dec/2MqLfZP7y7acGZb6uPPnMEGsVzjFAO+gHowAM7mrDmk4FKHI TxR+Gz1WeuoksrmQPDCnNc+3bt0vM98xYKnARC1T4C7mPbd9dWXtplVgbjiw0zKcB6uS R/VA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727520832; x=1728125632; 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=I8jEgYPZMz7Ad82Yv5oYBqbc2pdIuF/HI1u8pW7BpbI=; b=KkKdHYYUmtbfyTfUokl/Nl2gX7qVZB04aAIrWmpM/OCNfhqGxOFCDDnIjE0Kg4dG2E 1wt9v32oUztWDwL8jlT2M1pmpvTiV7PabQs9tzh4A5MZ4KZ5RDRU91xTxM+dpTf8tMAe H5+UqrLc1cpxhfjiVoW0Z0s07ik4N9lLgTTIWIVE1O4Hos1scm83QxHe0fCK1bR/YBv5 PO5Nw489g5hsPLyB1Yapjna61U6yRnXsoRSZO7LniNVUmq6ajb26BJp8qb20YICv73C1 2q2ALJPKXVHY0KdiBLL7ZfClKnoJtrBQbyl7qTBVlr45rbo99oKCSqbZYWjQFZ2uhx8M 6NDQ== X-Forwarded-Encrypted: i=1; AJvYcCVRYHIgK8aISoih2YjlpGZvwebuKVNo4Cx3ZB2QB9iPzPLoADBlRINWaaCz/QSOS2LDRZ1S+NnCJqlRww==@gnu.org X-Gm-Message-State: AOJu0Yy7mDr6xe10/4Cw2gnsOuIECkg0MqiOrnyu9EjsxTePZ9by2Rd0 rdFpZp/Kie6jnf+1YN/QNyZf4QUjTkdQGzezrEU6PrHk3rSRjk28rRfspg== X-Google-Smtp-Source: AGHT+IGFnjRE1aif+JAVMLZFhK3TsgWJV6AlV9C2oYc4jtWVoIHVyWlcDXukkUJoeXulr2uvklZ30Q== X-Received: by 2002:a17:902:c943:b0:208:c527:556f with SMTP id d9443c01a7336-20b37b75607mr91744125ad.50.1727520831774; Sat, 28 Sep 2024 03:53:51 -0700 (PDT) Original-Received: from pebl ([2001:8003:7816:8300:be62:5525:b7f7:4de4]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e0f1ef5be8sm976857a91.20.2024.09.28.03.53.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Sep 2024 03:53:51 -0700 (PDT) In-Reply-To: <0138d382-8e63-4b53-8c2c-fece826a7d0a@gmx.at> (martin rudalics's message of "Sat, 28 Sep 2024 11:26:50 +0200") Received-SPF: pass client-ip=2607:f8b0:4864:20::636; envelope-from=pranshusharma366@gmail.com; helo=mail-pl1-x636.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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sat, 28 Sep 2024 07:19:30 -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:324164 Archived-At: martin rudalics writes: > I don't know 'swap-window-states' but if it uses 'window-state-get' and > 'window-state-put' (which I happen to know quite intimately) the result > won't be any better than with the concept you cited earlier. > I meant window-swap-states, and it does use window-state-get and put. >> However one thing I'm stuck with it getting it to work with root C-x 2 >> C-x 3 kinda splits (basiclly where (listp (caddar (window-tree))) is >> true). However if you start with no windows, split window once, go to >> split window, they you can go crazy with splitting in any direction >> (even the C-x 2 C-x 3) and it will work when you call transpose-frame. > > I don't understand what you mean here. Say you save window layout: - +----+--+ - | A |C | - |____|__| - | B | - +-------+ (car (window-tree)) returns: (t (0 0 137 30) ;; Following sexp is returned by (caddar (window-tree)) (nil (0 0 137 15) # #) #) In a scinario like this, where (caddar (window-tree)) is a list, the function does not work as it will not have any anchor point. However transpose-frame will work on the following layout, as it can anchor of A - +------+----+--+ - | | B |C | - | A |____|__| - | | C | - +------+-------+ >> This also different from the transpose-windows.el in that it does not >> start on a blank slate(transpose-windows.el calls delete-other-windows >> in the transpose-frame-set-arrangement), so transposing partial window >> trees much easier but I haven't implimented it yet. > > Whatever you do someone has to delete all "other" windows and start with > one specific live window that you subsequently split. wdym? > Try with the 'split-window' I posted earlier so you don't have to care > about buffers, decorations and the rest and can concentrate on geometry. just compiled emacs an tested it works, I'll do that