Subject: Re: bug#3366: 23.0.94; doc of split-window-preferred-function, display-buffer, etc.

From: martin rudalics <[email-masked]>
Date: Tue, 26 May 2009 11:28:57 +0200

> We're talking about `display-buffer', which is a function that provides
 > no guarantee about where the window gets displayed, so code that uses it
 > should be prepared for surprises.  If you argue that code should have
 > more control over it, I agree.

IMHO `display-buffer' has to follow (a) changes in display technology
and (b) user preferences.  (a) implies that code cannot rely upon which
window gets split or how that window is split accross future versions of
Emacs.  (b) implies that code using `display-buffer' must be aware of
user preferences.

If coders want precise control, they should use `set-window-buffer'.

 > I suggested changing the `not-this-window' argument so it can have
 > a description of the recommended window to use (not a specific window,
 > but something that could specify whether it should be on the same-frame
 > or not, in an adjacent window or not, in a preferably tall/wide window,
 > in a window close to the minibuffer, ...).

The `not-this-window' argument should be used with caution because it
already now overrides user preferences wrt to `display-buffer'.  I think
that only if the user does not specify any preference in `pop-up-frames'
or `pop-up-windows', an application should be allowed to override that.
So we should enhance the semantics of these variables first.

In addition, I think `window-size-fixed' should be handled the way we
treat dedicated windows.  That is, when this is non-nil for a particular
window, it should inhibit that `display-buffer' splits that window.  But
only the value `t' should inhibit that the window can be resized
manually.  Thus an application can set `window-size-fixed' to some
non-nil, non-t value to avoid that the window gets split and/or resized
by `display-buffer'.

Also `display-buffer' should call `split-window-preferred-function' at
most once.  Calling it with the largest and the LRU window (which may
designate one and the same window) appears merely disconcerting.

martin