unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 9875@debbugs.gnu.org
Subject: bug#9875: 24.0.90; Confusing description of the "window tree" in ELisp manual
Date: Wed, 26 Oct 2011 16:23:05 +0200	[thread overview]
Message-ID: <4EA817C9.9030000@gmx.at> (raw)
In-Reply-To: <E1RJ1tK-0002EG-F9@fencepost.gnu.org>

 > This node starts fine, by describing window-frame and window-list.
 > Then it begins to describe the "window tree", and that's where things
 > go wrong.  The main problem is that the non-leaf nodes of the window
 > tree are referred to as "windows",

... as "internal windows" more precisely  ...

 > which makes it all too easy to
 > confuse them with the leafs of the window tree, each one of which
 > corresponds to a real live window displayed on the frame.  This is
 > fundamentally wrong, because there's a significant difference between
 > the "normal" (a.k.a. "live") windows and the nodes of the window
 > tree.

Many important functions like `split-window', `delete-window', the
window resize functions, and obviously the new window tree functions
including `walk-window-tree' apply to both live and internal windows.

 > The confusion thereafter continues in the next sections of the
 > "Windows" chapter, as these "windows" are sometimes called "internal
 > windows", sometimes contrasted with "live" windows.

Hopefully wherever such a contrast is required.

 > The confusion
 > culminates in "Splitting Windows", where many issues are described via
 > window-parent and what is called "creating a new parent".

Yes. And I probably gave too many examples for this in the expectation
that readers would study them and get a feeling for what internal
windows are needed for.  But what is the culminating confusion here?
Could you provide at least one example?

 > I submit these confusing references to the nodes of the window tree as
 > "windows" should be removed.  If we want to talk about the window
 > tree, let's talk about a tree with nodes; let's not call them
 > "windows".  I know that each node is exposed to Lisp as a window
 > object, but (a) I'm not sure this is a good idea either, and (b) what
 > harm will be done if we mention this factoid in some place and
 > immediately forget about it?

Simply that functions accepting an internal window as argument would
have to say "the argument can be a window or a node" which doesn't
strike me as very constructive.  In particular not so because I then
would have to explain in the doc-string what a "node" is.

 > I guess what I'm saying is this: let's have a single section named
 > "The Window Tree" which describes the tree and what can be done with
 > its nodes from a Lisp program, and let's describe all the other
 > window-related operations without any reference to the tree or its
 > nodes.  I submit that most Lisp programmers will never need to go to
 > the level of the tree, unless they want to understand the internal
 > operation of windows.el or rewrite it from scratch.

Given the fact that a function like `frame-root-window' (which would
return a "node" in your parlance whenever we have two live windows) is
in Emacs since 1992 at least and a documentation of that function has
been reqeusted recently here on this forum, I suppose that at least some
Lisp programmers need to go to the level of the tree.

Let's take an example: I wrote two functions called `window-state-get'
and `window-state-put' in the hope that eventually someone uses these
functions in order to write window configurations to a file and reuse
them in a later session.  If we find someone to do that, that person
must be interested in internal windows, because these are part of the
state and prescribe how to obtain the original configuration from that
state.  Debugging or patching these functions without knowing about
internal windows is virtually impossible.

martin






  parent reply	other threads:[~2011-10-26 14:23 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-26 11:43 bug#9875: 24.0.90; Confusing description of the "window tree" in ELisp manual Eli Zaretskii
2011-10-26 14:17 ` Stefan Monnier
2011-10-26 18:31   ` Eli Zaretskii
2011-10-26 22:21     ` Stefan Monnier
2011-10-27  7:27       ` Eli Zaretskii
2011-10-27  9:56         ` martin rudalics
2011-10-27 11:05           ` Eli Zaretskii
2011-10-27 12:36             ` Stefan Monnier
2011-10-27 12:58               ` Eli Zaretskii
2011-10-27 13:16             ` martin rudalics
2011-10-27 12:35         ` Stefan Monnier
2011-10-26 14:23 ` martin rudalics [this message]
2011-10-26 18:54   ` Eli Zaretskii
2011-10-27  9:52     ` martin rudalics
2011-10-27 11:00       ` Eli Zaretskii
2011-10-27 13:16         ` martin rudalics
2011-10-28  8:04         ` Juri Linkov
2011-10-28  9:43           ` Eli Zaretskii
2011-10-28 13:38           ` Drew Adams

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=4EA817C9.9030000@gmx.at \
    --to=rudalics@gmx.at \
    --cc=9875@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /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).