When diffing with a buffer, ignore whether it is modified or not. The
authorTaylor R. Campbell <net/mumble/campbell>
Tue, 2 Sep 2008 21:31:59 +0000 (21:31 +0000)
committerTaylor R. Campbell <net/mumble/campbell>
Tue, 2 Sep 2008 21:31:59 +0000 (21:31 +0000)
user may want to see how a file has changed on disk even if the buffer
in memory has not been touched.

v7/src/edwin/diff.scm

index 294872b3edd41de5827ef183ed4076a457e3890b..68208e072da73a382cd130c34a372554bf0e740c 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: diff.scm,v 1.2 2006/06/16 18:33:21 riastradh Exp $
+$Id: diff.scm,v 1.3 2008/09/02 21:31:59 riastradh Exp $
 
 This code is written by Taylor R. Campbell and placed in the Public
 Domain.  All warranties are disclaimed.
@@ -80,15 +80,13 @@ Domain.  All warranties are disclaimed.
 \f
 (define (diff-buffer buffer pathname receiver)
   (select-buffer
-   (if (buffer-modified? buffer)
-       (call-with-temporary-file-pathname
-        (lambda (temporary-pathname)
-          (write-region (buffer-region buffer)
-                        temporary-pathname
-                        #f              ;No message
-                        #f)             ;No line ending translation
-          (receiver temporary-pathname)))
-       (receiver pathname))))
+   (call-with-temporary-file-pathname
+     (lambda (temporary-pathname)
+       (write-region (buffer-region buffer)
+                     temporary-pathname
+                     #f                 ;No message
+                     #f)                ;No line ending translation
+       (receiver temporary-pathname)))))
 
 (define (diff-to-buffer old-filename new-filename #!optional buffer)
   (let ((buffer (diff-to-buffer-argument buffer)))