changeset 85364:f8d1bb788744

(vc-diff-sentinel, vc-diff-internal): Revert some changes in the behavior unrelated to filesets.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Wed, 17 Oct 2007 16:22:27 +0000
parents 104186d7ba4b
children a10ee3a5c9ce
files lisp/ChangeLog lisp/vc.el
diffstat 2 files changed, 36 insertions(+), 33 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Wed Oct 17 15:58:05 2007 +0000
+++ b/lisp/ChangeLog	Wed Oct 17 16:22:27 2007 +0000
@@ -1,9 +1,14 @@
+2007-10-17  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* vc.el (vc-diff-sentinel, vc-diff-internal): Revert some change in the
+	behavior unrelated to filesets.
+
 2007-10-17  Chong Yidong  <cyd@stupidchicken.com>
 
 	* longlines.el (longlines-wrap-follows-window-size): Integer value
 	specifies wrapping margin.
-	(longlines-mode, longlines-window-change-function): Set
-	window-specific wrapping margin based on the above.
+	(longlines-mode, longlines-window-change-function):
+	Set window-specific wrapping margin based on the above.
 
 2007-10-17  John Wiegley  <johnw@newartisans.com>
 
@@ -16,8 +21,8 @@
 
 2007-10-17  Glenn Morris  <rgm@gnu.org>
 
-	* progmodes/cc-menus.el (cc-imenu-c++-generic-expression): Tweak
-	regexp to avoid stack overflow.
+	* progmodes/cc-menus.el (cc-imenu-c++-generic-expression):
+	Tweak regexp to avoid stack overflow.
 
 2007-10-16  Stefan Monnier  <monnier@iro.umontreal.ca>
 
--- a/lisp/vc.el	Wed Oct 17 15:58:05 2007 +0000
+++ b/lisp/vc.el	Wed Oct 17 16:22:27 2007 +0000
@@ -1873,24 +1873,17 @@
 (make-obsolete 'vc-diff-switches-list 'vc-switches "22.1")
 
 (defun vc-diff-sentinel (verbose rev1-name rev2-name)
-  ;; Did changes get generated into the buffer?
-  (if (not (zerop (buffer-size (get-buffer "*vc-diff*"))))
-      (progn
-	(pop-to-buffer "*vc-diff*")
-	;; Gnus-5.8.5 sets up an autoload for diff-mode, even if it's
-	;; not available.  Work around that.
-	(if (require 'diff-mode nil t) (diff-mode))
-	(when verbose
-	  (let (buffer-read-only)
-	    (goto-char (point-max))
-	    (insert (format "\n\nDiffs between %s and %s end here." rev1-name rev2-name))
-	    (goto-char (point-min))
-	    (insert (format "Diffs between %s and %s:\n\n" rev1-name rev2-name))))
-	(shrink-window-if-larger-than-buffer)
-	t)
-    (progn
-      (message "No changes between %s and %s" rev1-name rev2-name)
-      nil)))
+  ;; The empty sync output case has already been handled, so the only
+  ;; possibility of an empty output is for an async process, in which case
+  ;; it's important to insert the "diffs end here" message in the buffer
+  ;; since the user may miss a message in the echo area.
+  (when verbose
+    (let ((inhibit-read-only t))
+      (if (eq (buffer-size) 0)
+          (insert "No differences found.\n")
+        (insert (format "\n\nDiffs between %s and %s end here." rev1-name rev2-name)))))
+  (goto-char (point-min))
+  (shrink-window-if-larger-than-buffer))
 
 (defun vc-diff-internal (backend async files rev1 rev2 &optional verbose)
   "Report diffs between two revisions of a fileset.
@@ -1927,12 +1920,20 @@
       (let ((vc-disable-async-diff (not async)))
 	(vc-call-backend backend 'diff filtered rev1 rev2 "*vc-diff*")))
     (set-buffer "*vc-diff*")
-    ;; This odd-looking code is because in the non-async case we 
-    ;; actually want to pass the return value from vc-diff-sentinel
-    ;; back to the caller.
-    (if async
-	(vc-exec-after `(vc-diff-sentinel ,verbose ,rev1-name ,rev2-name))
-     (vc-diff-sentinel verbose rev1-name rev2-name))))
+    (if (and (zerop (buffer-size))
+             (not (get-buffer-process (current-buffer))))
+        ;; Treat this case specially so as not to pop the buffer.
+        (progn
+          (message "No changes between %s and %s" rev1-name rev2-name)
+          nil)
+      (pop-to-buffer (current-buffer))
+      ;; Gnus-5.8.5 sets up an autoload for diff-mode, even if it's
+      ;; not available.  Work around that.
+      (if (require 'diff-mode nil t) (diff-mode))
+      (vc-exec-after `(vc-diff-sentinel ,verbose ,rev1-name ,rev2-name))
+      ;; In the async case, we return t even if there are no differences
+      ;; because we don't know that yet.
+      t)))
 
 ;;;###autoload
 (defun vc-history-diff (backend files rev1 rev2)
@@ -3031,10 +3032,7 @@
     (vc-register)))
 
 (defalias 'vc-default-logentry-check 'ignore)
-
-(defun vc-default-check-headers (backend)
-  "Default implementation of check-headers; always returns nil."
-  nil)
+(defalias 'vc-default-check-headers 'ignore)
 
 (defun vc-default-log-view-mode (backend) (log-view-mode))
 
@@ -3116,7 +3114,7 @@
               (and (not vc-make-backup-files) (delete-file backup-name))))))
       (message "Checking out %s...done" file))))
 
-(defun vc-default-revision-completion-table (backend file) nil)
+(defalias 'vc-default-revision-completion-table 'ignore)
 
 (defun vc-check-headers ()
   "Check if the current file has any headers in it."