Function: previous-buffer
previous-buffer is an interactive and byte-compiled function defined
in window.el.gz.
Signature
(previous-buffer &optional ARG INTERACTIVE)
Documentation
In selected window switch to ARGth previous buffer.
Call switch-to-prev-buffer unless the selected window is the
minibuffer window or is dedicated to its buffer.
Probably introduced at or before Emacs version 22.1.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/window.el.gz
(defun previous-buffer (&optional arg interactive)
"In selected window switch to ARGth previous buffer.
Call `switch-to-prev-buffer' unless the selected window is the
minibuffer window or is dedicated to its buffer."
(interactive "p\np")
(cond
((window-minibuffer-p)
(user-error "Cannot switch buffers in minibuffer window"))
((eq (window-dedicated-p) t)
(user-error "Window is strongly dedicated to its buffer"))
(t
(dotimes (_ (or arg 1))
(when (and (not (switch-to-prev-buffer))
interactive
(not (or executing-kbd-macro noninteractive)))
(user-error "No previous buffer"))))))