From: martin rudalics <rudalics@gmx.at>
To: monnier@IRO.UMontreal.CA
Cc: Chong Yidong <cyd@gnu.org>, emacs-devel@gnu.org
Subject: Re: Windows' "split status"
Date: Tue, 10 Jan 2012 17:26:35 +0100 [thread overview]
Message-ID: <4F0C66BB.9000800@gmx.at> (raw)
In-Reply-To: <jwvfwhp4b66.fsf-monnier+emacs@gnu.org>
>>> But I think this result is just a consequence of the implementation
>>> rather than actual intention. My impression is that window-nest is
>>> trying to solve a problem which can't be solved with a user-config: it's
>>> trying to provide some kind of way for elisp packages to use parent
>>> windows as a form of "very lightweight sub-frame", without touching much
>>> of their code (e.g. without making their code use parent windows
>>> explicitly).
>>> IIUC the use of window-nest for that purpose only works if the
>>> application limits itself to using 2 windows within that "sub-frame",
>
>> What makes you think that?
>
> Are you saying that my description of the intention behind window-nest
> is wrong? Or are you only saying that the "at most 2" limitation is not
> really true. while everything else is right?
When using side windows there must be exactly one major non-side window
containing all other non-side windows. That window can be considered a
"very lightweight sub-frame". But the number of subwindows of that
window is not limited in any sense.
> I don't actually know what was the intention behind window-nest, so
> confirmation would be welcome.
Your characterization above is OK. Just that there's no limitation.
>> You can let-bind `window-nest' to t around a
>> split and get an extra parent around the resulting two windows. After
>> that you can split those windows any which way you want and can get an
>> arbitrary number of windows within a "sub-frame". The manual explicitly
>> uses the term "always" in the sentence
>
> That sounds like a rather round-about way to do things (because you have
> let-bind the var around some parts of he code, but not all): wouldn't it
> be easier to start with "create a parent window" (which would start
> containing only the selected window) an then proceed to split it the
> usual way. That would save you from using let-binding.
There are two problems with this:
(1) I invariantly disallow matryoshka windows, so each internal window
must have at least two children. Lifting this invariant might have
tricky consequences.
(2) When deleting a window makes a parent recombinable with its
siblings, I must be able to suppress that recombination - otherwise
the "sub-frame" mechanism will break.
>> `window-nest' is aimed at providing a safe low-level mechanism to
>> construct and preserve parent windows. Everything else can be easily
>> built in Elisp on top of that, like atomic or side windows.
>
> If it's a low-level mechanism, why is it a defcustom, then?
It's a defcustom because earlier it was just a special value of a
precursor of an option now called `window-combination-resize'. If you
think it's a bad idea, I can always turn it into a plain variable like
`display-buffer-mark-dedicated'. OTOH, having it always non-nil makes
the behavior of window deletions more predictable as explained in the
manual.
> If it's aimed at "construct and preserve", why is it a variable, rather
> than a function?
It's a variable _and_ a slot in the window structure and it's used like
`display-buffer-mark-dedicated': Usually for one single call but there's
no harm if someone wants all windows be dedicated or all parent windows
have only two children.
martin
next prev parent reply other threads:[~2012-01-10 16:26 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-11 15:37 Windows' "split status" Chong Yidong
2011-11-11 18:37 ` martin rudalics
2011-11-12 0:36 ` Chong Yidong
2011-11-12 10:01 ` martin rudalics
2011-11-13 3:23 ` Chong Yidong
2011-11-13 10:49 ` martin rudalics
2011-11-13 16:10 ` Chong Yidong
2011-11-13 17:17 ` martin rudalics
2011-11-15 5:20 ` Chong Yidong
2011-11-15 7:25 ` martin rudalics
2011-11-15 9:39 ` Chong Yidong
2011-11-15 13:30 ` Stefan Monnier
2011-11-15 15:15 ` martin rudalics
2011-11-15 16:24 ` monnier
2012-01-10 16:26 ` martin rudalics [this message]
2011-11-23 12:36 ` Nix
2011-11-23 14:15 ` martin rudalics
2011-11-23 17:38 ` Eli Zaretskii
2011-11-23 19:21 ` martin rudalics
2011-11-23 20:14 ` Eli Zaretskii
2011-11-24 10:00 ` martin rudalics
2011-11-24 11:27 ` Eli Zaretskii
2011-11-25 10:24 ` martin rudalics
2011-11-25 11:37 ` Eli Zaretskii
2011-11-25 13:55 ` martin rudalics
2011-11-25 12:00 ` Nix
2011-11-25 12:07 ` Eli Zaretskii
2011-11-25 12:14 ` Nix
2011-11-25 13:55 ` martin rudalics
2011-11-25 13:54 ` martin rudalics
2011-11-15 15:15 ` martin rudalics
2011-11-15 18:37 ` Juri Linkov
2011-11-16 5:08 ` Chong Yidong
2011-11-16 10:11 ` martin rudalics
2011-11-16 13:34 ` Stefan Monnier
2011-11-16 17:01 ` Juri Linkov
2011-11-17 10:34 ` martin rudalics
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F0C66BB.9000800@gmx.at \
--to=rudalics@gmx.at \
--cc=cyd@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=monnier@IRO.UMontreal.CA \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.