Function: set-window-buffer-start-and-point
set-window-buffer-start-and-point is a byte-compiled function defined
in window.el.gz.
Signature
(set-window-buffer-start-and-point WINDOW BUFFER &optional START POINT)
Documentation
Set WINDOW's buffer to BUFFER.
WINDOW must be a live window and defaults to the selected one.
Optional argument START non-nil means set WINDOW's start position
to START. Optional argument POINT non-nil means set WINDOW's
point to POINT. If WINDOW is selected this also sets BUFFER's
point to POINT. If WINDOW is selected and the buffer it showed
before was current this also makes BUFFER the current buffer.
Source Code
;; Defined in /usr/src/emacs/lisp/window.el.gz
(defun set-window-buffer-start-and-point (window buffer &optional start point)
"Set WINDOW's buffer to BUFFER.
WINDOW must be a live window and defaults to the selected one.
Optional argument START non-nil means set WINDOW's start position
to START. Optional argument POINT non-nil means set WINDOW's
point to POINT. If WINDOW is selected this also sets BUFFER's
`point' to POINT. If WINDOW is selected and the buffer it showed
before was current this also makes BUFFER the current buffer."
(setq window (window-normalize-window window t))
(let ((selected (eq window (selected-window)))
(current (eq (window-buffer window) (current-buffer)))
(dedicated-side (eq (window-dedicated-p window) 'side)))
(set-window-buffer window buffer)
(and dedicated-side (set-window-dedicated-p window 'side))
(when (and selected current)
(set-buffer buffer))
(when start
;; Don't force window-start here (even if POINT is nil).
(set-window-start window start t))
(when point
(set-window-point window point))))