Function: vc-diff-patch-string

vc-diff-patch-string is a byte-compiled function defined in vc.el.gz.

Signature

(vc-diff-patch-string PATCH-STRING)

Documentation

Report diffs to be committed from the patch.

Like vc-diff-internal but uses PATCH-STRING to display in the output buffer.

Source Code

;; Defined in /usr/src/emacs/lisp/vc/vc.el.gz
(defun vc-diff-patch-string (patch-string)
  "Report diffs to be committed from the patch.
Like `vc-diff-internal' but uses PATCH-STRING to display
in the output buffer."
  (let ((buffer "*vc-diff*"))
    (vc-setup-buffer buffer)
    (let ((buffer-undo-list t)
          (inhibit-read-only t))
      (insert patch-string))
    (setq buffer-read-only t)
    (diff-mode)
    (setq-local diff-vc-backend (vc-responsible-backend default-directory))
    (setq-local revert-buffer-function
                (lambda (_ _) (vc-diff-patch-string patch-string)))
    (setq-local vc-patch-string patch-string)
    (pop-to-buffer (current-buffer))
    (vc-run-delayed (vc-diff-finish (current-buffer) nil))))