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: Wed, 25 Sep 2024 18:34:55 +1000 Message-ID: <877cb09ln4.fsf@gmail.com> References: <87setpdv21.fsf@gmail.com> <86zfnxcg57.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7446"; 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 Wed Sep 25 13:06:44 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 1stPr1-0001kZ-LM for ged-emacs-devel@m.gmane-mx.org; Wed, 25 Sep 2024 13:06:43 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1stPq3-0003fH-JE; Wed, 25 Sep 2024 07:05:44 -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 1stNUI-0001Dw-6K for emacs-devel@gnu.org; Wed, 25 Sep 2024 04:35:06 -0400 Original-Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1stNUF-0008U4-Mo; Wed, 25 Sep 2024 04:35:05 -0400 Original-Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-2054e22ce3fso65693725ad.2; Wed, 25 Sep 2024 01:35:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727253300; x=1727858100; 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=i0+1GsDG5fHILM5BEQheTK7IbBDnXksWvlWjkPLgV60=; b=nThDOSwG1lniv1aYAZsmvic8MCWiFw+ng+trHQGaXjSIvmTffWzyeHXRjFZlzsK9HU 3+76rtL9iAHc3+QFxTrlv68lhBhvvkUD6W6fNtx889e9IN5eFWF8xYjwYcH64oXVWzNk Hbj09VLg3BNLrVq24eVnxO8KPTADXNVk9uqCT9K6WWm/fFIgsg+KXZweIYULl2SRL/m7 J9sWtFErLf4erOvRSZzoG2BTZuNbRjMsREQB93clFUGFjrZ/Y92YwmqFMMpl8Qt3IDvj eCkIBMQYTLjBQPIGtzt0a0HfgfbFp/ngaoi5TM+WCzWa9RybaRZ/kko4qjMPehvMvRQL zPLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727253300; x=1727858100; 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=i0+1GsDG5fHILM5BEQheTK7IbBDnXksWvlWjkPLgV60=; b=HfLGBbdiYMNwHTVkzkyKQlt2pCn8mauRxaNdVdIqTDp66t0M9llZAsrxpszhssJNbQ hfaQjF/AisFGJpg8+6azFJrmnhX+kZ4ng3iTonZkskiFR2d8ZPc3RN7YMhrKwUaXCltQ mNHLV9DeKs0JbVtJIGFJkU9sXVFC8UV4XQwa1LB36oV76dShY7MrGh8RvAADhfBa+9sL Ooz+zqhFJUzBw8/JKCozZjpOEbq2/Mvr6dBS2YvkKAA24PAtDDx3d3U6c8xKBjU+wlnj zZVLKXrwMrj74JXO2IGeQgWEbOPq0ccyhSD2MImS274xB15jnOERDJHGbAB2rg2u4XU4 Zm7A== X-Forwarded-Encrypted: i=1; AJvYcCUCwKwZn+xuXLTsxiOkxaR/MUlMqIvl+DtUwWIikOITdcn+a3CHBhzXIwvyMWfpASyqvYVWx0/UicvgSw==@gnu.org X-Gm-Message-State: AOJu0YxOh3y+0uNWwfF1s/JEjMncLepE6epMPiQu2IsgBa4akHgk9+8I PRuPAmGgS0A+oOPc2yhA0SShEfy1LV1QO9QFnnDS0VM9uds6hk7z3Uq0wg== X-Google-Smtp-Source: AGHT+IG1/gh0Tx718s/DdWR6wXf5Tg5bRB9IDMaEDwbG8FNMoWXTW8TuKKXfXzxr9YpwMZupAvH+zg== X-Received: by 2002:a17:902:da81:b0:207:3a5d:69b7 with SMTP id d9443c01a7336-20afc436228mr32135965ad.15.1727253300200; Wed, 25 Sep 2024 01:35:00 -0700 (PDT) Original-Received: from pebl ([2001:8003:7816:8300:47c0:bc9b:d80f:8ab8]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20af172416esm20632605ad.81.2024.09.25.01.34.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Sep 2024 01:34:59 -0700 (PDT) In-Reply-To: (martin rudalics's message of "Wed, 25 Sep 2024 10:05:14 +0200") Received-SPF: pass client-ip=2607:f8b0:4864:20::62f; envelope-from=pranshusharma366@gmail.com; helo=mail-pl1-x62f.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: Wed, 25 Sep 2024 07:05:37 -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:324059 Archived-At: martin rudalics writes: >>> https://www.emacswiki.org/emacs/TransposeFrame >>> The code in this has the following limitations: >>> - Does not work in emacs 29.1 > > It works here when I remove the > > (window-redisplay-end-trigger tree) > > (set-window-redisplay-end-trigger window (pop config)) > > lines in such versions. > >>> - No good way to transpose only specific parts of window tree > > Then the FRAME arguments should probably become WINDOW-OR-FRAME and > accept arbitrary internal windows as value. > >> Thanks. >> >> Martin, any comments or suggestions? > > The problem of any such package is that Emacs never provided a suitable > balance between explicit management of objects like buffers or windows > (via 'kill-buffer' and 'delete-window') and the subsequent internal > handling of these objects. > > In particular, the 'delete-window'/'split-window' paradigm may fail when > window objects have been stored in variables. Take this excerpt from > TransposeFrame > > (if (eq (overlay-get ol 'window) orig-window) > (overlay-put ol 'window window)))) > > If this gets called within a 'save-window-excursion', then the 'window' > property of overlays may change from 'orig-window' to 'window'. When > 'save-window-excursion' exits and restores 'orig-window' and deletes > 'window', these overlays will now reference a dead window. This problem > could be partially fixed by using the 'clone-of' parameter of the > window. But that would fail when windows are rotated a second time. >From what I understand, the main problems are happening when destroying and recreating the window arragnment. How about adding a function that toggles or changes the window arrangment non recursivly, which will deal with all the backend details, and the main rotate function can just recursivly call that on all windows. > > Such problems could be fixed if we were able to reference windows by > their number (or an arbitrary name) and have Lisp references to a window > use that number instead of the object. It might, however, take > considerable time to have such a concept enter the minds of people used > to storing window identities as Lisp objects. > > martin