changeset 47303:d33f4de2e8e8

(ibuffer-diff-with-file): Just call `diff-buffer-with-file'.
author Colin Walters <walters@gnu.org>
date Sat, 07 Sep 2002 21:30:55 +0000
parents 9f4e1e4aded6
children 2ae3c0d6525a
files lisp/ibuf-ext.el
diffstat 1 files changed, 2 insertions(+), 32 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ibuf-ext.el	Sat Sep 07 21:30:37 2002 +0000
+++ b/lisp/ibuf-ext.el	Sat Sep 07 21:30:55 2002 +0000
@@ -1221,40 +1221,10 @@
   "View the differences between this buffer and its associated file.
 This requires the external program \"diff\" to be in your `exec-path'."
   (interactive)
-  (let* ((buf (ibuffer-current-buffer))
-	 (buf-filename (with-current-buffer buf
-			 buffer-file-name)))
+  (let ((buf (ibuffer-current-buffer)))
     (unless (buffer-live-p buf)
       (error "Buffer %s has been killed" buf))
-    (unless buf-filename
-      (error "Buffer %s has no associated file" buf))
-    (let ((diff-buf (get-buffer-create "*Ibuffer-diff*")))
-      (with-current-buffer diff-buf
-	(setq buffer-read-only nil)
-	(erase-buffer))
-      (let ((tempfile (make-temp-file "ibuffer-diff-")))
-	(unwind-protect
-	    (progn
-	      (with-current-buffer buf
-		(write-region (point-min) (point-max) tempfile nil 'nomessage))
-	      (if (zerop
-		   (apply #'call-process "diff" nil diff-buf nil
-			  (append
-			   (when (and (boundp 'ediff-custom-diff-options)
-				      (stringp ediff-custom-diff-options))
-			     (list ediff-custom-diff-options))
-			   (list buf-filename tempfile))))
-		  (message "No differences found")
-		(progn
-		  (with-current-buffer diff-buf
-		    (goto-char (point-min))
-		    (if (fboundp 'diff-mode)
-			(diff-mode)
-		      (fundamental-mode)))
-		  (display-buffer diff-buf))))
-	  (when (file-exists-p tempfile)
-	    (delete-file tempfile)))))
-      nil))
+    (diff-buffer-with-file buf)))
 
 ;;;###autoload
 (defun ibuffer-copy-filename-as-kill (&optional arg)