comparison lisp/diff.el @ 1215:92554bb95d51

(diff): Don't print echo area message. (diff-parse-differences): Always add `done' to message, at end. New local num-loci-found counts the loci.
author Richard M. Stallman <rms@gnu.org>
date Sat, 26 Sep 1992 21:00:17 +0000
parents 7961d1af11a7
children 2c7997f249eb
comparison
equal deleted inserted replaced
1214:467833df795b 1215:92554bb95d51
111 (goto-line line) 111 (goto-line line)
112 (point-marker))))) 112 (point-marker)))))
113 compilation-error-list))))) 113 compilation-error-list)))))
114 114
115 (found-desired nil) 115 (found-desired nil)
116 (num-loci-found 0)
116 g) 117 g)
117 118
118 (while (and (not found-desired) 119 (while (and (not found-desired)
119 ;; We don't just pass LIMIT-SEARCH to re-search-forward 120 ;; We don't just pass LIMIT-SEARCH to re-search-forward
120 ;; because we want to find matches containing LIMIT-SEARCH 121 ;; because we want to find matches containing LIMIT-SEARCH
130 (if (nth 1 g) ;OLD-IDX 131 (if (nth 1 g) ;OLD-IDX
131 (funcall new-error diff-old-file (nth 1 g))) 132 (funcall new-error diff-old-file (nth 1 g)))
132 (if (nth 2 g) ;NEW-IDX 133 (if (nth 2 g) ;NEW-IDX
133 (funcall new-error diff-new-file (nth 2 g))) 134 (funcall new-error diff-new-file (nth 2 g)))
134 135
136 (setq num-loci-found (1+ num-loci-found))
135 (if (or (and find-at-least 137 (if (or (and find-at-least
136 (>= compilation-num-errors-found find-at-least)) 138 (>= num-loci-found find-at-least))
137 (and limit-search (>= (point) limit-search))) 139 (and limit-search (>= (point) limit-search)))
138 ;; We have found as many new errors as the user wants, 140 ;; We have found as many new loci as the user wants,
139 ;; or the user wanted a specific diff, and we're past it. 141 ;; or the user wanted a specific diff, and we're past it.
140 (setq found-desired t))) 142 (setq found-desired t)))
141 (if found-desired 143 (if found-desired
142 (setq compilation-parsing-end (point)) 144 (setq compilation-parsing-end (point))
143 ;; Set to point-max, not point, so we don't perpetually 145 ;; Set to point-max, not point, so we don't perpetually
144 ;; parse the last bit of text when it isn't a diff header. 146 ;; parse the last bit of text when it isn't a diff header.
145 (setq compilation-parsing-end (point-max)) 147 (setq compilation-parsing-end (point-max)))
146 (message "Parsing differences...done"))) 148 (message "Parsing differences...done"))
147 (setq compilation-error-list (nreverse compilation-error-list))) 149 (setq compilation-error-list (nreverse compilation-error-list)))
148 150
149 ;;;###autoload 151 ;;;###autoload
150 (defun diff (old new &optional switches) 152 (defun diff (old new &optional switches)
151 "Find and display the differences between OLD and NEW files. 153 "Find and display the differences between OLD and NEW files.
176 (list (read-string "Diff switches: " 178 (list (read-string "Diff switches: "
177 (if (stringp diff-switches) 179 (if (stringp diff-switches)
178 diff-switches 180 diff-switches
179 (mapconcat 'identity diff-switches " ")))) 181 (mapconcat 'identity diff-switches " "))))
180 nil))) 182 nil)))
181 (message "Comparing files %s %s..." new old)
182 (setq new (expand-file-name new) 183 (setq new (expand-file-name new)
183 old (expand-file-name old)) 184 old (expand-file-name old))
184 (let ((old-alt (file-local-copy old)) 185 (let ((old-alt (file-local-copy old))
185 (new-alt (file-local-copy new)) 186 (new-alt (file-local-copy new))
186 buf) 187 buf)