diff options
| author | Roland McGrath | 1996-01-10 15:03:26 +0000 |
|---|---|---|
| committer | Roland McGrath | 1996-01-10 15:03:26 +0000 |
| commit | 4cb4ed4111d8ee2b22665015414b7fbc8392f05a (patch) | |
| tree | 7abf13c67cdd3de821e09b9b7a4010f05137a835 /lisp/diff.el | |
| parent | a30b83a501c72ef1e58efb106c957f9ffd2d82bd (diff) | |
| download | emacs-4cb4ed4111d8ee2b22665015414b7fbc8392f05a.tar.gz emacs-4cb4ed4111d8ee2b22665015414b7fbc8392f05a.zip | |
(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.el | 25 |
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 @@ | |||
| 1 | ;;; diff.el --- Run `diff' in compilation-mode. | 1 | ;;; diff.el --- Run `diff' in compilation-mode. |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1992, 1994 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1992, 1994, 1996 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Keywords: unix, tools | 5 | ;; Keywords: unix, tools |
| 6 | 6 | ||
| @@ -41,7 +41,7 @@ | |||
| 41 | '( | 41 | '( |
| 42 | ;; -u format: @@ -OLDSTART,OLDEND +NEWSTART,NEWEND @@ | 42 | ;; -u format: @@ -OLDSTART,OLDEND +NEWSTART,NEWEND @@ |
| 43 | ("^@@ -\\([0-9]+\\),[0-9]+ \\+\\([0-9]+\\),[0-9]+ @@$" 1 2) | 43 | ("^@@ -\\([0-9]+\\),[0-9]+ \\+\\([0-9]+\\),[0-9]+ @@$" 1 2) |
| 44 | 44 | ||
| 45 | ;; -c format: *** OLDSTART,OLDEND **** | 45 | ;; -c format: *** OLDSTART,OLDEND **** |
| 46 | ("^\\*\\*\\* \\([0-9]+\\),[0-9]+ \\*\\*\\*\\*$" 1 nil) | 46 | ("^\\*\\*\\* \\([0-9]+\\),[0-9]+ \\*\\*\\*\\*$" 1 nil) |
| 47 | ;; --- NEWSTART,NEWEND ---- | 47 | ;; --- NEWSTART,NEWEND ---- |
| @@ -57,7 +57,7 @@ | |||
| 57 | ;; -n format: {a,d,c}OLDSTART LINES-CHANGED | 57 | ;; -n format: {a,d,c}OLDSTART LINES-CHANGED |
| 58 | ("^[adc]\\([0-9]+\\)\\( [0-9]+\\)?$" 1) | 58 | ("^[adc]\\([0-9]+\\)\\( [0-9]+\\)?$" 1) |
| 59 | ) | 59 | ) |
| 60 | "Alist (REGEXP OLD-IDX NEW-IDX) of regular expressions to match difference | 60 | "Alist (REGEXP OLD-IDX NEW-IDX) of regular expressions to match difference |
| 61 | sections in \\[diff] output. If REGEXP matches, the OLD-IDX'th | 61 | sections in \\[diff] output. If REGEXP matches, the OLD-IDX'th |
| 62 | subexpression gives the line number in the old file, and NEW-IDX'th | 62 | subexpression gives the line number in the old file, and NEW-IDX'th |
| 63 | subexpression gives the line number in the new file. If OLD-IDX or NEW-IDX | 63 | 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." | |||
| 223 | ;; Avoid frightening people with "abnormally terminated" | 223 | ;; Avoid frightening people with "abnormally terminated" |
| 224 | ;; if diff finds differences. | 224 | ;; if diff finds differences. |
| 225 | (set (make-local-variable 'compilation-exit-message-function) | 225 | (set (make-local-variable 'compilation-exit-message-function) |
| 226 | (lambda (proc msg) | 226 | (lambda (status code msg) |
| 227 | (let ((code (process-exit-status proc))) | 227 | (cond ((not (eq status 'exit)) |
| 228 | (if (eq (process-status proc) 'exit) | 228 | (cons msg code)) |
| 229 | (cond ((zerop code) | 229 | ((zerop code) |
| 230 | '("finished (no differences)\n" . "finished")) | 230 | '("finished (no differences)\n" . "no differences")) |
| 231 | ((= code 1) | 231 | ((= code 1) |
| 232 | '("finished\n" . "finished")) | 232 | '("finished\n" . "differences found")) |
| 233 | (t | 233 | (t |
| 234 | (cons msg code))) | 234 | (cons msg code))))) |
| 235 | (cons msg code))))) | ||
| 236 | (set (make-local-variable 'diff-old-file) old) | 235 | (set (make-local-variable 'diff-old-file) old) |
| 237 | (set (make-local-variable 'diff-new-file) new) | 236 | (set (make-local-variable 'diff-new-file) new) |
| 238 | (set (make-local-variable 'diff-old-temp-file) old-alt) | 237 | (set (make-local-variable 'diff-old-temp-file) old-alt) |