GNU bug report logs - #3366
23.0.94; doc of split-window-preferred-function, display-buffer, etc.

Previous Next

Package: emacs;

Reported by: "Drew Adams" <drew.adams <at> oracle.com>

Date: Sun, 24 May 2009 17:05:06 UTC

Severity: minor

Tags: wontfix

Done: Lars Magne Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: martin rudalics <rudalics <at> gmx.at>
To: Drew Adams <drew.adams <at> oracle.com>, 3366 <at> debbugs.gnu.org
Subject: bug#3366: 23.0.94;	doc of split-window-preferred-function, display-buffer, etc.
Date: Mon, 25 May 2009 09:04:25 +0200
> It seems (but I'm not sure this works for all cases) that what is
> needed, to ensure that the same window as before is split, is to bind
> `split-window-preferred-function' to something like this around calls
> to `display-buffer':
>
> (lambda (w) (eq w (get-lru-window)))

The function you want might be

(defun split-window-22 (window)
  (let ((frame (window-frame window)))
    (or (and (setq window (get-largest-window frame t))
	     (window-full-width-p window)
	     (window-splittable-p window)
	     (split-window window))
	(and (setq window (get-lru-window frame t))
	     (window-splittable-p window)
	     (split-window window)))))

but I wouldn't rely on it.

> Even if this function is not an exact recipe for all cases, something
> like it should be mentioned, to help users get back the behavior that
> existed before the new "smarter" behavior was introduced.  Preferably,
> Emacs would itself provide a function that users could use here - a
> function that would give precisely the pre-23 behavior in all cases.
>
> We should also make it clear that if you want the pre-23 behavior then
> you will need to wrap not only explicit calls to `display-buffer' with
> a `let' binding this way, but also calls to things such as
> `with-output-to-temp-buffer'.

All people have to do is customize `split-window-preferred-function' to
that function.

martin




This bug report was last modified 13 years and 317 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.