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: Fri, 22 Nov 2024 00:04:01 +1000 Message-ID: <877c8wadke.fsf@gmail.com> References: <87setpdv21.fsf@gmail.com> <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> <02432e6c-6ee2-4c68-9ebb-246f6be88918@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="29055"; 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 Thu Nov 21 16:23:46 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 1tE921-0007R6-T0 for ged-emacs-devel@m.gmane-mx.org; Thu, 21 Nov 2024 16:23:45 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tE91E-000463-V0; Thu, 21 Nov 2024 10:22:57 -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 1tE7n1-00044k-Mk for emacs-devel@gnu.org; Thu, 21 Nov 2024 09:04:11 -0500 Original-Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tE7n0-00073y-24; Thu, 21 Nov 2024 09:04:11 -0500 Original-Received: by mail-pj1-x1033.google.com with SMTP id 98e67ed59e1d1-2eacc4c9164so844974a91.0; Thu, 21 Nov 2024 06:04:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732197846; x=1732802646; 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=kC4kqu0Wbfz1tTQeRIy4H/JzM/UCQVAkbmMFfFVyrUI=; b=ey9+dn0L6oALP6qn/7FfuGJVfgzFKPD6jZCPDGLGcFua9h6JVgvNKLevcyKAM2s/hv /0QM0G6Brf/tfn7pXggVVuS3JGaJldpNlK6I1GYo89PG7OH1CZGXnL34yeCIGH/JOoPe xvL4LZetu9PX4RMiMRS+VCk059ey3yVdXcQblrxDa6RtldCeMjJ7oRD2tj8yUhDHLysp TfTUtRkXgSaNxLUd1XHibdi6lqp4HPbkYo1y/EPbNLdYQiF0PkD+U4eTmVQmpMH6r917 Sa0flnE6FtP/vUobDmenBql41UOzL8ObO6RDftknDu8jFHKR6fTQWurSsZ0KE9vRgfiA uqlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732197846; x=1732802646; 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=kC4kqu0Wbfz1tTQeRIy4H/JzM/UCQVAkbmMFfFVyrUI=; b=OmPgVUs6kX1R4WiK0zGrQvjP7AZjLtalhmszyIwEG6qJaHjzltlB0gzE7aPqX1iQkI 0NAbRhKXXNiOlNtxsm6y10zKBtAhn1A2+Afh8Jifd5HYCdH9MFF5vWntn+THxnHuim1w iELibR685eRnMGFe3CxFHxvslmF558lFCW54mC2URsSg6URhrdrihxbo1eETBGV+hV0T M6MZi9PkIkYqUW9zAOnpzw43GlUBwVISyPsbQy8ehm9jJyhN/lRyAblYwuO6pBrIL216 d47NEZX0bkLcidRNZNisXNgUiP1MySfORnAc/2o060V8eGdnQ9ubTg0CZDDDWLNhN9Ud cuTQ== X-Forwarded-Encrypted: i=1; AJvYcCU8g4A4flAE3I+ZpqLcGDGuacbmnOd4awJqFCt+nNhFEWwsc9oHxld6gDtbDG0bjNWQR21iDmykE8Q8aoM=@gnu.org, AJvYcCXtXKsZexfIGifzvvCsoDfOKQ/FdTLUgicWGFowTCe8J7Eb8Bd3uKyVeSC9f7gt6HXCOEUr@gnu.org X-Gm-Message-State: AOJu0YyvTzfChvJQrCow+FGMRFMhHlW0OPaDNkmeofrL5+lcMGvpfY30 AKy5NDHGP8sCt/56eH6Gsrru56LF5MGlU+hqrnQB6IVEPTsuSZC3ijFLeMVx X-Gm-Gg: ASbGncvOxc1We4znTfqT28LeVX+qHps1dLL2A/NEE8CfP4y+/VKOU2zaVzY0VLemtFb xjLMGYUBxRBWKzpxEenk5UWjFi1xj0MDHGOBopH4fGIfx4ZgLLI8ukHn0NOCV0mAxdzkhulcSq4 kBDQQqcw8RbI8z3guEoTd2wYOada0AA4G89MvDVu7cw5FqkdDNCTGnLjviHU/wAfXjbtXji6wZO lVmmvaQv5v0ei9MmxcbFrhshr93Z6r9lkBLTlotjFgVBF9tdyI= X-Google-Smtp-Source: AGHT+IGvQvw2sTkjOMUmJ4sjuaX8ksbHtfIEFe4niQ/kpfOi1ohdofuwRCcaQQ8ZVsiplurCFIx7wQ== X-Received: by 2002:a17:90b:35cb:b0:2ea:670c:c6a2 with SMTP id 98e67ed59e1d1-2eaca709c8amr9105550a91.16.1732197846213; Thu, 21 Nov 2024 06:04:06 -0800 (PST) Original-Received: from pebl ([2001:8003:7816:8300:c6a:f54c:7671:5da]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-212878aa6bcsm13978735ad.92.2024.11.21.06.04.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Nov 2024 06:04:05 -0800 (PST) In-Reply-To: <02432e6c-6ee2-4c68-9ebb-246f6be88918@gmx.at> (martin rudalics's message of "Tue, 19 Nov 2024 18:48:45 +0100") Received-SPF: pass client-ip=2607:f8b0:4864:20::1033; envelope-from=pranshusharma366@gmail.com; helo=mail-pj1-x1033.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: Thu, 21 Nov 2024 10:22:55 -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:325550 Archived-At: martin rudalics writes: >> 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 fully understnad why this is happening. iiuc, the purpose of checking for previous split is to see if the (cons window parent) refer split has already happened, to avoid doing it again. Instead of doing this, I just use a vriable called `n-set' which determines if the parent window has already been split with the cons refer argument, so I don't belive this is neccasary. >> 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'. Nice, can you send the whole diff.