summaryrefslogtreecommitdiff
path: root/lisp/diff.el
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1996-01-10 15:03:26 +0000
committerRoland McGrath <roland@gnu.org>1996-01-10 15:03:26 +0000
commit4cb4ed4111d8ee2b22665015414b7fbc8392f05a (patch)
tree7abf13c67cdd3de821e09b9b7a4010f05137a835 /lisp/diff.el
parenta30b83a501c72ef1e58efb106c957f9ffd2d82bd (diff)
downloademacs-4cb4ed4111d8ee2b22665015414b7fbc8392f05a.tar.gz
(diff): Fix local compilation-exit-message-function to take the proper
arguments; remove gratuitous use of if around cond; return useful mode line messages for normal completion.
Diffstat (limited to 'lisp/diff.el')
-rw-r--r--lisp/diff.el25
1 files changed, 12 insertions, 13 deletions
diff --git a/lisp/diff.el b/lisp/diff.el
index 2d681b8af27..1ebb774ec5a 100644
--- a/lisp/diff.el
+++ b/lisp/diff.el
@@ -1,6 +1,6 @@
;;; diff.el --- Run `diff' in compilation-mode.
-;; Copyright (C) 1992, 1994 Free Software Foundation, Inc.
+;; Copyright (C) 1992, 1994, 1996 Free Software Foundation, Inc.
;; Keywords: unix, tools
@@ -41,7 +41,7 @@
'(
;; -u format: @@ -OLDSTART,OLDEND +NEWSTART,NEWEND @@
("^@@ -\\([0-9]+\\),[0-9]+ \\+\\([0-9]+\\),[0-9]+ @@$" 1 2)
-
+
;; -c format: *** OLDSTART,OLDEND ****
("^\\*\\*\\* \\([0-9]+\\),[0-9]+ \\*\\*\\*\\*$" 1 nil)
;; --- NEWSTART,NEWEND ----
@@ -57,7 +57,7 @@
;; -n format: {a,d,c}OLDSTART LINES-CHANGED
("^[adc]\\([0-9]+\\)\\( [0-9]+\\)?$" 1)
)
- "Alist (REGEXP OLD-IDX NEW-IDX) of regular expressions to match difference
+ "Alist (REGEXP OLD-IDX NEW-IDX) of regular expressions to match difference
sections in \\[diff] output. If REGEXP matches, the OLD-IDX'th
subexpression gives the line number in the old file, and NEW-IDX'th
subexpression gives the line number in the new file. If OLD-IDX or NEW-IDX
@@ -223,16 +223,15 @@ With prefix arg, prompt for diff switches."
;; 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)))))
+ (lambda (status code msg)
+ (cond ((not (eq status 'exit))
+ (cons msg code))
+ ((zerop code)
+ '("finished (no differences)\n" . "no differences"))
+ ((= code 1)
+ '("finished\n" . "differences found"))
+ (t
+ (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)