summaryrefslogtreecommitdiff
path: root/lisp/diff.el
diff options
context:
space:
mode:
authorKarl Heuer <kwzh@gnu.org>1996-01-09 23:14:47 +0000
committerKarl Heuer <kwzh@gnu.org>1996-01-09 23:14:47 +0000
commitb7b92266cda782e4d73effb7fbe1a8f84fd731c3 (patch)
treece7a740b26f460d3756bb4583ead86921c2b4834 /lisp/diff.el
parent1111b1b41c9a87fdac3dcc7f897550326ee11d1b (diff)
downloademacs-b7b92266cda782e4d73effb7fbe1a8f84fd731c3.tar.gz
(diff): Set compilation-exit-message-function.
Diffstat (limited to 'lisp/diff.el')
-rw-r--r--lisp/diff.el13
1 files changed, 13 insertions, 0 deletions
diff --git a/lisp/diff.el b/lisp/diff.el
index eb2e4152896..2d681b8af27 100644
--- a/lisp/diff.el
+++ b/lisp/diff.el
@@ -220,6 +220,19 @@ With prefix arg, prompt for diff switches."
"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)