Function: diff-buffer-with-file

diff-buffer-with-file is an autoloaded, interactive and byte-compiled function defined in diff.el.gz.

Signature

(diff-buffer-with-file &optional BUFFER)

Documentation

View the differences between BUFFER and its associated file.

This requires the external program diff to be in your exec-path(var)/exec-path(fun).

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/vc/diff.el.gz
;;;###autoload
(defun diff-buffer-with-file (&optional buffer)
  "View the differences between BUFFER and its associated file.
This requires the external program `diff' to be in your `exec-path'."
  (interactive "bBuffer: ")
  (let ((buf (get-buffer (or buffer (current-buffer)))))
    (with-current-buffer (or (buffer-base-buffer buf) buf)
      (unless buffer-file-name
        (error "Buffer is not visiting a file"))
      (diff buffer-file-name (current-buffer) nil 'noasync))))