aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Rudalics2014-08-29 12:39:17 +0200
committerMartin Rudalics2014-08-29 12:39:17 +0200
commitf0e709846e9a5a6b77a2f526fed37624771f19e6 (patch)
tree6d1dc25e042e9a2da5bb1614b6a5cc2740eb037b
parent1764ec4414074ea0dcbd912efdfbedb119f8ed3b (diff)
downloademacs-f0e709846e9a5a6b77a2f526fed37624771f19e6.tar.gz
emacs-f0e709846e9a5a6b77a2f526fed37624771f19e6.zip
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 <juri@jurta.org> in discussion of (Bug#18181).
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/window.el25
2 files changed, 26 insertions, 6 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 61fdfefb185..6df129d22ea 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,10 @@
12014-08-29 Martin Rudalics <rudalics@gmx.at>
2
3 * window.el (display-buffer-at-bottom): Prefer bottom-left
4 window to other bottom windows. Reuse a bottom window if it
5 shows the buffer already. Suggested by Juri Linkov
6 <juri@jurta.org> in discussion of (Bug#18181).
7
12014-08-29 Leo Liu <sdl.web@gmail.com> 82014-08-29 Leo Liu <sdl.web@gmail.com>
2 9
3 * files.el (minibuffer-with-setup-hook): Allow (:append FUN) to 10 * 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."
6469 6469
6470(defun display-buffer-at-bottom (buffer alist) 6470(defun display-buffer-at-bottom (buffer alist)
6471 "Try displaying BUFFER in a window at the bottom of the selected frame. 6471 "Try displaying BUFFER in a window at the bottom of the selected frame.
6472This either splits the window at the bottom of the frame or the 6472This either reuses such a window provided it shows BUFFER
6473frame's root window, or reuses an existing window at the bottom 6473already, splits a window at the bottom of the frame or the
6474of the selected frame." 6474frame's root window, or reuses some window at the bottom of the
6475 (let (bottom-window window) 6475selected frame."
6476 (let (bottom-window bottom-window-shows-buffer window)
6476 (walk-window-tree 6477 (walk-window-tree
6477 (lambda (window) (setq bottom-window window)) nil nil 'nomini) 6478 (lambda (window)
6478 (or (and (not (frame-parameter nil 'unsplittable)) 6479 (cond
6480 ((window-in-direction 'below window))
6481 ((and (not bottom-window-shows-buffer)
6482 (eq buffer (window-buffer window)))
6483 (setq bottom-window-shows-buffer t)
6484 (setq bottom-window window))
6485 ((not bottom-window)
6486 (setq bottom-window window)))
6487 nil nil 'nomini))
6488 (or (and bottom-window-shows-buffer
6489 (window--display-buffer
6490 buffer bottom-window 'reuse alist display-buffer-mark-dedicated))
6491 (and (not (frame-parameter nil 'unsplittable))
6479 (let (split-width-threshold) 6492 (let (split-width-threshold)
6480 (setq window (window--try-to-split-window bottom-window alist))) 6493 (setq window (window--try-to-split-window bottom-window alist)))
6481 (window--display-buffer 6494 (window--display-buffer