comparison lisp/simple.el @ 56861:2e59d9187762

(next-error, previous-error, first-error) (next-error-no-select, previous-error-no-select): Make arguments optional.
author Juri Linkov <juri@jurta.org>
date Wed, 01 Sep 2004 16:19:04 +0000
parents 486136b7f89c
children adba247afe3f
comparison
equal deleted inserted replaced
56860:30b5897d908f 56861:2e59d9187762
133 (if other-buffer 133 (if other-buffer
134 (message "This is the only next-error capable buffer.")) 134 (message "This is the only next-error capable buffer."))
135 (current-buffer))) 135 (current-buffer)))
136 (error "No next-error capable buffer found")))))))) 136 (error "No next-error capable buffer found"))))))))
137 137
138 (defun next-error (arg &optional reset) 138 (defun next-error (&optional arg reset)
139 "Visit next next-error message and corresponding source code. 139 "Visit next next-error message and corresponding source code.
140 140
141 If all the error messages parsed so far have been processed already, 141 If all the error messages parsed so far have been processed already,
142 the message buffer is checked for new ones. 142 the message buffer is checked for new ones.
143 143
173 (defalias 'goto-next-locus 'next-error) 173 (defalias 'goto-next-locus 'next-error)
174 (defalias 'next-match 'next-error) 174 (defalias 'next-match 'next-error)
175 175
176 (define-key ctl-x-map "`" 'next-error) 176 (define-key ctl-x-map "`" 'next-error)
177 177
178 (defun previous-error (n) 178 (defun previous-error (&optional n)
179 "Visit previous next-error message and corresponding source code. 179 "Visit previous next-error message and corresponding source code.
180 180
181 Prefix arg N says how many error messages to move backwards (or 181 Prefix arg N says how many error messages to move backwards (or
182 forwards, if negative). 182 forwards, if negative).
183 183
184 This operates on the output from the \\[compile] and \\[grep] commands." 184 This operates on the output from the \\[compile] and \\[grep] commands."
185 (interactive "p") 185 (interactive "p")
186 (next-error (- n))) 186 (next-error (- (or n 1))))
187 187
188 (defun first-error (n) 188 (defun first-error (&optional n)
189 "Restart at the first error. 189 "Restart at the first error.
190 Visit corresponding source code. 190 Visit corresponding source code.
191 With prefix arg N, visit the source code of the Nth error. 191 With prefix arg N, visit the source code of the Nth error.
192 This operates on the output from the \\[compile] command, for instance." 192 This operates on the output from the \\[compile] command, for instance."
193 (interactive "p") 193 (interactive "p")
194 (next-error n t)) 194 (next-error n t))
195 195
196 (defun next-error-no-select (n) 196 (defun next-error-no-select (&optional n)
197 "Move point to the next error in the next-error buffer and highlight match. 197 "Move point to the next error in the next-error buffer and highlight match.
198 Prefix arg N says how many error messages to move forwards (or 198 Prefix arg N says how many error messages to move forwards (or
199 backwards, if negative). 199 backwards, if negative).
200 Finds and highlights the source line like \\[next-error], but does not 200 Finds and highlights the source line like \\[next-error], but does not
201 select the source buffer." 201 select the source buffer."
202 (interactive "p") 202 (interactive "p")
203 (next-error n) 203 (next-error n)
204 (pop-to-buffer next-error-last-buffer)) 204 (pop-to-buffer next-error-last-buffer))
205 205
206 (defun previous-error-no-select (n) 206 (defun previous-error-no-select (&optional n)
207 "Move point to the previous error in the next-error buffer and highlight match. 207 "Move point to the previous error in the next-error buffer and highlight match.
208 Prefix arg N says how many error messages to move backwards (or 208 Prefix arg N says how many error messages to move backwards (or
209 forwards, if negative). 209 forwards, if negative).
210 Finds and highlights the source line like \\[previous-error], but does not 210 Finds and highlights the source line like \\[previous-error], but does not
211 select the source buffer." 211 select the source buffer."
212 (interactive "p") 212 (interactive "p")
213 (next-error-no-select (- n))) 213 (next-error-no-select (- (or n 1))))
214 214
215 ;;; 215 ;;;
216 216
217 (defun fundamental-mode () 217 (defun fundamental-mode ()
218 "Major mode not specialized for anything in particular. 218 "Major mode not specialized for anything in particular.