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, 04 Oct 2024 15:50:07 +1000 Message-ID: <874j5s76y8.fsf@gmail.com> References: <87setpdv21.fsf@gmail.com> <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> <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> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7268"; 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 Fri Oct 04 09:10: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 1swcSX-0001dx-17 for ged-emacs-devel@m.gmane-mx.org; Fri, 04 Oct 2024 09:10:41 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1swcRn-00057O-KS; Fri, 04 Oct 2024 03:09:55 -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 1swbCi-00036R-Hs for emacs-devel@gnu.org; Fri, 04 Oct 2024 01:50:16 -0400 Original-Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1swbCg-00024u-OD; Fri, 04 Oct 2024 01:50:16 -0400 Original-Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-20b64584fd4so17093535ad.1; Thu, 03 Oct 2024 22:50:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728021012; x=1728625812; 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=EtgSITVCit++h5uSaVB6D5P+SIQHRhp4Zesg+BG0uJE=; b=aCAaj3OlxtKU+saHHumBGD5rTt23NstgSH5TNUxulVMY9sMDfXXAhxXLLgz3pyuSfE W7UexWC3Wm8K8OKYo/R3qqyg8BZqI1rWlnngKy+JcdGAJBzswCgpQyjTC+oXh7r9pCRZ WnHfvA8QT9FvjwelbRgDFsxJyshy3Ze2Ih4RideNpH92aUn4CNrEmuzaaFI8tWdVx7JS JRdF5gBpqIqerXEeiV5of7bIgSURfKi962hn9+GYs2/YR+UYWrhioQpmpj73m9uhOhfk HzELx+MBQfaJlMhfReX5syQq/SFslx68kMyhLo3mtko0QBIwmvMGy9s7H2ppDOpnExeF VrJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728021012; x=1728625812; 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=EtgSITVCit++h5uSaVB6D5P+SIQHRhp4Zesg+BG0uJE=; b=mHGvkcdgjGJqQdrG0NvTIW09wOJqJgjSomm65te8V8Ts0jf42fcm+KSPqQvEAC+O1a Er70iL94yFomza5IOyUEIGvjBDa+0oG3e79TG4bcY6sOtz4QuN1VMjEZLscBrbodF92B yuUFDxnXlJwOx7XQyyZKK3OY3pTRTO5o1SrsIERrBmvOG4ouBOkrW3Pz7X6MRATpUF13 NJl6HlxlUZLDDTCN7eMaZ6TN86skQ4z7Sj743xQUYBV6BjEkvvYNGQPhTjWjZ6ZUYywi Aken/LmhRUg0naiIelXyKP7cVSYcYmbZiPvBMb16mFEYl161vKvOnv80T0fiH22qECgw jGhA== X-Forwarded-Encrypted: i=1; AJvYcCVKfQMiTlICPnEDfrPIArg3fgh86qfQd4qnKfQDiV5dizzfc2JLOFaCaKesWecVLYfoRDGTuIJg1jASxA==@gnu.org X-Gm-Message-State: AOJu0Yx705WvwJlZDX1Anbbvx3q0QK/3U4AMc1MWRiwO4OsBjfnvM85c kwbq/EzSkWTqnHfpxef6vHIf59TBUeFO9Kp69vZRJ21dQBpqYOwDhJETdA== X-Google-Smtp-Source: AGHT+IFHr6sX4S3GF55r25vvxWkR3smFuoeWg/gfUhi+CyLYNZ9ZNBmip5pC3Ni0Xaa3RvbjCvjZlg== X-Received: by 2002:a17:903:983:b0:207:1913:8bae with SMTP id d9443c01a7336-20bfe061a3bmr23752765ad.14.1728021012408; Thu, 03 Oct 2024 22:50:12 -0700 (PDT) Original-Received: from pebl ([2001:8003:7816:8300:f793:d7a4:fbc1:d25]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20beefb0d9dsm17437935ad.231.2024.10.03.22.50.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 22:50:12 -0700 (PDT) In-Reply-To: (martin rudalics's message of "Thu, 3 Oct 2024 16:18:00 +0200") Received-SPF: pass client-ip=2607:f8b0:4864:20::62c; envelope-from=pranshusharma366@gmail.com; helo=mail-pl1-x62c.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: Fri, 04 Oct 2024 03:09: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:324300 Archived-At: martin rudalics writes: >> Hmm, the only way I can imagine using the flip thing is modifying window >> tree to swap 2 windows in the subtree, and then set conf to (below >> . left) and do-not-convert-size to nil. This will just rebuild the >> whole window tree. > > I thought when the two windows are neighbors (which they often enough > are) we could flip them. Flip windows would work to swap when they are sibling windows, and neigbor windows can sometimes not be siblings. > But I think the solution is to (1) add for each live window its number > in 'window-state-get' (we need a function 'window-number' for that) > and (2) in 'window-state-put', whenever we split a window, try to find > out whether a window with the respective number is in > 'window-dead-windows-table' and reuse it in that case. I can't comment much cuz I'm not really familiar with these functions, but one thing that pops out is would maintaining a dead windows table take up lot of resources? Also do you think a function like 'window-rebuild-tree' would be useful, and it accepts the a tree like the output of window-tree-pixel-sizes. rn this is possible by using the following arguments for window--transpose-1: (window--transpose-1 tree-you-want (below . left) t) However this is not really obvious. I think it could be useful to add a wrapper with more obvious name