Function: ibuffer-diff-with-file

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

Signature

(ibuffer-diff-with-file)

Documentation

View the differences between marked buffers and their associated files.

If no buffers are marked, use buffer at point. This requires the external program diff-command to be in your exec-path(var)/exec-path(fun).

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/ibuf-ext.el.gz
;;;###autoload
(defun ibuffer-diff-with-file ()
  "View the differences between marked buffers and their associated files.
If no buffers are marked, use buffer at point.
This requires the external program `diff-command' to be in your
`exec-path'."
  (interactive)
  (require 'diff)
  (let ((marked-bufs (or (ibuffer-get-marked-buffers)
                         (list (ibuffer-current-buffer t))))
        (diff-buf (get-buffer-create "*Ibuffer Diff*")))
    (with-current-buffer diff-buf
      (setq buffer-read-only t)
      (buffer-disable-undo)
      (let ((inhibit-read-only t))
        (erase-buffer))
      (buffer-enable-undo)
      (diff-mode)
      (diff-check-labels)
      (dolist (buf marked-bufs)
	(unless (buffer-live-p buf)
	  (error "Buffer %s has been killed" buf))
        (ibuffer-diff-buffer-with-file-1 buf))
      (goto-char (point-min))
      (when (= (following-char) ?\n)
        (let ((inhibit-read-only t))
          (delete-char 1))))
    (pop-to-buffer-same-window diff-buf)))