changeset 14106:4302535a19eb

(diff): Set compilation-exit-message-function.
author Karl Heuer <kwzh@gnu.org>
date Tue, 09 Jan 1996 23:14:47 +0000
parents d8384341d55a
children 5449183b1e7b
files lisp/diff.el
diffstat 1 files changed, 13 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/diff.el	Tue Jan 09 23:08:24 1996 +0000
+++ b/lisp/diff.el	Tue Jan 09 23:14:47 1996 +0000
@@ -220,6 +220,19 @@
 				  "No more differences" "Diff"
 				  'diff-parse-differences))
 	  (pop-to-buffer buf)
+	  ;; Avoid frightening people with "abnormally terminated"
+	  ;; if diff finds differences.
+	  (set (make-local-variable 'compilation-exit-message-function)
+	       (lambda (proc msg)
+		 (let ((code (process-exit-status proc)))
+		   (if (eq (process-status proc) 'exit)
+		       (cond ((zerop code)
+			      '("finished (no differences)\n" . "finished"))
+			     ((= code 1)
+			      '("finished\n" . "finished"))
+			     (t
+			      (cons msg code)))
+		     (cons msg code)))))
 	  (set (make-local-variable 'diff-old-file) old)
 	  (set (make-local-variable 'diff-new-file) new)
 	  (set (make-local-variable 'diff-old-temp-file) old-alt)