unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: 路客 <luke.yx.lee@gmail.com>
Cc: Juri Linkov <juri@linkov.net>, Emacs developers <emacs-devel@gnu.org>
Subject: Re: [ELPA] Brief v5.90: neighboring window merge on deletion
Date: Tue, 26 Mar 2024 10:57:23 +0100	[thread overview]
Message-ID: <e284b0a4-7ca5-4f23-9068-089e0c257de1@gmx.at> (raw)
In-Reply-To: <CAA=xLRN3_9L2qvSwtLi+V2VL5U+93t=AaZthgv6cdwM7ScYOXg@mail.gmail.com>

 > Is it possible to provide some means so that we can `recycle' or
 > `reuse' the deleted window ID to prevent this kind of problem? In
 > `winner-mode' I saw the window ID is restored even after being deleted.
 > But that seems to be the nice side effect of `set-window-configuration'
 > which is not available for `window-state-put'.  With the latter I can at
 > best make it a `clone-of' the original deleted window.

It would be non-trivial to provide such a mechanism.  There are many
restrictions that allow 'set-window-configuration' to operate
satisfactorily and any new mechanism would have to adopt them somehow.

'undelete-frame', for example, uses 'window-state-put' to restore its
frame's windows, probably because its authors wanted to avoid the
pitfalls of making 'set-window-configuration' work for dead frames.

 > However, as an `emulation' mode, we usually can only expect it to be `as
 > close as possible' to the emulated target application.  After added the
 > `overlay' and full window state save/restoration it's quite close, but
 > of course it's best if I have a way to do it better -- a way to
 > `recycle', `reuse' or even `restore' the deleted window ID like
 > `winner-mode' does.

IIUC handling overlays with a 'window' property with current means is
much too cumbersome.  One would have to investigate all overlays in the
window's buffer and duplicate them if they have a 'window' property that
references the cloned window.  In practice, most overlays don't have
such a property.

 > Actually, even if so, it's still not possible to fully emulate the
 > `merge upon deletion' behavior while 100% keeping original Emacs
 > functionality -- the atomic property of two windows will gone if I force
 > to split them into two different window subtree, which lose the original
 > intention of atomicity so I might again need to add a customization
 > option for users who concern more about merging windows than breaking
 > window atomicity.  It's always a trade-off that users need to decide.

Atomicity is a property of a parent window.  If your operation clones
the parent window, it should retain the property regardless of which its
new child windows are.

martin



  reply	other threads:[~2024-03-26  9:57 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-22 11:23 [ELPA] Brief v5.90: neighboring window merge on deletion 路客
2024-03-22 13:22 ` Emanuel Berg
2024-03-23 18:33 ` Juri Linkov
2024-03-24  5:13   ` 路客
2024-03-24  9:54     ` martin rudalics
2024-03-24 15:51       ` 路客
2024-03-25  9:40         ` martin rudalics
2024-03-26  2:31           ` 路客
2024-03-26  9:57             ` martin rudalics [this message]
2024-03-26 12:51               ` Eli Zaretskii
2024-03-27  7:35                 ` martin rudalics
  -- strict thread matches above, loose matches on Subject: below --
2024-03-24  3:25 路客

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e284b0a4-7ca5-4f23-9068-089e0c257de1@gmx.at \
    --to=rudalics@gmx.at \
    --cc=emacs-devel@gnu.org \
    --cc=juri@linkov.net \
    --cc=luke.yx.lee@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).