all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: Drew Adams <drew.adams@oracle.com>
Cc: emacs-devel@gnu.org
Subject: Re: display-buffer cleverness - how to tame?
Date: Tue, 05 May 2009 18:33:29 +0200	[thread overview]
Message-ID: <4A006A59.1000406@gmx.at> (raw)
In-Reply-To: <004901c9cd8c$4d902e60$0200a8c0@us.oracle.com>

 > So the question is, then, how to get Emacs 23 to not split that (non-full-width
 > largest) window if it is not the lru window?

Exact.

 > However, the doc string for `split-window-preferred-function' is not clear (to
 > me). First, this sentence is not grammatically correct; I can't understand it:
 >
 > "If non-nil, a function called with a window as single argument
 > supposed to split that window and return the new window."
 >
 > That seems to say that the window argument is supposed to split itself, or
 > something like that.

Well, even an Emacs window won't split itself, but this part must be
rewritten anyway.

 >>From your description above, the function decides, based on a window passed as
 > arg, which window to split, and then splits the window it chooses. Is that
 > correct?

The function should split the window passed as arg but no one will ask
whether it really split that window.  As a matter of fact, the function
may do anything it wants as long as it returns a live window.

 > Why is a particular window passed as arg, if the choice of which window to split
 > is up to the function?

Because the standard (not user-written) functions will try to split the
window passed as arg.

 > Is there some usual interpretation/use of that window
 > arg?

The interpretation is "this is one of the windows Emacs 22 tried to split".

 > When `display-buffer' calls `split-window-preferred-function', which window
 > does it pass as arg?

In a first call the largest window of the selected frame, in the second
call the least recently used one.

 > What is the role/meaning of that window; how does
 > `display-buffer' pick it? You say the function is called "with the window to
 > split", but what does that mean, if it is the function itself that decides which
 > window to split (and splits it)?

Up to Emacs 22 the identity of the window to split was hardcoded.  The
present code gives you a way to override that while keeping most of the
historic details.  I dislike the get-largest/LRU-window mumbo jumbo and
rather have `split-window-preferred-function' decide which window(s) to
split ...

martin




  reply	other threads:[~2009-05-05 16:33 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-04  7:41 display-buffer cleverness - how to tame? Drew Adams
2009-05-04  8:38 ` martin rudalics
2009-05-04 14:39   ` Drew Adams
2009-05-04 15:03     ` Miles Bader
2009-05-04 15:49       ` Drew Adams
2009-05-04 18:58         ` Samuel Bronson
2009-05-05  2:50         ` Miles Bader
2009-05-04 16:36     ` Stefan Monnier
2009-05-04 16:41     ` martin rudalics
2009-05-04 17:13       ` Drew Adams
2009-05-05  7:02         ` martin rudalics
2009-05-05 14:18           ` Drew Adams
2009-05-05 16:33             ` martin rudalics [this message]
2009-05-05 16:58               ` Drew Adams
2009-05-05 18:55                 ` martin rudalics
2009-05-05 20:20                   ` Drew Adams
2009-05-06 16:21                     ` martin rudalics
2009-05-06 17:54                       ` Drew Adams
2009-05-07  9:37                         ` 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=4A006A59.1000406@gmx.at \
    --to=rudalics@gmx.at \
    --cc=drew.adams@oracle.com \
    --cc=emacs-devel@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 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.