Function: window-normalize-buffer
window-normalize-buffer is a byte-compiled function defined in
window.el.gz.
Signature
(window-normalize-buffer BUFFER-OR-NAME)
Documentation
Return buffer specified by BUFFER-OR-NAME.
BUFFER-OR-NAME must be a live buffer, a string naming a live buffer or nil which means to return the current buffer.
This function is commonly used to process the (usually optional)
"BUFFER-OR-NAME" argument of window related functions where nil
stands for the current buffer.
Source Code
;; Defined in /usr/src/emacs/lisp/window.el.gz
(defun window-normalize-buffer (buffer-or-name)
"Return buffer specified by BUFFER-OR-NAME.
BUFFER-OR-NAME must be a live buffer, a string naming a live
buffer or nil which means to return the current buffer.
This function is commonly used to process the (usually optional)
\"BUFFER-OR-NAME\" argument of window related functions where nil
stands for the current buffer."
(let ((buffer
(cond
((not buffer-or-name)
(current-buffer))
((bufferp buffer-or-name)
buffer-or-name)
((stringp buffer-or-name)
(get-buffer buffer-or-name))
(t
(error "No such buffer %s" buffer-or-name)))))
(if (buffer-live-p buffer)
buffer
(error "No such live buffer %s" buffer-or-name))))