From: Martin Rudalics Date: Fri, 29 Aug 2014 10:39:17 +0000 (+0200) Subject: Adjust display-buffer-at-bottom. X-Git-Tag: emacs-25.0.90~2635^2~679^2~405 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f0e709846e9a5a6b77a2f526fed37624771f19e6;p=emacs.git Adjust display-buffer-at-bottom. * window.el (display-buffer-at-bottom): Prefer bottom-left window to other bottom windows. Reuse a bottom window if it shows the buffer already. Suggested by Juri Linkov in discussion of (Bug#18181). --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 61fdfefb185..6df129d22ea 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2014-08-29 Martin Rudalics + + * window.el (display-buffer-at-bottom): Prefer bottom-left + window to other bottom windows. Reuse a bottom window if it + shows the buffer already. Suggested by Juri Linkov + in discussion of (Bug#18181). + 2014-08-29 Leo Liu * files.el (minibuffer-with-setup-hook): Allow (:append FUN) to diff --git a/lisp/window.el b/lisp/window.el index e159bd967f1..539384c603d 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -6469,13 +6469,26 @@ the selected one." (defun display-buffer-at-bottom (buffer alist) "Try displaying BUFFER in a window at the bottom of the selected frame. -This either splits the window at the bottom of the frame or the -frame's root window, or reuses an existing window at the bottom -of the selected frame." - (let (bottom-window window) +This either reuses such a window provided it shows BUFFER +already, splits a window at the bottom of the frame or the +frame's root window, or reuses some window at the bottom of the +selected frame." + (let (bottom-window bottom-window-shows-buffer window) (walk-window-tree - (lambda (window) (setq bottom-window window)) nil nil 'nomini) - (or (and (not (frame-parameter nil 'unsplittable)) + (lambda (window) + (cond + ((window-in-direction 'below window)) + ((and (not bottom-window-shows-buffer) + (eq buffer (window-buffer window))) + (setq bottom-window-shows-buffer t) + (setq bottom-window window)) + ((not bottom-window) + (setq bottom-window window))) + nil nil 'nomini)) + (or (and bottom-window-shows-buffer + (window--display-buffer + buffer bottom-window 'reuse alist display-buffer-mark-dedicated)) + (and (not (frame-parameter nil 'unsplittable)) (let (split-width-threshold) (setq window (window--try-to-split-window bottom-window alist))) (window--display-buffer