Function: cvs-pop-to-buffer-same-frame
cvs-pop-to-buffer-same-frame is a byte-compiled function defined in
pcvs-util.el.gz.
Signature
(cvs-pop-to-buffer-same-frame BUF)
Documentation
Pop to BUF like pop-to-buffer but staying on the same frame.
If pop-to-buffer would have opened a new frame, this function would
try to split a new window instead.
Source Code
;; Defined in /usr/src/emacs/lisp/vc/pcvs-util.el.gz
;;;
;;; frame, window, buffer handling
;;;
(defun cvs-pop-to-buffer-same-frame (buf)
"Pop to BUF like `pop-to-buffer' but staying on the same frame.
If `pop-to-buffer' would have opened a new frame, this function would
try to split a new window instead."
(let ((pop-up-windows (or pop-up-windows pop-up-frames))
(pop-up-frames nil))
(or (let ((buf (get-buffer-window buf))) (and buf (select-window buf)))
(and pop-up-windows
(ignore-errors (select-window (split-window-below)))
(switch-to-buffer buf nil 'force-same-window))
(pop-to-buffer (current-buffer)))))