Function: display-buffer-at-bottom

display-buffer-at-bottom is a byte-compiled function defined in window.el.gz.

Signature

(display-buffer-at-bottom BUFFER ALIST)

Documentation

Try displaying BUFFER in a window at the bottom of the selected frame.

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.

ALIST is an association list of action symbols and values. See Info node (elisp) Buffer Display Action Alists for details of such alists.

This is an action function for buffer display, see Info node (elisp) Buffer Display Action Functions. It should be called only by display-buffer or a function directly or indirectly called by the latter.

Probably introduced at or before Emacs version 24.4.

Source Code

;; Defined in /usr/src/emacs/lisp/window.el.gz
;; This should be rewritten as
;; (display-buffer-in-direction buffer (cons '(direction . bottom) alist))
(defun display-buffer-at-bottom (buffer alist)
  "Try displaying BUFFER in a window at the bottom of the selected frame.
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.

ALIST is an association list of action symbols and values.  See
Info node `(elisp) Buffer Display Action Alists' for details of
such alists.

This is an action function for buffer display, see Info
node `(elisp) Buffer Display Action Functions'.  It should be
called only by `display-buffer' or a function directly or
indirectly called by the latter."
  (let (bottom-window bottom-window-shows-buffer window)
    (walk-window-tree
     (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))
	(and (not (frame-parameter nil 'unsplittable))
	     (setq window (split-window-no-error (window-main-window)))
	     (window--display-buffer buffer window 'window alist))
	(and (setq window bottom-window)
	     (not (window-dedicated-p window))
	     (window--display-buffer buffer window 'reuse alist)))))