Function: vc-diff-restore-buffer
vc-diff-restore-buffer is a byte-compiled function defined in
vc.el.gz.
Signature
(vc-diff-restore-buffer ORIGINAL NEW)
Documentation
Restore point in buffer NEW to where it was in ORIGINAL.
This function works by updating buffer ORIGINAL with the contents of NEW (without destroying existing markers), swapping their text objects, and finally killing buffer ORIGINAL.
Source Code
;; Defined in /usr/src/emacs/lisp/vc/vc.el.gz
(defun vc-diff-restore-buffer (original new)
"Restore point in buffer NEW to where it was in ORIGINAL.
This function works by updating buffer ORIGINAL with the contents
of NEW (without destroying existing markers), swapping their text
objects, and finally killing buffer ORIGINAL."
(with-current-buffer original
(let ((inhibit-read-only t))
(replace-region-contents (point-min) (point-max) new)))
(with-current-buffer new
(buffer-swap-text original))
(kill-buffer original))