emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: display-buffer cleverness - how to tame?


From: martin rudalics
Subject: Re: display-buffer cleverness - how to tame?
Date: Tue, 05 May 2009 18:33:29 +0200
User-agent: Thunderbird 2.0.0.16 (Windows/20080708)

> 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 via email to

[Prev in Thread] Current Thread [Next in Thread]