0
|
1 ;;; compile.el --- run compiler as inferior of Emacs, parse error messages.
|
|
2
|
2
|
3 ;; Copyright (C) 1985, 86, 87, 93, 94, 1995, 1996 Free Software Foundation, Inc.
|
0
|
4 ;; Copyright (C) 1995 Tinker Systems and INS Engineering Corp.
|
|
5
|
|
6 ;; Author: Roland McGrath <roland@prep.ai.mit.edu>
|
|
7 ;; Maintainer: FSF
|
|
8 ;; Keywords: tools, processes
|
|
9
|
|
10 ;; This file is part of XEmacs.
|
|
11
|
|
12 ;; XEmacs is free software; you can redistribute it and/or modify it
|
|
13 ;; under the terms of the GNU General Public License as published by
|
|
14 ;; the Free Software Foundation; either version 2, or (at your option)
|
|
15 ;; any later version.
|
|
16
|
|
17 ;; XEmacs is distributed in the hope that it will be useful, but
|
|
18 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
20 ;; General Public License for more details.
|
|
21
|
|
22 ;; You should have received a copy of the GNU General Public License
|
|
23 ;; along with XEmacs; see the file COPYING. If not, write to the Free
|
2
|
24 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
|
25 ;; 02111-1307, USA.
|
0
|
26
|
2
|
27 ;;; Synched up with: FSF 19.34, with a lot of divergence.
|
0
|
28
|
|
29 ;;; Commentary:
|
|
30
|
|
31 ;; This package provides the compile and grep facilities documented in
|
|
32 ;; the Emacs user's manual.
|
|
33
|
|
34 ;;; Code:
|
|
35
|
|
36 ;;;###autoload
|
|
37 (defvar compilation-mode-hook nil
|
|
38 "*List of hook functions run by `compilation-mode' (see `run-hooks').")
|
|
39
|
|
40 ;;;###autoload
|
|
41 (defvar compilation-window-height nil
|
|
42 "*Number of lines in a compilation window. If nil, use Emacs default.")
|
|
43
|
2
|
44 ;; XEmacs change
|
0
|
45 (defvar compilation-error-list 'invalid ; only valid buffer-local
|
|
46 "List of error message descriptors for visiting erring functions.
|
|
47 Each error descriptor is a cons (or nil). Its car is a marker pointing to
|
|
48 an error message. If its cdr is a marker, it points to the text of the
|
|
49 line the message is about. If its cdr is a cons, it is a list
|
|
50 \(\(DIRECTORY . FILE\) LINE [COLUMN]\). Or its cdr may be nil if that
|
|
51 error is not interesting.
|
|
52
|
|
53 The value may be t instead of a list; this means that the buffer of
|
|
54 error messages should be reparsed the next time the list of errors is wanted.
|
|
55
|
|
56 Some other commands (like `diff') use this list to control the error
|
2
|
57 message tracking facilities; if you change its structure, you should make
|
0
|
58 sure you also change those packages. Perhaps it is better not to change
|
|
59 it at all.")
|
|
60
|
|
61 (defvar compilation-old-error-list nil
|
|
62 "Value of `compilation-error-list' after errors were parsed.")
|
|
63
|
|
64 (defvar compilation-parse-errors-function 'compilation-parse-errors
|
|
65 "Function to call to parse error messages from a compilation.
|
|
66 It takes args LIMIT-SEARCH and FIND-AT-LEAST.
|
|
67 If LIMIT-SEARCH is non-nil, don't bother parsing past that location.
|
|
68 If FIND-AT-LEAST is non-nil, don't bother parsing after finding that
|
|
69 many new errors.
|
|
70 It should read in the source files which have errors and set
|
|
71 `compilation-error-list' to a list with an element for each error message
|
|
72 found. See that variable for more info.")
|
|
73
|
|
74 ;;;###autoload
|
|
75 (defvar compilation-buffer-name-function nil
|
|
76 "Function to compute the name of a compilation buffer.
|
|
77 The function receives one argument, the name of the major mode of the
|
|
78 compilation buffer. It should return a string.
|
|
79 nil means compute the name with `(concat \"*\" (downcase major-mode) \"*\")'.")
|
|
80
|
|
81 ;;;###autoload
|
|
82 (defvar compilation-finish-function nil
|
|
83 "*Function to call when a compilation process finishes.
|
|
84 It is called with two arguments: the compilation buffer, and a string
|
|
85 describing how the process finished.")
|
|
86
|
|
87 (defvar compilation-last-buffer nil
|
|
88 "The most recent compilation buffer.
|
|
89 A buffer becomes most recent when its compilation is started
|
|
90 or when it is used with \\[next-error] or \\[compile-goto-error].")
|
|
91
|
|
92 (defvar compilation-in-progress nil
|
|
93 "List of compilation processes now running.")
|
|
94 (or (assq 'compilation-in-progress minor-mode-alist)
|
|
95 (setq minor-mode-alist (cons '(compilation-in-progress " Compiling")
|
|
96 minor-mode-alist)))
|
|
97
|
2
|
98 ;; XEmacs change
|
0
|
99 (defvar compilation-always-signal-completion nil
|
|
100 "Always give an audible signal upon compilation completion.
|
|
101 By default that signal is only given if the bottom of the compilation
|
|
102 buffer is not visible in its window.")
|
|
103
|
|
104 (defvar compilation-parsing-end nil
|
|
105 "Position of end of buffer when last error messages were parsed.")
|
|
106
|
|
107 (defvar compilation-error-message "No more errors"
|
|
108 "Message to print when no more matches are found.")
|
|
109
|
|
110 (defvar compilation-num-errors-found)
|
|
111
|
116
|
112 (defvar compilation-error-regexp-systems-list 'all
|
|
113 "This is either the symbol `all', or a list of systems for which
|
|
114 compilation error regexps should be included in
|
|
115 `compilation-error-regexp-alist'.
|
|
116
|
|
117 The list of known systems is:
|
|
118 gnu: but of course
|
|
119 lcc: Lucid compilers
|
|
120 ada: Ada compilers
|
|
121 of: Using tool that says line xx of foo.c
|
|
122 comma: Using tool that says \"foo.c\", line 12
|
|
123 4bsd: Using 4bsd
|
|
124 msft: Using microsoft
|
|
125 borland: Using Borland
|
|
126 mips: Using Mips
|
|
127 sgi: Using SGI
|
|
128 cray: Using Cray
|
|
129 ibm: IBM C compilers
|
|
130 aix: the operating system
|
|
131 ultrix: the operating system
|
|
132
|
|
133 See also the variable `compilation-error-regexp-alist-alist'.")
|
|
134
|
|
135 (defun compilation-build-compilation-error-regexp-alist ()
|
|
136 (interactive)
|
|
137 (setq compilation-error-regexp-alist
|
|
138 (apply 'append
|
|
139 (mapcar
|
|
140 '(lambda (elt)
|
|
141 (if (or (not (consp compilation-error-regexp-systems-list))
|
|
142 (and (consp (car elt))
|
|
143 (intersection (car elt)
|
|
144 compilation-error-regexp-systems-list))
|
|
145 (memq (car elt) compilation-error-regexp-systems-list))
|
|
146 (cdr elt)
|
|
147 nil))
|
|
148 compilation-error-regexp-alist-alist))))
|
|
149
|
|
150 (defvar compilation-error-regexp-alist-alist
|
0
|
151 '(
|
|
152 ;; NOTE! See also grep-regexp-alist, below.
|
|
153
|
|
154 ;; 4.3BSD grep, cc, lint pass 1:
|
|
155 ;; /usr/src/foo/foo.c(8): warning: w may be used before set
|
|
156 ;; or GNU utilities:
|
|
157 ;; foo.c:8: error message
|
|
158 ;; or HP-UX 7.0 fc:
|
|
159 ;; foo.f :16 some horrible error message
|
|
160 ;; or GNU utilities with column (GNAT 1.82):
|
|
161 ;; foo.adb:2:1: Unit name does not match file name
|
|
162 ;;
|
|
163 ;; We'll insist that the number be followed by a colon or closing
|
|
164 ;; paren, because otherwise this matches just about anything
|
|
165 ;; containing a number with spaces around it.
|
116
|
166 ((4bsd gnu)
|
88
|
167 ("\
|
2
|
168 \\([a-zA-Z]?:?[^:( \t\n]+\\)[:(][ \t]*\\([0-9]+\\)\\([) \t]\\|\
|
0
|
169 :\\([^0-9\n]\\|\\([0-9]+:\\)\\)\\)" 1 2 5)
|
116
|
170 )
|
0
|
171
|
2
|
172 ;; Microsoft C/C++:
|
|
173 ;; keyboard.c(537) : warning C4005: 'min' : macro redefinition
|
|
174 ;; d:\tmp\test.c(23) : error C2143: syntax error : missing ';' before 'if'
|
116
|
175 (msft
|
88
|
176 ("\\(\\([a-zA-Z]:\\)?[^:( \t\n-]+\\)[:(][ \t]*\\([0-9]+\\)[:) \t]" 1 3)
|
116
|
177 )
|
2
|
178
|
0
|
179 ;; Borland C++:
|
|
180 ;; Error ping.c 15: Unable to open include file 'sys/types.h'
|
|
181 ;; Warning ping.c 68: Call to function 'func' with no prototype
|
116
|
182 (borland
|
88
|
183 ("\\(Error\\|Warning\\) \\([a-zA-Z]?:?[^:( \t\n]+\\)\
|
0
|
184 \\([0-9]+\\)\\([) \t]\\|:[^0-9\n]\\)" 2 3)
|
116
|
185 )
|
0
|
186
|
|
187 ;; 4.3BSD lint pass 2
|
|
188 ;; strcmp: variable # of args. llib-lc(359) :: /usr/src/foo/foo.c(8)
|
116
|
189 (4bsd
|
88
|
190 ("[^\n]*[ \t:]\\([a-zA-Z]?:?[^:( \t\n]+\\)[:(](+[ \t]*\\([0-9]+\\))[:) \t]*$"
|
2
|
191 1 2)
|
116
|
192 )
|
0
|
193
|
|
194 ;; 4.3BSD lint pass 3
|
|
195 ;; bloofle defined( /users/wolfgang/foo.c(4) ), but never used
|
|
196 ;; This used to be
|
2
|
197 ;; ("[ \t(]+\\([a-zA-Z]?:?[^:( \t\n]+\\)[:( \t]+\\([0-9]+\\)[:) \t]+" 1 2)
|
0
|
198 ;; which is regexp Impressionism - it matches almost anything!
|
116
|
199 (4bsd
|
88
|
200 ("[^\n]*([ \t]*\\([a-zA-Z]?:?[^:( \t\n]+\\)[:(][ \t]*\\([0-9]+\\))" 1 2)
|
116
|
201 )
|
2
|
202
|
|
203 ;; MIPS lint pass<n>; looks good for SunPro lint also
|
|
204 ;; TrimMask (255) in solomon.c may be indistinguishable from TrimMasks (93) in solomon.c due to truncation
|
116
|
205 (mips
|
88
|
206 ("[^ \n]+ (\\([0-9]+\\)) in \\([^ \n]+\\)" 2 1)
|
2
|
207 ;; name defined but never used: LinInt in cmap_calc.c(199)
|
88
|
208 ("[^\n]*in \\([^(\n]+\\)(\\([0-9]+\\))$" 1 2)
|
116
|
209 )
|
0
|
210
|
|
211 ;; Ultrix 3.0 f77:
|
|
212 ;; fort: Severe: addstf.f, line 82: Missing operator or delimiter symbol
|
|
213 ;; Some SGI cc version:
|
|
214 ;; cfe: Warning 835: foo.c, line 2: something
|
116
|
215 ((sgi ultrix)
|
88
|
216 ("\\(cfe\\|fort\\): [^:\n]*: \\([^ \n]*\\), line \\([0-9]+\\):" 2 3)
|
116
|
217 )
|
0
|
218 ;; Error on line 3 of t.f: Execution error unclassifiable statement
|
|
219 ;; Unknown who does this:
|
2
|
220 ;; Line 45 of "foo.c": bloofle undefined
|
0
|
221 ;; Absoft FORTRAN 77 Compiler 3.1.3
|
|
222 ;; error on line 19 of fplot.f: spelling error?
|
|
223 ;; warning on line 17 of fplot.f: data type is undefined for variable d
|
116
|
224 (of
|
88
|
225 ("\\(\\|[^\n]* on \\)[Ll]ine[ \t]+\\([0-9]+\\)[ \t]+\
|
2
|
226 of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2)
|
116
|
227 )
|
0
|
228
|
|
229 ;; Apollo cc, 4.3BSD fc:
|
|
230 ;; "foo.f", line 3: Error: syntax error near end of statement
|
|
231 ;; IBM RS6000:
|
|
232 ;; "vvouch.c", line 19.5: 1506-046 (S) Syntax error.
|
|
233 ;; Unknown compiler:
|
|
234 ;; File "foobar.ml", lines 5-8, characters 20-155: blah blah
|
|
235 ;; Microtec mcc68k:
|
|
236 ;; "foo.c", line 32 pos 1; (E) syntax error; unexpected symbol: "lossage"
|
|
237 ;; GNAT (as of July 94):
|
|
238 ;; "foo.adb", line 2(11): warning: file name does not match ...
|
2
|
239 ;; IBM AIX xlc compiler:
|
|
240 ;; "src/swapping.c", line 30.34: 1506-342 (W) "/*" detected in comment.
|
116
|
241 (comma
|
88
|
242 ("[^\n]*\"\\([^,\" \n\t]+\\)\", lines? \
|
2
|
243 \\([0-9]+\\)\\([\(.]\\([0-9]+\\)\)?\\)?[:., (-]" 1 2 4)
|
116
|
244 )
|
0
|
245
|
|
246 ;; MIPS RISC CC - the one distributed with Ultrix:
|
|
247 ;; ccom: Error: foo.c, line 2: syntax error
|
|
248 ;; DEC AXP OSF/1 cc
|
|
249 ;; /usr/lib/cmplrs/cc/cfe: Error: foo.c: 1: blah blah
|
116
|
250 ((mips ultrix)
|
88
|
251 ("[^\n]*rror: \\([^,\" \n\t]+\\)[,:] \\(line \\)?\\([0-9]+\\):" 1 3)
|
116
|
252 )
|
0
|
253
|
|
254 ;; IBM AIX PS/2 C version 1.1:
|
|
255 ;; ****** Error number 140 in line 8 of file errors.c ******
|
116
|
256 (aix
|
88
|
257 ("[^\n]*in line \\([0-9]+\\) of file \\([^ \n]+[^. \n]\\)\\.? " 2 1)
|
116
|
258 )
|
0
|
259 ;; IBM AIX lint is too painful to do right this way. File name
|
|
260 ;; prefixes entire sections rather than being on each line.
|
|
261
|
|
262 ;; Lucid Compiler, lcc 3.x
|
|
263 ;; E, file.cc(35,52) Illegal operation on pointers
|
116
|
264 (lcc
|
88
|
265 ("[EW], \\([^(\n]*\\)(\\([0-9]+\\),[ \t]*\\([0-9]+\\)" 1 2 3)
|
116
|
266 )
|
0
|
267
|
|
268 ;; GNU messages with program name and optional column number.
|
116
|
269 (gnu
|
88
|
270 ("[a-zA-Z]?:?[^0-9 \n\t:]+:[ \t]*\\([^ \n\t:]+\\):\
|
0
|
271 \\([0-9]+\\):\\(\\([0-9]+\\)[: \t]\\)?" 1 2 4)
|
116
|
272 )
|
0
|
273
|
88
|
274 ;; GNU messages with program name and optional column number
|
|
275 ;; and a severity letter after that. nsgmls makes them.
|
116
|
276 (gnu
|
88
|
277 ("[^0-9 \n\t:]+:[ \t]*\\([^ \n\t:]+\\):\
|
|
278 \\([0-9]+\\):\\(\\([0-9]+\\):\\)?[A-Za-z]:" 1 2 4)
|
116
|
279 )
|
88
|
280
|
0
|
281 ;; jwz:
|
|
282 ;; IRIX 5.2
|
|
283 ;; cfe: Warning 712: foo.c, line 2: illegal combination of pointer and ...
|
116
|
284 (sgi
|
88
|
285 ("[^\n]* \\([^ \n,\"]+\\), line \\([0-9]+\\):" 1 2)
|
116
|
286 )
|
0
|
287 ;; IRIX 5.2
|
|
288 ;; cfe: Warning 600: xfe.c: 170: Not in a conditional directive while ...
|
116
|
289 (sgi
|
88
|
290 ("[^\n]*: \\([^ \n,\"]+\\): \\([0-9]+\\):" 1 2)
|
116
|
291 )
|
0
|
292
|
|
293 ;; Cray C compiler error messages
|
116
|
294 (cray
|
88
|
295 ("\\(cc\\| cft\\)-[0-9]+ c\\(c\\|f77\\): ERROR \\([^,\n]+, \\)* File = \\([^,\n]+\\), Line = \\([0-9]+\\)" 4 5)
|
116
|
296 )
|
0
|
297
|
|
298 ;; IBM C/C++ Tools 2.01:
|
|
299 ;; foo.c(2:0) : informational EDC0804: Function foo is not referenced.
|
|
300 ;; foo.c(3:8) : warning EDC0833: Implicit return statement encountered.
|
|
301 ;; foo.c(5:5) : error EDC0350: Syntax error.
|
116
|
302 (ibm
|
88
|
303 ("\\([^( \n\t]+\\)(\\([0-9]+\\):\\([0-9]+\\)) : " 1 2 3)
|
116
|
304 )
|
0
|
305
|
|
306 ;; Sun ada (VADS, Solaris):
|
|
307 ;; /home3/xdhar/rcds_rc/main.a, line 361, char 6:syntax error: "," inserted
|
116
|
308 (ada
|
88
|
309 ("\\([^, \n\t]+\\), line \\([0-9]+\\), char \\([0-9]+\\)[:., \(-]" 1 2 3)
|
0
|
310 )
|
116
|
311 )
|
|
312 "Alist of (system regexp-alist) for building
|
|
313 `compilation-error-regexp-alist'. SYSTEM is either a system identifier,
|
|
314 or a list of system identifiers. See the variable
|
|
315 `compilation-error-regexp-systems-list'")
|
|
316
|
|
317 (defvar compilation-error-regexp-alist nil
|
88
|
318 "Alist that specifies how to match errors in compiler output.
|
0
|
319 Each elt has the form (REGEXP FILE-IDX LINE-IDX [COLUMN-IDX FILE-FORMAT...])
|
88
|
320 If REGEXP matches constrained to the beginning of the line, the
|
|
321 FILE-IDX'th subexpression gives the file name, and the LINE-IDX'th
|
|
322 subexpression gives the line number. If COLUMN-IDX is given, the
|
|
323 COLUMN-IDX'th subexpression gives the column number on that line. If
|
|
324 any FILE-FORMAT is given, each is a format string to produce a file name
|
|
325 to try; %s in the string is replaced by the text matching the
|
|
326 FILE-IDX'th subexpression. Note previously REGEXP was not constrained
|
|
327 to the beginning of the line, so old patterns without leading `^' or `\\n'
|
116
|
328 may now require a leading `.*'.
|
|
329
|
|
330 Note that this now gets set by the function
|
|
331 `compilation-build-compilation-error-regexp-alist' using the
|
|
332 value of the variable `compilation-error-regexp-alist-alist'")
|
|
333
|
|
334 (compilation-build-compilation-error-regexp-alist)
|
0
|
335
|
|
336 (defvar compilation-read-command t
|
|
337 "If not nil, M-x compile reads the compilation command to use.
|
|
338 Otherwise, M-x compile just uses the value of `compile-command'.")
|
|
339
|
|
340 (defvar compilation-ask-about-save t
|
|
341 "If not nil, M-x compile asks which buffers to save before compiling.
|
|
342 Otherwise, it saves all modified buffers without asking.")
|
|
343
|
|
344 (defvar grep-regexp-alist
|
2
|
345 '(("^\\([a-zA-Z]?:?[^:( \t\n]+\\)[:( \t]+\\([0-9]+\\)[:) \t]" 1 2))
|
0
|
346 "Regexp used to match grep hits. See `compilation-error-regexp-alist'.")
|
|
347
|
|
348 (defvar grep-command "grep -n "
|
|
349 "Last grep command used in \\[grep]; default for next grep.")
|
|
350
|
|
351 ;;;###autoload
|
|
352 (defvar compilation-search-path '(nil)
|
|
353 "*List of directories to search for source files named in error messages.
|
|
354 Elements should be directory names, not file names of directories.
|
|
355 nil as an element means to try the default directory.")
|
|
356
|
|
357 (defvar compile-command "make -k "
|
|
358 "Last shell command used to do a compilation; default for next compilation.
|
|
359
|
|
360 Sometimes it is useful for files to supply local values for this variable.
|
|
361 You might also use mode hooks to specify it in certain modes, like this:
|
|
362
|
|
363 (setq c-mode-hook
|
|
364 '(lambda () (or (file-exists-p \"makefile\") (file-exists-p \"Makefile\")
|
|
365 (progn (make-local-variable 'compile-command)
|
|
366 (setq compile-command
|
|
367 (concat \"make -k \"
|
|
368 buffer-file-name))))))")
|
|
369
|
|
370 (defvar compilation-enter-directory-regexp
|
88
|
371 "[^\n]*: Entering directory `\\([^\n]*\\)'$"
|
0
|
372 "Regular expression matching lines that indicate a new current directory.
|
|
373 This must contain one \\(, \\) pair around the directory name.
|
|
374
|
|
375 The default value matches lines printed by the `-w' option of GNU Make.")
|
|
376
|
|
377 (defvar compilation-leave-directory-regexp
|
88
|
378 "[^\n]*: Leaving directory `\\([^\n]*\\)'$"
|
0
|
379 "Regular expression matching lines that indicate restoring current directory.
|
|
380 This may contain one \\(, \\) pair around the name of the directory
|
|
381 being moved from. If it does not, the last directory entered \(by a
|
|
382 line matching `compilation-enter-directory-regexp'\) is assumed.
|
|
383
|
|
384 The default value matches lines printed by the `-w' option of GNU Make.")
|
|
385
|
|
386 (defvar compilation-directory-stack nil
|
|
387 "Stack of previous directories for `compilation-leave-directory-regexp'.
|
|
388 The head element is the directory the compilation was started in.")
|
|
389
|
|
390 (defvar compilation-exit-message-function nil "\
|
|
391 If non-nil, called when a compilation process dies to return a status message.
|
2
|
392 This should be a function of three arguments: process status, exit status,
|
|
393 and exit message; it returns a cons (MESSAGE . MODELINE) of the strings to
|
|
394 write into the compilation buffer, and to put in its mode line.")
|
0
|
395
|
|
396 ;; History of compile commands.
|
|
397 (defvar compile-history nil)
|
|
398 ;; History of grep commands.
|
|
399 (defvar grep-history nil)
|
|
400
|
2
|
401 ;; XEmacs
|
74
|
402 (defvar compilation-font-lock-keywords (purecopy
|
0
|
403 (list
|
|
404 '("^[-_.\"A-Za-z0-9/+]+\\(:\\|, line \\)[0-9]+: \\([wW]arning:\\).*$" .
|
|
405 font-lock-keyword-face)
|
|
406 '("^[-_.\"A-Za-z0-9/+]+\\(: *\\|, line \\)[0-9]+:.*$" . font-lock-function-name-face)
|
|
407 '("^[^:\n]+-[a-zA-Z][^:\n]+$" . font-lock-doc-string-face)
|
|
408 '("\\(^[-_.\"A-Za-z0-9/+]+\\)\\(: *\\|, line \\)[0-9]+" 1 font-lock-string-face t)
|
|
409 '("^[-_.\"A-Za-z0-9/+]+\\(: *[0-9]+\\|, line [0-9]+\\)" 1 bold t)
|
|
410 ))
|
|
411 "Additional expressions to highlight in Compilation mode.")
|
|
412
|
|
413 ;FSF's version. Ours looks better.
|
2
|
414 ;(defvar compilation-mode-font-lock-keywords
|
0
|
415 ; ;; This regexp needs a bit of rewriting. What is the third grouping for?
|
2
|
416 ; '(("^\\([a-zA-Z]?:?[^ \n:]*:\\([0-9]+:\\)+\\)\\(.*\\)$"
|
|
417 ; 1 font-lock-function-name-face))
|
|
418 ;;; ("^\\([^\n:]*:\\([0-9]+:\\)+\\)\\(.*\\)$" 0 font-lock-keyword-face keep)
|
|
419
|
|
420 ;; XEmacs change
|
0
|
421 (put 'compilation-mode 'font-lock-defaults
|
|
422 '(compilation-font-lock-keywords t))
|
|
423
|
116
|
424 (defvar compilation-mouse-motion-initiate-parsing t
|
|
425 "When set to a non-nil value, mouse motion over the compilation/grep output
|
|
426 buffer may initiate parsing of the error messages or grep hits")
|
|
427
|
0
|
428
|
|
429 ;;;###autoload
|
|
430 (defun compile (command)
|
|
431 "Compile the program including the current buffer. Default: run `make'.
|
|
432 Runs COMMAND, a shell command, in a separate process asynchronously
|
|
433 with output going to the buffer `*compilation*'.
|
|
434
|
|
435 You can then use the command \\[next-error] to find the next error message
|
|
436 and move to the source code that caused it.
|
|
437
|
|
438 Interactively, prompts for the command if `compilation-read-command' is
|
|
439 non-nil; otherwise uses `compile-command'. With prefix arg, always prompts.
|
|
440
|
|
441 To run more than one compilation at once, start one and rename the
|
|
442 \`*compilation*' buffer to some other name with \\[rename-buffer].
|
|
443 Then start the next one.
|
|
444
|
|
445 The name used for the buffer is actually whatever is returned by
|
|
446 the function in `compilation-buffer-name-function', so you can set that
|
|
447 to a function that generates a unique name."
|
|
448 (interactive
|
|
449 (if (or compilation-read-command current-prefix-arg)
|
2
|
450 ;; XEmacs change
|
0
|
451 (list (read-shell-command "Compile command: "
|
|
452 compile-command
|
|
453 ;; #### minibuffer code should do this
|
|
454 (if (equal (car compile-history)
|
|
455 compile-command)
|
|
456 '(compile-history . 1)
|
|
457 'compile-history)))
|
|
458 (list compile-command)))
|
|
459 (setq compile-command command)
|
|
460 (save-some-buffers (not compilation-ask-about-save) nil)
|
|
461 (compile-internal compile-command "No more errors"))
|
|
462
|
|
463 ;;; run compile with the default command line
|
|
464 (defun recompile ()
|
|
465 "Re-compile the program including the current buffer."
|
|
466 (interactive)
|
|
467 (save-some-buffers (not compilation-ask-about-save) nil)
|
|
468 (compile-internal compile-command "No more errors"))
|
|
469
|
|
470 ;; The system null device. (Should reference NULL_DEVICE from C.)
|
|
471 (defvar grep-null-device "/dev/null" "The system null device.")
|
|
472
|
|
473 ;;;###autoload
|
|
474 (defun grep (command-args)
|
|
475 "Run grep, with user-specified args, and collect output in a buffer.
|
|
476 While grep runs asynchronously, you can use the \\[next-error] command
|
|
477 to find the text that grep hits refer to.
|
|
478
|
|
479 This command uses a special history list for its arguments, so you can
|
|
480 easily repeat a grep command."
|
|
481 (interactive
|
2
|
482 ;; XEmacs change
|
0
|
483 (list (read-shell-command "Run grep (like this): "
|
|
484 grep-command 'grep-history)))
|
|
485 (let ((buf (compile-internal (concat command-args " " grep-null-device)
|
|
486 "No more grep hits" "grep"
|
|
487 ;; Give it a simpler regexp to match.
|
|
488 nil grep-regexp-alist)))
|
|
489 (save-excursion
|
|
490 (set-buffer buf)
|
|
491 (set (make-local-variable 'compilation-exit-message-function)
|
2
|
492 ;; XEmacs change
|
0
|
493 (lambda (proc msg)
|
|
494 (let ((code (process-exit-status proc)))
|
|
495 (if (eq (process-status proc) 'exit)
|
|
496 (cond ((zerop code)
|
|
497 '("finished (matches found)\n" . "matched"))
|
|
498 ((= code 1)
|
|
499 '("finished with no matches found\n" . "no match"))
|
|
500 (t
|
|
501 (cons msg code)))
|
|
502 (cons msg code))))))))
|
|
503
|
|
504 (defun compile-internal (command error-message
|
|
505 &optional name-of-mode parser regexp-alist
|
|
506 name-function)
|
|
507 "Run compilation command COMMAND (low level interface).
|
|
508 ERROR-MESSAGE is a string to print if the user asks to see another error
|
|
509 and there are no more errors. Third argument NAME-OF-MODE is the name
|
|
510 to display as the major mode in the compilation buffer.
|
|
511
|
|
512 Fourth arg PARSER is the error parser function (nil means the default). Fifth
|
|
513 arg REGEXP-ALIST is the error message regexp alist to use (nil means the
|
|
514 default). Sixth arg NAME-FUNCTION is a function called to name the buffer (nil
|
|
515 means the default). The defaults for these variables are the global values of
|
|
516 \`compilation-parse-errors-function', `compilation-error-regexp-alist', and
|
|
517 \`compilation-buffer-name-function', respectively.
|
|
518
|
|
519 Returns the compilation buffer created."
|
|
520 (let (outbuf)
|
|
521 (save-excursion
|
|
522 (or name-of-mode
|
|
523 (setq name-of-mode "Compilation"))
|
|
524 (setq outbuf
|
|
525 (get-buffer-create
|
|
526 (funcall (or name-function compilation-buffer-name-function
|
|
527 (function (lambda (mode)
|
|
528 (concat "*" (downcase mode) "*"))))
|
|
529 name-of-mode)))
|
|
530 (set-buffer outbuf)
|
|
531 (let ((comp-proc (get-buffer-process (current-buffer))))
|
|
532 (if comp-proc
|
|
533 (if (or (not (eq (process-status comp-proc) 'run))
|
|
534 (yes-or-no-p
|
|
535 (format "A %s process is running; kill it? "
|
|
536 name-of-mode)))
|
|
537 (condition-case ()
|
|
538 (progn
|
|
539 (interrupt-process comp-proc)
|
|
540 (sit-for 1)
|
|
541 (delete-process comp-proc))
|
|
542 (error nil))
|
|
543 (error "Cannot have two processes in `%s' at once"
|
|
544 (buffer-name))
|
|
545 )))
|
|
546 ;; In case the compilation buffer is current, make sure we get the global
|
|
547 ;; values of compilation-error-regexp-alist, etc.
|
|
548 (kill-all-local-variables))
|
|
549 (let ((regexp-alist (or regexp-alist compilation-error-regexp-alist))
|
|
550 (parser (or parser compilation-parse-errors-function))
|
|
551 (thisdir default-directory)
|
2
|
552 ;; XEmacs change
|
0
|
553 (buffer-save (current-buffer))
|
|
554 outwin)
|
2
|
555
|
|
556 ;; XEmacs change
|
0
|
557 ;; Pop up the compilation buffer.
|
|
558 (setq outwin (display-buffer outbuf))
|
|
559
|
|
560 (unwind-protect
|
|
561 (progn
|
|
562 ;; Clear out the compilation buffer and make it writable.
|
|
563 ;; Change its default-directory to the directory where the compilation
|
|
564 ;; will happen, and insert a `cd' command to indicate this.
|
|
565 (set-buffer outbuf)
|
2
|
566
|
0
|
567 (setq buffer-read-only nil)
|
|
568 (buffer-disable-undo (current-buffer))
|
|
569 (erase-buffer)
|
|
570 (buffer-enable-undo (current-buffer))
|
|
571 (setq default-directory thisdir)
|
|
572 (insert "cd " thisdir "\n" command "\n")
|
|
573 (set-buffer-modified-p nil)
|
|
574
|
2
|
575 ;; XEmacs change
|
0
|
576 ;; set it so the window will scroll to show compile output
|
|
577 (save-window-excursion
|
|
578 (select-window outwin)
|
|
579 (goto-char (point-max)))
|
|
580
|
2
|
581 ;; XEmacs change
|
0
|
582 (compilation-mode name-of-mode)
|
|
583 ;; (setq buffer-read-only t) ;;; Non-ergonomic.
|
2
|
584 ;; XEmacs change
|
0
|
585 (set (make-local-variable 'compile-command) command)
|
|
586 (set (make-local-variable 'compilation-parse-errors-function) parser)
|
|
587 (set (make-local-variable 'compilation-error-message) error-message)
|
|
588 (set (make-local-variable 'compilation-error-regexp-alist) regexp-alist)
|
|
589 (setq default-directory thisdir
|
|
590 compilation-directory-stack (list default-directory))
|
|
591 (set-window-start outwin (point-min))
|
|
592 (setq mode-name name-of-mode)
|
2
|
593 ;; XEmacs change
|
0
|
594 ; (or (eq outwin (selected-window))
|
|
595 ; (set-window-point outwin (point-min)))
|
|
596 (compilation-set-window-height outwin)
|
|
597 ;; Start the compilation.
|
|
598 (if (fboundp 'start-process)
|
|
599 (let* ((process-environment (cons "EMACS=t" process-environment))
|
|
600 (proc (start-process-shell-command (downcase mode-name)
|
|
601 outbuf
|
|
602 command)))
|
|
603 (set-process-sentinel proc 'compilation-sentinel)
|
|
604 (set-process-filter proc 'compilation-filter)
|
|
605 (set-marker (process-mark proc) (point) outbuf)
|
|
606 (setq compilation-in-progress
|
|
607 (cons proc compilation-in-progress)))
|
2
|
608 ;; No asynchronous processes available.
|
|
609 (message "Executing `%s'..." command)
|
|
610 ; FSF
|
|
611 ; (setq mode-line-process ":run")
|
|
612 ; (force-mode-line-update)
|
|
613 (sit-for 0) ;; Force redisplay
|
0
|
614 (let ((status (call-process shell-file-name nil outbuf nil "-c"
|
|
615 command))))
|
2
|
616 (message "Executing `%s'...done" command)))
|
0
|
617 (set-buffer buffer-save)))
|
|
618
|
|
619 ;; Make it so the next C-x ` will use this buffer.
|
|
620 (setq compilation-last-buffer outbuf)))
|
|
621
|
|
622 ;; Set the height of WINDOW according to compilation-window-height.
|
|
623 (defun compilation-set-window-height (window)
|
|
624 (and compilation-window-height
|
|
625 (= (window-width window) (frame-width (window-frame window)))
|
|
626 ;; If window is alone in its frame, aside from a minibuffer,
|
|
627 ;; don't change its height.
|
|
628 (not (eq window (frame-root-window (window-frame window))))
|
|
629 ;; This save-excursion prevents us from changing the current buffer,
|
|
630 ;; which might not be the same as the selected window's buffer.
|
|
631 (save-excursion
|
|
632 (let ((w (selected-window)))
|
|
633 (unwind-protect
|
|
634 (progn
|
|
635 (select-window window)
|
|
636 (enlarge-window (- compilation-window-height
|
|
637 (window-height))))
|
|
638 (select-window w))))))
|
|
639
|
|
640 (defvar compilation-minor-mode-map
|
|
641 (let ((map (make-sparse-keymap)))
|
|
642 (set-keymap-name map 'compilation-minor-mode-map)
|
|
643 (define-key map "\C-c\C-c" 'compile-goto-error)
|
|
644 (define-key map "\C-m" 'compile-goto-error)
|
|
645 (define-key map "\C-c\C-k" 'kill-compilation)
|
|
646 (define-key map "\M-n" 'compilation-next-error)
|
|
647 (define-key map "\M-p" 'compilation-previous-error)
|
|
648 (define-key map "\M-{" 'compilation-previous-file)
|
|
649 (define-key map "\M-}" 'compilation-next-file)
|
|
650 map)
|
|
651 "Keymap for `compilation-minor-mode'.")
|
|
652
|
|
653 (defvar compilation-mode-map
|
|
654 (let ((map (make-sparse-keymap)))
|
|
655 (set-keymap-parents map (list compilation-minor-mode-map))
|
|
656 (set-keymap-name map 'compilation-mode-map)
|
|
657 (define-key map " " 'scroll-up)
|
|
658 (define-key map "\^?" 'scroll-down)
|
|
659 (define-key map 'button2 'compile-mouse-goto-error)
|
|
660 map)
|
|
661 "Keymap for compilation log buffers.
|
|
662 `compilation-minor-mode-map' is a parent of this.")
|
|
663
|
|
664 ;;; XEmacs menus
|
|
665
|
|
666 (defun compilation-errors-exist-p (&optional buffer)
|
|
667 "Whether we are in a state where the `next-error' command will work,
|
|
668 that is, whether there exist (or may exist) error targets in the *compile*
|
|
669 or *grep* buffers."
|
|
670 (or buffer
|
|
671 (setq buffer (condition-case nil
|
|
672 (compilation-find-buffer)
|
|
673 (error nil))))
|
|
674 (and buffer
|
|
675 (compilation-buffer-p buffer)
|
|
676 (save-excursion
|
|
677 (set-buffer buffer)
|
|
678 ;; Has errors on the list, or needs to be parsed.
|
|
679 ;; But don't parse it now!
|
|
680 (or (not (null compilation-error-list))
|
|
681 (< compilation-parsing-end (point-max))))))
|
|
682
|
|
683 (defvar Compilation-mode-popup-menu
|
|
684 '("Compilation Mode Commands"
|
|
685 :filter compile-menu-filter
|
|
686 ["Compile..." compile t]
|
|
687 ["Recompile" recompile t]
|
|
688 ["Kill Compilation" kill-compilation (get-buffer-process (current-buffer))]
|
|
689 "---"
|
|
690 ["Goto Error" compile-goto-error (compilation-errors-exist-p)]
|
|
691 ["Next Error" next-error (compilation-errors-exist-p)]
|
|
692 ["Previous Error" previous-error (compilation-errors-exist-p)]
|
|
693 ["First Error" first-error (compilation-errors-exist-p)]
|
|
694 ))
|
|
695
|
|
696 (defvar Compilation-mode-menubar-menu
|
|
697 (cons "Compile" (cdr Compilation-mode-popup-menu)))
|
|
698
|
|
699 (defvar grep-mode-popup-menu
|
|
700 '("Grep Mode Commands"
|
|
701 :filter grep-menu-filter
|
|
702 ["Grep..." grep t]
|
|
703 ["Repeat Grep" recompile t]
|
|
704 ["Kill Grep" kill-compilation (get-buffer-process (current-buffer))]
|
|
705 "---"
|
|
706 ["Goto Match" compile-goto-error (default-value 'compilation-error-list)]
|
|
707 ["Next Match" next-error (default-value 'compilation-error-list)]
|
|
708 ["Previous Match" previous-error (default-value 'compilation-error-list)]
|
|
709 ["First Match" first-error (default-value 'compilation-error-list)]
|
|
710 ))
|
|
711
|
|
712 (defvar grep-mode-menubar-menu
|
|
713 (cons "Grep" (cdr grep-mode-popup-menu)))
|
|
714
|
|
715 (defun compile-menu-filter-1 (menu history-list item-name command-name)
|
|
716 (let ((submenu (mapcar #'(lambda (string)
|
|
717 (vector string
|
|
718 (list command-name string)
|
|
719 t))
|
|
720 history-list))
|
|
721 (existing (assoc item-name menu)))
|
|
722 (if existing
|
|
723 (progn
|
|
724 (setcdr existing submenu)
|
|
725 menu)
|
|
726 (nconc menu (list (cons item-name submenu))))))
|
|
727
|
|
728 (defun compile-menu-filter (menu)
|
|
729 (compile-menu-filter-1 menu compile-history "Compile History" 'compile))
|
|
730
|
|
731 (defun grep-menu-filter (menu)
|
|
732 (compile-menu-filter-1 menu grep-history "Grep History" 'grep))
|
|
733
|
|
734 (defun compilation-mode (&optional name-of-mode)
|
|
735 "Major mode for compilation log buffers.
|
|
736 \\<compilation-mode-map>To visit the source for a line-numbered error,
|
|
737 move point to the error message line and type \\[compile-goto-error],
|
|
738 or click on the line with \\[compile-mouse-goto-error].
|
|
739 There is a menu of commands on \\[compile-popup-menu].
|
|
740 To kill the compilation, type \\[kill-compilation].
|
|
741
|
|
742 Runs `compilation-mode-hook' with `run-hooks' (which see)."
|
|
743 (interactive)
|
|
744 (kill-all-local-variables)
|
|
745 (use-local-map compilation-mode-map)
|
|
746 (setq major-mode 'compilation-mode
|
|
747 mode-name "Compilation")
|
|
748 (compilation-setup)
|
|
749 (font-lock-set-defaults)
|
|
750 (if (not name-of-mode) nil
|
|
751 (let ((sym (intern (concat name-of-mode "-mode-popup-menu"))))
|
|
752 (if (boundp sym)
|
|
753 (setq mode-popup-menu (symbol-value sym))))
|
|
754 (if (featurep 'menubar)
|
|
755 (progn
|
|
756 ;; make a local copy of the menubar, so our modes don't
|
|
757 ;; change the global menubar
|
|
758 (set-buffer-menubar current-menubar)
|
|
759 (let ((sym (intern (concat name-of-mode "-mode-menubar-menu"))))
|
|
760 (if (boundp sym)
|
|
761 (add-submenu nil (symbol-value sym)))))))
|
|
762 (run-hooks 'compilation-mode-hook))
|
|
763
|
|
764 ;; XEmacs addition, hacked by Mly
|
|
765 (defun compilation-mode-motion-hook (event)
|
|
766 (mode-motion-highlight-internal
|
|
767 event
|
|
768 #'beginning-of-line
|
|
769 #'(lambda ()
|
|
770 (let* ((p (point))
|
|
771 (e (progn (end-of-line) (point)))
|
|
772 (l (progn
|
116
|
773 (if (and compilation-mouse-motion-initiate-parsing
|
|
774 (or (eq compilation-error-list 't)
|
|
775 (>= p compilation-parsing-end)))
|
0
|
776 ;; #### Does it suck too badly to have mouse-movement
|
|
777 ;; #### over a buffer parse errors in that buffer??
|
|
778 (save-window-excursion
|
|
779 (compile-reinitialize-errors nil p)))
|
|
780 (if (and compilation-error-list
|
|
781 (<= (car (car compilation-error-list)) p))
|
|
782 ;; Perhaps save time by only searching tail
|
|
783 compilation-error-list
|
|
784 compilation-old-error-list))))
|
|
785 (if (catch 'found
|
|
786 (while l
|
|
787 (let ((x (marker-position (car (car l)))))
|
|
788 (cond ((< x p)
|
|
789 (setq l (cdr l)))
|
|
790 ((<= x e)
|
|
791 (throw 'found t))
|
|
792 (t
|
|
793 (throw 'found nil)))))
|
|
794 nil)
|
|
795 (goto-char e)
|
|
796 (goto-char p))))))
|
|
797
|
|
798 ;; Prepare the buffer for the compilation parsing commands to work.
|
|
799 (defun compilation-setup ()
|
|
800 ;; Make the buffer's mode line show process state.
|
|
801 (setq mode-line-process '(":%s"))
|
|
802 (set (make-local-variable 'compilation-error-list) nil)
|
|
803 (set (make-local-variable 'compilation-old-error-list) nil)
|
|
804 (set (make-local-variable 'compilation-parsing-end) 1)
|
|
805 (set (make-local-variable 'compilation-directory-stack) nil)
|
|
806 (setq compilation-last-buffer (current-buffer))
|
|
807 ;; XEmacs change: highlight lines, install menubar.
|
|
808 (require 'mode-motion)
|
|
809 (setq mode-motion-hook 'compilation-mode-motion-hook)
|
|
810 (make-local-variable 'mouse-track-click-hook)
|
|
811 (add-hook 'mouse-track-click-hook 'compile-mouse-maybe-goto-error)
|
|
812 )
|
|
813
|
|
814 (defvar compilation-minor-mode nil
|
|
815 "Non-nil when in compilation-minor-mode.
|
|
816 In this minor mode, all the error-parsing commands of the
|
|
817 Compilation major mode are available.")
|
|
818 (make-variable-buffer-local 'compilation-minor-mode)
|
|
819
|
|
820 (or (assq 'compilation-minor-mode minor-mode-alist)
|
|
821 (setq minor-mode-alist (cons '(compilation-minor-mode " Compilation")
|
|
822 minor-mode-alist)))
|
|
823 (or (assq 'compilation-minor-mode minor-mode-map-alist)
|
|
824 (setq minor-mode-map-alist (cons (cons 'compilation-minor-mode
|
|
825 compilation-minor-mode-map)
|
|
826 minor-mode-map-alist)))
|
|
827
|
|
828 ;;;###autoload
|
|
829 (defun compilation-minor-mode (&optional arg)
|
|
830 "Toggle compilation minor mode.
|
|
831 With arg, turn compilation mode on if and only if arg is positive.
|
|
832 See `compilation-mode'.
|
|
833 ! \\{compilation-mode-map}"
|
|
834 (interactive "P")
|
|
835 (if (setq compilation-minor-mode (if (null arg)
|
|
836 (null compilation-minor-mode)
|
|
837 (> (prefix-numeric-value arg) 0)))
|
2
|
838 (progn
|
|
839 (compilation-setup)
|
|
840 (run-hooks 'compilation-minor-mode-hook))))
|
|
841
|
|
842 ;; Write msg in the current buffer and hack its mode-line-process.
|
|
843 (defun compilation-handle-exit (process-status exit-status msg)
|
|
844 (let ((buffer-read-only nil)
|
|
845 (status (if compilation-exit-message-function
|
|
846 (funcall compilation-exit-message-function
|
|
847 process-status exit-status msg)
|
|
848 (cons msg exit-status)))
|
|
849 (omax (point-max))
|
|
850 (opoint (point)))
|
|
851 ;; Record where we put the message, so we can ignore it
|
|
852 ;; later on.
|
|
853 (goto-char omax)
|
|
854 (insert ?\n mode-name " " (car status))
|
|
855 (forward-char -1)
|
|
856 (insert " at " (substring (current-time-string) 0 19))
|
|
857 (forward-char 1)
|
|
858 (setq mode-line-process (format ":%s [%s]" process-status (cdr status)))
|
|
859 ;; Force mode line redisplay soon.
|
|
860 (force-mode-line-update)
|
|
861 (if (and opoint (< opoint omax))
|
|
862 (goto-char opoint))
|
|
863 (if compilation-finish-function
|
|
864 (funcall compilation-finish-function (current-buffer) msg))))
|
0
|
865
|
|
866 ;; Called when compilation process changes state.
|
|
867 (defun compilation-sentinel (proc msg)
|
|
868 "Sentinel for compilation buffers."
|
2
|
869 ;; XEmacs change
|
0
|
870 (let* ((buffer (process-buffer proc))
|
|
871 (window (get-buffer-window buffer)))
|
|
872 (if (memq (process-status proc) '(signal exit))
|
|
873 (progn
|
|
874 (if (null (buffer-name buffer))
|
|
875 ;; buffer killed
|
|
876 (set-process-buffer proc nil)
|
|
877 (let ((obuf (current-buffer))
|
|
878 omax opoint estatus)
|
|
879 ;; save-excursion isn't the right thing if
|
|
880 ;; process-buffer is current-buffer
|
|
881 (unwind-protect
|
|
882 (progn
|
|
883 ;; Write something in the compilation buffer
|
|
884 ;; and hack its mode line.
|
|
885 (set-buffer buffer)
|
|
886 (let ((buffer-read-only nil)
|
|
887 (status (if compilation-exit-message-function
|
|
888 (funcall compilation-exit-message-function
|
|
889 proc msg)
|
|
890 (cons msg (process-exit-status proc)))))
|
|
891 (setq omax (point-max)
|
|
892 opoint (point))
|
|
893 (goto-char omax)
|
|
894 ;; Record where we put the message, so we can ignore it
|
|
895 ;; later on.
|
|
896 (insert ?\n mode-name " " (car status))
|
|
897 (forward-char -1)
|
|
898 (insert " at " (substring (current-time-string) 0 19))
|
|
899 (forward-char 1)
|
|
900 (setq mode-line-process
|
|
901 (concat ":"
|
|
902 (symbol-name (process-status proc))
|
|
903 (if (zerop (process-exit-status proc))
|
|
904 " OK"
|
|
905 (setq estatus
|
|
906 (format " [exit-status %d]"
|
|
907 (process-exit-status proc))))
|
|
908 ))
|
|
909 ;; XEmacs - tedium should let you know when it's ended...
|
|
910 (if (and (not compilation-always-signal-completion)
|
|
911 window
|
|
912 (pos-visible-in-window-p (point-max) window))
|
|
913 nil ; assume that the user will see it...
|
|
914 (ding t 'ready)
|
|
915 (message "Compilation process completed%s."
|
|
916 (or estatus " successfully")
|
|
917 ))
|
|
918 ;; Since the buffer and mode line will show that the
|
|
919 ;; process is dead, we can delete it now. Otherwise it
|
|
920 ;; will stay around until M-x list-processes.
|
|
921 (delete-process proc)
|
|
922 ;; Force mode line redisplay soon.
|
|
923 (redraw-modeline))
|
|
924 (if (and opoint (< opoint omax))
|
|
925 (goto-char opoint))
|
|
926 (if compilation-finish-function
|
|
927 (funcall compilation-finish-function buffer msg)))
|
|
928 (set-buffer obuf))))
|
|
929 (setq compilation-in-progress (delq proc compilation-in-progress))
|
|
930 ))))
|
|
931
|
|
932 (defun compilation-filter (proc string)
|
|
933 "Process filter for compilation buffers.
|
|
934 Just inserts the text, but uses `insert-before-markers'."
|
|
935 (if (buffer-name (process-buffer proc))
|
|
936 (save-excursion
|
|
937 (set-buffer (process-buffer proc))
|
|
938 (let ((buffer-read-only nil))
|
|
939 (save-excursion
|
|
940 (goto-char (process-mark proc))
|
|
941 (insert-before-markers string)
|
2
|
942 (run-hooks 'compilation-filter-hook)
|
0
|
943 (set-marker (process-mark proc) (point)))))))
|
|
944
|
|
945 ;; Return the cdr of compilation-old-error-list for the error containing point.
|
|
946 (defun compile-error-at-point ()
|
|
947 (compile-reinitialize-errors nil (point))
|
|
948 (let ((errors compilation-old-error-list))
|
|
949 (while (and errors
|
|
950 (> (point) (car (car errors))))
|
|
951 (setq errors (cdr errors)))
|
|
952 errors))
|
|
953
|
2
|
954 (defsubst compilation-buffer-p (buffer)
|
0
|
955 (save-excursion
|
|
956 (set-buffer buffer)
|
|
957 (or compilation-minor-mode (eq major-mode 'compilation-mode))))
|
|
958
|
|
959 (defun compilation-next-error (n)
|
|
960 "Move point to the next error in the compilation buffer.
|
|
961 Does NOT find the source line like \\[next-error]."
|
|
962 (interactive "p")
|
|
963 (or (compilation-buffer-p (current-buffer))
|
|
964 (error "Not in a compilation buffer."))
|
|
965 (setq compilation-last-buffer (current-buffer))
|
|
966
|
|
967 (let ((errors (compile-error-at-point)))
|
|
968
|
|
969 ;; Move to the error after the one containing point.
|
|
970 (goto-char (car (if (< n 0)
|
|
971 (let ((i 0)
|
|
972 (e compilation-old-error-list))
|
|
973 ;; See how many cdrs away ERRORS is from the start.
|
|
974 (while (not (eq e errors))
|
|
975 (setq i (1+ i)
|
|
976 e (cdr e)))
|
|
977 (if (> (- n) i)
|
|
978 (error "Moved back past first error")
|
|
979 (nth (+ i n) compilation-old-error-list)))
|
|
980 (let ((compilation-error-list (cdr errors)))
|
|
981 (compile-reinitialize-errors nil nil n)
|
|
982 (if compilation-error-list
|
|
983 (nth (1- n) compilation-error-list)
|
|
984 (error "Moved past last error"))))))))
|
|
985
|
|
986 (defun compilation-previous-error (n)
|
|
987 "Move point to the previous error in the compilation buffer.
|
|
988 Does NOT find the source line like \\[next-error]."
|
|
989 (interactive "p")
|
|
990 (compilation-next-error (- n)))
|
|
991
|
|
992
|
|
993 ;; Given an elt of `compilation-error-list', return an object representing
|
|
994 ;; the referenced file which is equal to (but not necessarily eq to) what
|
|
995 ;; this function would return for another error in the same file.
|
|
996 (defsubst compilation-error-filedata (data)
|
|
997 (setq data (cdr data))
|
|
998 (if (markerp data)
|
|
999 (marker-buffer data)
|
|
1000 (car data)))
|
|
1001
|
|
1002 ;; Return a string describing a value from compilation-error-filedata.
|
|
1003 ;; This value is not necessarily useful as a file name, but should be
|
|
1004 ;; indicative to the user of what file's errors are being referred to.
|
|
1005 (defsubst compilation-error-filedata-file-name (filedata)
|
|
1006 (if (bufferp filedata)
|
|
1007 (buffer-file-name filedata)
|
|
1008 (car filedata)))
|
|
1009
|
|
1010 (defun compilation-next-file (n)
|
|
1011 "Move point to the next error for a different file than the current one."
|
|
1012 (interactive "p")
|
|
1013 (or (compilation-buffer-p (current-buffer))
|
|
1014 (error "Not in a compilation buffer."))
|
|
1015 (setq compilation-last-buffer (current-buffer))
|
|
1016
|
|
1017 (let ((reversed (< n 0))
|
|
1018 errors filedata)
|
|
1019
|
|
1020 (if (not reversed)
|
|
1021 (setq errors (or (compile-error-at-point)
|
|
1022 (error "Moved past last error")))
|
|
1023
|
|
1024 ;; Get a reversed list of the errors up through the one containing point.
|
|
1025 (compile-reinitialize-errors nil (point))
|
|
1026 (setq errors (reverse compilation-old-error-list)
|
|
1027 n (- n))
|
|
1028
|
|
1029 ;; Ignore errors after point. (car ERRORS) will be the error
|
|
1030 ;; containing point, (cadr ERRORS) the one before it.
|
|
1031 (while (and errors
|
|
1032 (< (point) (car (car errors))))
|
|
1033 (setq errors (cdr errors))))
|
|
1034
|
|
1035 (while (> n 0)
|
|
1036 (setq filedata (compilation-error-filedata (car errors)))
|
|
1037
|
|
1038 ;; Skip past the following errors for this file.
|
|
1039 (while (equal filedata
|
|
1040 (compilation-error-filedata
|
|
1041 (car (or errors
|
|
1042 (if reversed
|
|
1043 (error "%s the first erring file"
|
|
1044 (compilation-error-filedata-file-name
|
|
1045 filedata))
|
|
1046 (let ((compilation-error-list nil))
|
|
1047 ;; Parse some more.
|
|
1048 (compile-reinitialize-errors nil nil 2)
|
|
1049 (setq errors compilation-error-list)))
|
|
1050 (error "%s is the last erring file"
|
|
1051 (compilation-error-filedata-file-name
|
|
1052 filedata))))))
|
|
1053 (setq errors (cdr errors)))
|
|
1054
|
|
1055 (setq n (1- n)))
|
|
1056
|
|
1057 ;; Move to the following error.
|
|
1058 (goto-char (car (car (or errors
|
|
1059 (if reversed
|
|
1060 (error "This is the first erring file")
|
|
1061 (let ((compilation-error-list nil))
|
|
1062 ;; Parse the last one.
|
|
1063 (compile-reinitialize-errors nil nil 1)
|
|
1064 compilation-error-list))))))))
|
|
1065
|
|
1066 (defun compilation-previous-file (n)
|
|
1067 "Move point to the previous error for a different file than the current one."
|
|
1068 (interactive "p")
|
|
1069 (compilation-next-file (- n)))
|
|
1070
|
|
1071
|
|
1072 (defun kill-compilation ()
|
|
1073 "Kill the process made by the \\[compile] command."
|
|
1074 (interactive)
|
|
1075 (let ((buffer (compilation-find-buffer)))
|
|
1076 (if (get-buffer-process buffer)
|
|
1077 (interrupt-process (get-buffer-process buffer))
|
|
1078 (error "The compilation process is not running."))))
|
|
1079
|
|
1080
|
|
1081 ;; Parse any new errors in the compilation buffer,
|
|
1082 ;; or reparse from the beginning if the user has asked for that.
|
|
1083 (defun compile-reinitialize-errors (reparse
|
|
1084 &optional limit-search find-at-least)
|
|
1085 (save-excursion
|
|
1086 ;; XEmacs change: Below we made a change to possibly change the
|
|
1087 ;; selected window. If we don't save and restore the old window
|
|
1088 ;; then if we get an error such as 'no more errors' we'll end up
|
|
1089 ;; in the compilation buffer.
|
|
1090 (save-window-excursion
|
|
1091 (set-buffer compilation-last-buffer)
|
|
1092 ;; If we are out of errors, or if user says "reparse",
|
|
1093 ;; discard the info we have, to force reparsing.
|
|
1094 (if (or (eq compilation-error-list t)
|
|
1095 reparse)
|
|
1096 (compilation-forget-errors))
|
|
1097 (if (and compilation-error-list
|
|
1098 (or (not limit-search)
|
|
1099 (> compilation-parsing-end limit-search))
|
|
1100 (or (not find-at-least)
|
|
1101 (>= (length compilation-error-list) find-at-least)))
|
|
1102 ;; Since compilation-error-list is non-nil, it points to a specific
|
|
1103 ;; error the user wanted. So don't move it around.
|
|
1104 nil
|
|
1105
|
|
1106 ;; XEmacs change: if the compilation buffer is already visible
|
|
1107 ;; in a window, use that instead of thrashing the display.
|
|
1108 (let ((w (get-buffer-window compilation-last-buffer)))
|
|
1109 (if w
|
|
1110 (select-window w)
|
|
1111 (switch-to-buffer compilation-last-buffer)))
|
|
1112
|
2
|
1113 ;; This was here for a long time (before my rewrite); why? --roland
|
|
1114 ;;(switch-to-buffer compilation-last-buffer)
|
0
|
1115 (set-buffer-modified-p nil)
|
|
1116 (if (< compilation-parsing-end (point-max))
|
|
1117 ;; compilation-error-list might be non-nil if we have a non-nil
|
|
1118 ;; LIMIT-SEARCH or FIND-AT-LEAST arg. In that case its value
|
|
1119 ;; records the current position in the error list, and we must
|
|
1120 ;; preserve that after reparsing.
|
|
1121 (let ((error-list-pos compilation-error-list))
|
|
1122 (funcall compilation-parse-errors-function
|
|
1123 limit-search
|
|
1124 (and find-at-least
|
|
1125 ;; We only need enough new parsed errors to reach
|
|
1126 ;; FIND-AT-LEAST errors past the current
|
|
1127 ;; position.
|
|
1128 (- find-at-least (length compilation-error-list))))
|
|
1129 ;; Remember the entire list for compilation-forget-errors. If
|
|
1130 ;; this is an incremental parse, append to previous list. If
|
|
1131 ;; we are parsing anew, compilation-forget-errors cleared
|
|
1132 ;; compilation-old-error-list above.
|
|
1133 (setq compilation-old-error-list
|
|
1134 (nconc compilation-old-error-list compilation-error-list))
|
|
1135 (if error-list-pos
|
|
1136 ;; We started in the middle of an existing list of parsed
|
|
1137 ;; errors before parsing more; restore that position.
|
|
1138 (setq compilation-error-list error-list-pos))
|
|
1139 ))))))
|
|
1140
|
2
|
1141 ;; XEmacs addition
|
|
1142 ;; FSF has added this by 19.34, but it is highly complex, why? -sb
|
|
1143 (defun compile-mouse-goto-error (event)
|
|
1144 "Visit the source for the error under the mouse.
|
|
1145 Use this command in a compilation log buffer."
|
|
1146 (interactive "e")
|
|
1147 (mouse-set-point event)
|
|
1148 (beginning-of-line)
|
|
1149 (compile-goto-error))
|
|
1150
|
0
|
1151 (defun compile-goto-error (&optional argp)
|
|
1152 "Visit the source for the error message point is on.
|
|
1153 Use this command in a compilation log buffer. Sets the mark at point there.
|
|
1154 \\[universal-argument] as a prefix arg means to reparse the buffer's error messages first;
|
|
1155 other kinds of prefix arguments are ignored."
|
|
1156 (interactive "P")
|
|
1157 (or (compilation-buffer-p (current-buffer))
|
|
1158 (error "Not in a compilation buffer."))
|
|
1159 (setq compilation-last-buffer (current-buffer))
|
|
1160 (compile-reinitialize-errors (consp argp) (point))
|
|
1161
|
|
1162 ;; Move to bol; the marker for the error on this line will point there.
|
|
1163 (beginning-of-line)
|
|
1164
|
|
1165 ;; Move compilation-error-list to the elt of compilation-old-error-list
|
|
1166 ;; we want.
|
|
1167 (setq compilation-error-list compilation-old-error-list)
|
|
1168 (while (and compilation-error-list
|
|
1169 (> (point) (car (car compilation-error-list))))
|
|
1170 (setq compilation-error-list (cdr compilation-error-list)))
|
|
1171
|
|
1172 ;; Move to another window, so that next-error's window changes
|
|
1173 ;; result in the desired setup.
|
|
1174 (or (one-window-p)
|
|
1175 (progn
|
|
1176 (other-window -1)
|
|
1177 ;; other-window changed the selected buffer,
|
|
1178 ;; but we didn't want to do that.
|
|
1179 (set-buffer compilation-last-buffer)))
|
|
1180
|
|
1181 (push-mark)
|
|
1182 (next-error 1))
|
|
1183
|
|
1184 ;; XEmacs addition
|
|
1185 (defun compile-mouse-maybe-goto-error (event &optional click-count)
|
|
1186 (interactive "e")
|
|
1187 (if (equal (event-button event) 2)
|
|
1188 (let ((buffer (current-buffer))
|
|
1189 (point (point))
|
|
1190 (config (current-window-configuration)))
|
|
1191 (condition-case nil
|
|
1192 (progn
|
|
1193 (compile-mouse-goto-error event)
|
|
1194 t)
|
|
1195 (error
|
|
1196 (set-window-configuration config)
|
|
1197 (set-buffer buffer)
|
|
1198 (goto-char point)
|
|
1199 nil)))))
|
|
1200
|
|
1201 ;; Return a compilation buffer.
|
|
1202 ;; If the current buffer is a compilation buffer, return it.
|
|
1203 ;; If compilation-last-buffer is set to a live buffer, use that.
|
|
1204 ;; Otherwise, look for a compilation buffer and signal an error
|
|
1205 ;; if there are none.
|
|
1206 (defun compilation-find-buffer (&optional other-buffer)
|
|
1207 (if (and (not other-buffer)
|
|
1208 (compilation-buffer-p (current-buffer)))
|
|
1209 ;; The current buffer is a compilation buffer.
|
|
1210 (current-buffer)
|
|
1211 (if (and compilation-last-buffer (buffer-name compilation-last-buffer)
|
2
|
1212 (compilation-buffer-p compilation-last-buffer)
|
0
|
1213 (or (not other-buffer) (not (eq compilation-last-buffer
|
|
1214 (current-buffer)))))
|
|
1215 compilation-last-buffer
|
|
1216 (let ((buffers (buffer-list)))
|
|
1217 (while (and buffers (or (not (compilation-buffer-p (car buffers)))
|
|
1218 (and other-buffer
|
|
1219 (eq (car buffers) (current-buffer)))))
|
|
1220 (setq buffers (cdr buffers)))
|
|
1221 (if buffers
|
|
1222 (car buffers)
|
|
1223 (or (and other-buffer
|
|
1224 (compilation-buffer-p (current-buffer))
|
|
1225 ;; The current buffer is a compilation buffer.
|
|
1226 (progn
|
|
1227 (if other-buffer
|
|
1228 (message "This is the only compilation buffer."))
|
|
1229 (current-buffer)))
|
|
1230 (error "No compilation started!")))))))
|
|
1231
|
|
1232 ;;;###autoload
|
|
1233 (defun next-error (&optional argp)
|
|
1234 "Visit next compilation error message and corresponding source code.
|
|
1235 This operates on the output from the \\[compile] command.
|
|
1236 If all preparsed error messages have been processed,
|
|
1237 the error message buffer is checked for new ones.
|
|
1238
|
|
1239 A prefix arg specifies how many error messages to move;
|
|
1240 negative means move back to previous error messages.
|
|
1241 Just C-u as a prefix means reparse the error message buffer
|
|
1242 and start at the first error.
|
|
1243
|
|
1244 \\[next-error] normally applies to the most recent compilation started,
|
|
1245 but as long as you are in the middle of parsing errors from one compilation
|
|
1246 output buffer, you stay with that compilation output buffer.
|
|
1247
|
|
1248 Use \\[next-error] in a compilation output buffer to switch to
|
|
1249 processing errors from that compilation.
|
|
1250
|
|
1251 See variables `compilation-parse-errors-function' and
|
|
1252 \`compilation-error-regexp-alist' for customization ideas."
|
|
1253 (interactive "P")
|
|
1254 (setq compilation-last-buffer (compilation-find-buffer))
|
|
1255 (compilation-goto-locus (compilation-next-error-locus
|
|
1256 ;; We want to pass a number here only if
|
|
1257 ;; we got a numeric prefix arg, not just C-u.
|
|
1258 (and (not (consp argp))
|
|
1259 (prefix-numeric-value argp))
|
|
1260 (consp argp))))
|
2
|
1261 ;;;###autoload (define-key ctl-x-map "`" 'next-error)
|
0
|
1262
|
|
1263 ;; XEmacs change
|
|
1264 ;;;###autoload
|
|
1265 (defun previous-error (&optional argp)
|
|
1266 "Visit previous compilation error message and corresponding source code.
|
|
1267 This operates on the output from the \\[compile] command."
|
|
1268 (interactive "P")
|
|
1269 (next-error (cond ((null argp) -1)
|
|
1270 ((numberp argp) (- argp))
|
|
1271 (t argp))))
|
|
1272
|
|
1273 ;;;###autoload
|
|
1274 (defun first-error ()
|
|
1275 "Reparse the error message buffer and start at the first error
|
|
1276 Visit corresponding source code.
|
|
1277 This operates on the output from the \\[compile] command."
|
|
1278 (interactive)
|
|
1279 (next-error '(4)))
|
|
1280
|
|
1281 (defun compilation-next-error-locus (&optional move reparse silent)
|
|
1282 "Visit next compilation error and return locus in corresponding source code.
|
|
1283 This operates on the output from the \\[compile] command.
|
|
1284 If all preparsed error messages have been processed,
|
|
1285 the error message buffer is checked for new ones.
|
|
1286
|
|
1287 Returns a cons (ERROR . SOURCE) of two markers: ERROR is a marker at the
|
|
1288 location of the error message in the compilation buffer, and SOURCE is a
|
|
1289 marker at the location in the source code indicated by the error message.
|
|
1290
|
|
1291 Optional first arg MOVE says how many error messages to move forwards (or
|
|
1292 backwards, if negative); default is 1. Optional second arg REPARSE, if
|
|
1293 non-nil, says to reparse the error message buffer and reset to the first
|
|
1294 error (plus MOVE - 1). If optional third argument SILENT is non-nil, return
|
|
1295 nil instead of raising an error if there are no more errors.
|
|
1296
|
|
1297 The current buffer should be the desired compilation output buffer."
|
|
1298 (or move (setq move 1))
|
|
1299 (compile-reinitialize-errors reparse nil (and (not reparse)
|
|
1300 (if (< move 1) 0 (1- move))))
|
|
1301 (let (next-errors next-error)
|
|
1302 (catch 'no-next-error
|
|
1303 (save-excursion
|
|
1304 (set-buffer compilation-last-buffer)
|
|
1305 ;; compilation-error-list points to the "current" error.
|
|
1306 (setq next-errors
|
|
1307 (if (> move 0)
|
|
1308 (nthcdr (1- move)
|
|
1309 compilation-error-list)
|
|
1310 ;; Zero or negative arg; we need to move back in the list.
|
|
1311 (let ((n (1- move))
|
|
1312 (i 0)
|
|
1313 (e compilation-old-error-list))
|
|
1314 ;; See how many cdrs away the current error is from the start.
|
|
1315 (while (not (eq e compilation-error-list))
|
|
1316 (setq i (1+ i)
|
|
1317 e (cdr e)))
|
|
1318 (if (> (- n) i)
|
|
1319 (error "Moved back past first error")
|
|
1320 (nthcdr (+ i n) compilation-old-error-list))))
|
|
1321 next-error (car next-errors))
|
|
1322 (while
|
|
1323 (if (null next-error)
|
|
1324 (progn
|
|
1325 (and move (/= move 1)
|
|
1326 (error (if (> move 0)
|
|
1327 "Moved past last error"
|
|
1328 "Moved back past first error")))
|
|
1329 ;; Forget existing error messages if compilation has finished.
|
|
1330 ;;; XEmacs change by Barry Warsaw.
|
|
1331 ;;; Without this, if you get a "no more errors" error, then you can't do
|
|
1332 ;;; previous-error or goto-error until you kill the buffer.
|
|
1333 ; (if (not (and (get-buffer-process (current-buffer))
|
|
1334 ; (eq (process-status
|
|
1335 ; (get-buffer-process
|
|
1336 ; (current-buffer)))
|
|
1337 ; 'run)))
|
|
1338 ; (compilation-forget-errors))
|
|
1339 (if silent
|
|
1340 (throw 'no-next-error nil)
|
|
1341 (error (concat compilation-error-message
|
|
1342 (and (get-buffer-process (current-buffer))
|
2
|
1343 (eq (process-status
|
|
1344 (get-buffer-process
|
0
|
1345 (current-buffer)))
|
|
1346 'run)
|
|
1347 " yet")))))
|
|
1348 (setq compilation-error-list (cdr next-errors))
|
|
1349 (if (null (cdr next-error))
|
|
1350 ;; This error is boring. Go to the next.
|
|
1351 t
|
|
1352 (or (markerp (cdr next-error))
|
|
1353 ;; This error has a filename/lineno pair.
|
|
1354 ;; Find the file and turn it into a marker.
|
|
1355 (let* ((fileinfo (car (cdr next-error)))
|
|
1356 (cbuf (current-buffer)) ;XEmacs addition
|
|
1357 (buffer (apply 'compilation-find-file
|
|
1358 (car next-error) fileinfo)))
|
|
1359 (if (null buffer)
|
|
1360 ;; We can't find this error's file.
|
|
1361 ;; Remove all errors in the same file.
|
|
1362 (progn
|
|
1363 (setq next-errors compilation-old-error-list)
|
|
1364 (while next-errors
|
|
1365 (and (consp (cdr (car next-errors)))
|
|
1366 (equal (car (cdr (car next-errors)))
|
|
1367 fileinfo)
|
|
1368 (progn
|
|
1369 (set-marker (car (car next-errors)) nil)
|
|
1370 (setcdr (car next-errors) nil)))
|
|
1371 (setq next-errors (cdr next-errors)))
|
|
1372 ;; Look for the next error.
|
|
1373 t)
|
|
1374 ;; We found the file. Get a marker for this error.
|
|
1375 ;; compilation-old-error-list is a buffer-local
|
|
1376 ;; variable, so we must be careful to extract its value
|
|
1377 ;; before switching to the source file buffer.
|
|
1378 (let ((errors compilation-old-error-list)
|
|
1379 (last-line (nth 1 (cdr next-error)))
|
|
1380 (column (nth 2 (cdr next-error))))
|
|
1381 (set-buffer buffer)
|
|
1382 (save-excursion
|
|
1383 (save-restriction
|
|
1384 (widen)
|
|
1385 (goto-line last-line)
|
|
1386 (if (and column (> column 0))
|
|
1387 ;; Columns in error msgs are 1-origin.
|
|
1388 (move-to-column (1- column))
|
|
1389 (beginning-of-line))
|
|
1390 (setcdr next-error (point-marker))
|
|
1391 ;; Make all the other error messages referring
|
|
1392 ;; to the same file have markers into the buffer.
|
|
1393 (while errors
|
|
1394 (and (consp (cdr (car errors)))
|
|
1395 (equal (car (cdr (car errors))) fileinfo)
|
|
1396 (let* ((this (nth 1 (cdr (car errors))))
|
|
1397 (column (nth 2 (cdr (car errors))))
|
|
1398 (lines (- this last-line)))
|
|
1399 (if (eq selective-display t)
|
|
1400 ;; When selective-display is t,
|
|
1401 ;; each C-m is a line boundary,
|
|
1402 ;; as well as each newline.
|
|
1403 (if (< lines 0)
|
|
1404 (re-search-backward "[\n\C-m]"
|
|
1405 nil 'end
|
|
1406 (- lines))
|
|
1407 (re-search-forward "[\n\C-m]"
|
|
1408 nil 'end
|
|
1409 lines))
|
|
1410 (forward-line lines))
|
|
1411 (if (and column (> column 1))
|
|
1412 (move-to-column (1- column))
|
|
1413 (beginning-of-line))
|
|
1414 (setq last-line this)
|
|
1415 (setcdr (car errors) (point-marker))))
|
|
1416 (setq errors (cdr errors)))))
|
|
1417 ;; XEmacs addition
|
|
1418 (set-buffer cbuf)))))
|
|
1419 ;; If we didn't get a marker for this error, or this
|
|
1420 ;; marker's buffer was killed, go on to the next one.
|
|
1421 (or (not (markerp (cdr next-error)))
|
|
1422 (not (marker-buffer (cdr next-error))))))
|
|
1423 (setq next-errors compilation-error-list
|
|
1424 next-error (car next-errors)))
|
|
1425
|
|
1426 ;; XEmacs -- move this inside save-excursion
|
|
1427 ;; Skip over multiple error messages for the same source location,
|
|
1428 ;; so the next C-x ` won't go to an error in the same place.
|
|
1429 (while (and compilation-error-list
|
|
1430 (equal (cdr (car compilation-error-list))
|
|
1431 (cdr next-error)))
|
|
1432 (setq compilation-error-list (cdr compilation-error-list)))
|
|
1433 ))
|
|
1434
|
|
1435 ;; XEmacs change: If a new window has to be displayed, select the other
|
|
1436 ;; window to avoid swapping the position of the compilation error buffer.
|
|
1437 (and next-error (get-buffer-window (marker-buffer (car next-error)))
|
|
1438 (progn
|
|
1439 (select-window (get-buffer-window (marker-buffer (car next-error))))
|
|
1440 (other-window -1)))
|
|
1441
|
|
1442 ;; We now have a marker for the position of the error source code.
|
|
1443 ;; NEXT-ERROR is a cons (ERROR . SOURCE) of two markers.
|
|
1444 next-error))
|
|
1445
|
|
1446 (defun compilation-goto-locus (next-error)
|
|
1447 "Jump to an error locus returned by `compilation-next-error-locus'.
|
|
1448 Takes one argument, a cons (ERROR . SOURCE) of two markers.
|
|
1449 Selects a window with point at SOURCE, with another window displaying ERROR."
|
|
1450 ;; XEmacs: this code is horrendous, and makes windows do all sorts of
|
|
1451 ;; weird things when you're using separate frames for the compilation
|
|
1452 ;; and source buffer.
|
|
1453 ; (if (and (window-dedicated-p (selected-window))
|
|
1454 ; (eq (selected-window) (frame-root-window)))
|
|
1455 ; (switch-to-buffer-other-frame (marker-buffer (cdr next-error)))
|
|
1456 ; (switch-to-buffer (marker-buffer (cdr next-error))))
|
|
1457 ; (goto-char (cdr next-error))
|
|
1458 ; ;; If narrowing got in the way of
|
|
1459 ; ;; going to the right place, widen.
|
|
1460 ; (or (= (point) (marker-position (cdr next-error)))
|
|
1461 ; (progn
|
|
1462 ; (widen)
|
|
1463 ; (goto-char (cdr next-error))))
|
|
1464 ;
|
|
1465 ; ;; Show compilation buffer in other window, scrolled to this error.
|
|
1466 ; (let* ((pop-up-windows t)
|
|
1467 ; (w (or (get-buffer-window (marker-buffer (car next-error)) 'visible)
|
|
1468 ; (display-buffer (marker-buffer (car next-error))))))
|
|
1469 ; (set-window-point w (car next-error))
|
|
1470 ; (set-window-start w (car next-error))
|
|
1471 ; (compilation-set-window-height w)))
|
|
1472
|
|
1473 (let* ((pop-up-windows t)
|
|
1474 (compilation-buffer (marker-buffer (car next-error)))
|
|
1475 (source-buffer (marker-buffer (cdr next-error)))
|
|
1476 ;; make sure compilation buffer is visible ...
|
|
1477 (compilation-window
|
|
1478 ;; Use an existing window if it is in a visible frame.
|
|
1479 (or (get-buffer-window compilation-buffer 'visible)
|
|
1480 ;; Pop up a window.
|
|
1481 (display-buffer compilation-buffer))))
|
|
1482
|
|
1483 ;; now, make the compilation buffer **STAY WHERE IT IS** and
|
|
1484 ;; make sure the source buffer is visible
|
|
1485
|
|
1486 (select-window compilation-window)
|
|
1487 (pop-to-buffer source-buffer)
|
|
1488
|
|
1489 ;; now put things aright in the compilation window.
|
|
1490 (set-window-point compilation-window (car next-error))
|
|
1491 (set-window-start compilation-window (car next-error))
|
|
1492 (compilation-set-window-height compilation-window)
|
|
1493
|
|
1494 ;; now put things aright in the source window.
|
|
1495
|
|
1496 (set-buffer source-buffer)
|
|
1497 (goto-char (cdr next-error))
|
|
1498 ;; If narrowing got in the way of
|
|
1499 ;; going to the right place, widen.
|
|
1500 (or (= (point) (marker-position (cdr next-error)))
|
|
1501 (progn
|
|
1502 (widen)
|
|
1503 (goto-char (cdr next-error))))))
|
2
|
1504
|
0
|
1505
|
|
1506 ;; Find a buffer for file FILENAME.
|
|
1507 ;; Search the directories in compilation-search-path.
|
|
1508 ;; A nil in compilation-search-path means to try the
|
|
1509 ;; current directory, which is passed in DIR.
|
|
1510 ;; If FILENAME is not found at all, ask the user where to find it.
|
|
1511 ;; Pop up the buffer containing MARKER and scroll to MARKER if we ask the user.
|
|
1512 (defun compilation-find-file (marker filename dir &rest formats)
|
|
1513 (or formats (setq formats '("%s")))
|
|
1514 (let ((dirs compilation-search-path)
|
|
1515 buffer thisdir fmts name)
|
|
1516 (if (file-name-absolute-p filename)
|
|
1517 ;; The file name is absolute. Use its explicit directory as
|
|
1518 ;; the first in the search path, and strip it from FILENAME.
|
|
1519 (setq filename (abbreviate-file-name (expand-file-name filename))
|
|
1520 dirs (cons (file-name-directory filename) dirs)
|
|
1521 filename (file-name-nondirectory filename)))
|
|
1522 ;; Now search the path.
|
|
1523 (while (and dirs (null buffer))
|
|
1524 (setq thisdir (or (car dirs) dir)
|
|
1525 fmts formats)
|
|
1526 ;; For each directory, try each format string.
|
|
1527 (while (and fmts (null buffer))
|
|
1528 (setq name (expand-file-name (format (car fmts) filename) thisdir)
|
|
1529 buffer (and (file-exists-p name)
|
|
1530 (find-file-noselect name))
|
|
1531 fmts (cdr fmts)))
|
|
1532 (setq dirs (cdr dirs)))
|
|
1533 (or buffer
|
|
1534 ;; The file doesn't exist.
|
|
1535 ;; Ask the user where to find it.
|
|
1536 ;; If he hits C-g, then the next time he does
|
|
1537 ;; next-error, he'll skip past it.
|
|
1538 (let* ((pop-up-windows t)
|
|
1539 (w (display-buffer (marker-buffer marker))))
|
|
1540 (set-window-point w marker)
|
|
1541 (set-window-start w marker)
|
|
1542 (let ((name (expand-file-name
|
|
1543 (read-file-name
|
|
1544 (format "Find this error in: (default %s) "
|
|
1545 filename)
|
|
1546 dir filename t))))
|
|
1547 (if (file-directory-p name)
|
|
1548 (setq name (expand-file-name filename name)))
|
|
1549 (and (file-exists-p name)
|
|
1550 (find-file-noselect name)))))))
|
|
1551
|
|
1552 ;; Set compilation-error-list to nil, and unchain the markers that point to the
|
|
1553 ;; error messages and their text, so that they no longer slow down gap motion.
|
|
1554 ;; This would happen anyway at the next garbage collection, but it is better to
|
|
1555 ;; do it right away.
|
|
1556 (defun compilation-forget-errors ()
|
|
1557 (while compilation-old-error-list
|
|
1558 (let ((next-error (car compilation-old-error-list)))
|
|
1559 (set-marker (car next-error) nil)
|
|
1560 (if (markerp (cdr next-error))
|
|
1561 (set-marker (cdr next-error) nil)))
|
|
1562 (setq compilation-old-error-list (cdr compilation-old-error-list)))
|
|
1563 (setq compilation-error-list nil
|
|
1564 compilation-directory-stack nil
|
|
1565 compilation-parsing-end 1))
|
|
1566
|
|
1567
|
|
1568 (defun count-regexp-groupings (regexp)
|
|
1569 "Return the number of \\( ... \\) groupings in REGEXP (a string)."
|
|
1570 (let ((groupings 0)
|
|
1571 (len (length regexp))
|
|
1572 (i 0)
|
|
1573 c)
|
|
1574 (while (< i len)
|
|
1575 (setq c (aref regexp i)
|
|
1576 i (1+ i))
|
|
1577 (cond ((= c ?\[)
|
|
1578 ;; Find the end of this [...].
|
|
1579 (while (and (< i len)
|
|
1580 (not (= (aref regexp i) ?\])))
|
|
1581 (setq i (1+ i))))
|
|
1582 ((= c ?\\)
|
|
1583 (if (< i len)
|
|
1584 (progn
|
|
1585 (setq c (aref regexp i)
|
|
1586 i (1+ i))
|
|
1587 (if (= c ?\))
|
|
1588 ;; We found the end of a grouping,
|
|
1589 ;; so bump our counter.
|
|
1590 (setq groupings (1+ groupings))))))))
|
|
1591 groupings))
|
|
1592
|
|
1593 (defun compilation-parse-errors (limit-search find-at-least)
|
|
1594 "Parse the current buffer as grep, cc or lint error messages.
|
|
1595 See variable `compilation-parse-errors-function' for the interface it uses."
|
|
1596 (setq compilation-error-list nil)
|
|
1597 (message "Parsing error messages...")
|
|
1598 (let (;;text-buffer -- unused
|
|
1599 orig orig-expanded parent-expanded
|
|
1600 regexp enter-group leave-group error-group
|
|
1601 alist subexpr error-regexp-groups
|
|
1602 (found-desired nil)
|
116
|
1603 (compilation-num-errors-found 0)
|
|
1604 (message-freq (max 1 (/ (count-lines (point-min) (point-max)) 50))))
|
0
|
1605
|
|
1606 ;; Don't reparse messages already seen at last parse.
|
|
1607 (goto-char compilation-parsing-end)
|
|
1608 ;; Don't parse the first two lines as error messages.
|
|
1609 ;; This matters for grep.
|
|
1610 (if (bobp)
|
|
1611 (progn
|
|
1612 (forward-line 2)
|
|
1613 ;; Move back so point is before the newline.
|
|
1614 ;; This matters because some error regexps use \n instead of ^
|
|
1615 ;; to be faster.
|
|
1616 (forward-char -1)))
|
|
1617
|
|
1618 ;; Compile all the regexps we want to search for into one.
|
|
1619 (setq regexp (concat "\\(" compilation-enter-directory-regexp "\\)\\|"
|
|
1620 "\\(" compilation-leave-directory-regexp "\\)\\|"
|
|
1621 "\\(" (mapconcat (function
|
|
1622 (lambda (elt)
|
|
1623 (concat "\\(" (car elt) "\\)")))
|
|
1624 compilation-error-regexp-alist
|
|
1625 "\\|") "\\)"))
|
|
1626
|
|
1627 ;; Find out how many \(...\) groupings are in each of the regexps, and set
|
|
1628 ;; *-GROUP to the grouping containing each constituent regexp (whose
|
|
1629 ;; subgroups will come immediately thereafter) of the big regexp we have
|
|
1630 ;; just constructed.
|
|
1631 (setq enter-group 1
|
|
1632 leave-group (+ enter-group
|
|
1633 (count-regexp-groupings
|
|
1634 compilation-enter-directory-regexp)
|
|
1635 1)
|
|
1636 error-group (+ leave-group
|
|
1637 (count-regexp-groupings
|
|
1638 compilation-leave-directory-regexp)
|
|
1639 1))
|
|
1640
|
|
1641 ;; Compile an alist (IDX FILE LINE [COL]), where IDX is the number of
|
|
1642 ;; the subexpression for an entire error-regexp, and FILE and LINE (and
|
|
1643 ;; possibly COL) are the numbers for the subexpressions giving the file
|
|
1644 ;; name and line number (and possibly column number).
|
|
1645 (setq alist (or compilation-error-regexp-alist
|
|
1646 (error "compilation-error-regexp-alist is empty!"))
|
|
1647 subexpr (1+ error-group))
|
|
1648 (while alist
|
2
|
1649 (setq error-regexp-groups
|
|
1650 (cons (list subexpr
|
|
1651 (+ subexpr (nth 1 (car alist)))
|
|
1652 (+ subexpr (nth 2 (car alist)))
|
|
1653 ;;#### This is buggy in FSFmacs
|
|
1654 (let ((col (nth 3 (car alist))))
|
|
1655 (and col
|
|
1656 (+ subexpr col))))
|
|
1657 error-regexp-groups))
|
0
|
1658 (setq subexpr (+ subexpr 1 (count-regexp-groupings (car (car alist)))))
|
|
1659 (setq alist (cdr alist)))
|
|
1660
|
|
1661 ;; Set up now the expanded, abbreviated directory variables
|
|
1662 ;; that compile-abbreviate-directory will need, so we can
|
|
1663 ;; compute them just once here.
|
|
1664 (setq orig (abbreviate-file-name default-directory)
|
|
1665 orig-expanded (abbreviate-file-name
|
|
1666 (file-truename default-directory))
|
|
1667 parent-expanded (abbreviate-file-name
|
|
1668 (expand-file-name "../" orig-expanded)))
|
|
1669
|
|
1670 (while (and (not found-desired)
|
|
1671 ;; We don't just pass LIMIT-SEARCH to re-search-forward
|
|
1672 ;; because we want to find matches containing LIMIT-SEARCH
|
|
1673 ;; but which extend past it.
|
88
|
1674 ;; Instead of using re-search-forward,
|
|
1675 ;; we use this loop which tries only at each line.
|
|
1676 (progn
|
|
1677 (while (and (not (eobp))
|
|
1678 (not (looking-at regexp)))
|
|
1679 (forward-line 1))
|
|
1680 (not (eobp))))
|
|
1681
|
|
1682 ;; Move to the end of the match we just found.
|
|
1683 (goto-char (match-end 0))
|
0
|
1684
|
|
1685 ;; Figure out which constituent regexp matched.
|
|
1686 (cond ((match-beginning enter-group)
|
|
1687 ;; The match was the enter-directory regexp.
|
|
1688 (let ((dir
|
|
1689 (file-name-as-directory
|
|
1690 (expand-file-name
|
|
1691 (buffer-substring (match-beginning (+ enter-group 1))
|
|
1692 (match-end (+ enter-group 1)))))))
|
|
1693 ;; The directory name in the "entering" message
|
|
1694 ;; is a truename. Try to convert it to a form
|
|
1695 ;; like what the user typed in.
|
|
1696 (setq dir
|
|
1697 (compile-abbreviate-directory dir orig orig-expanded
|
|
1698 parent-expanded))
|
|
1699 (setq compilation-directory-stack
|
|
1700 (cons dir compilation-directory-stack))
|
|
1701 (and (file-directory-p dir)
|
|
1702 (setq default-directory dir)))
|
|
1703
|
|
1704 (and limit-search (>= (point) limit-search)
|
|
1705 ;; The user wanted a specific error, and we're past it.
|
|
1706 ;; We do this check here (and in the leave-group case)
|
|
1707 ;; rather than at the end of the loop because if the last
|
|
1708 ;; thing seen is an error message, we must carefully
|
|
1709 ;; discard the last error when it is the first in a new
|
|
1710 ;; file (see below in the error-group case).
|
|
1711 (setq found-desired t)))
|
|
1712
|
|
1713 ((match-beginning leave-group)
|
|
1714 ;; The match was the leave-directory regexp.
|
|
1715 (let ((beg (match-beginning (+ leave-group 1)))
|
|
1716 (stack compilation-directory-stack))
|
|
1717 (if beg
|
|
1718 (let ((dir
|
|
1719 (file-name-as-directory
|
|
1720 (expand-file-name
|
|
1721 (buffer-substring beg
|
|
1722 (match-end (+ leave-group
|
|
1723 1)))))))
|
|
1724 ;; The directory name in the "leaving" message
|
|
1725 ;; is a truename. Try to convert it to a form
|
|
1726 ;; like what the user typed in.
|
|
1727 (setq dir
|
|
1728 (compile-abbreviate-directory dir orig orig-expanded
|
|
1729 parent-expanded))
|
|
1730 (while (and stack
|
|
1731 (not (string-equal (car stack) dir)))
|
|
1732 (setq stack (cdr stack)))))
|
|
1733 (setq compilation-directory-stack (cdr stack))
|
|
1734 (setq stack (car compilation-directory-stack))
|
|
1735 (if stack
|
|
1736 (setq default-directory stack))
|
|
1737 )
|
|
1738
|
|
1739 (and limit-search (>= (point) limit-search)
|
|
1740 ;; The user wanted a specific error, and we're past it.
|
|
1741 ;; We do this check here (and in the enter-group case)
|
|
1742 ;; rather than at the end of the loop because if the last
|
|
1743 ;; thing seen is an error message, we must carefully
|
|
1744 ;; discard the last error when it is the first in a new
|
|
1745 ;; file (see below in the error-group case).
|
|
1746 (setq found-desired t)))
|
|
1747
|
|
1748 ((match-beginning error-group)
|
|
1749 ;; The match was the composite error regexp.
|
|
1750 ;; Find out which individual regexp matched.
|
|
1751 (setq alist error-regexp-groups)
|
|
1752 (while (and alist
|
|
1753 (null (match-beginning (car (car alist)))))
|
|
1754 (setq alist (cdr alist)))
|
|
1755 (if alist
|
|
1756 (setq alist (car alist))
|
|
1757 (error "compilation-parse-errors: impossible regexp match!"))
|
|
1758
|
|
1759 ;; Extract the file name and line number from the error message.
|
|
1760 (let ((beginning-of-match (match-beginning 0)) ;looking-at nukes
|
|
1761 (filename (buffer-substring (match-beginning (nth 1 alist))
|
|
1762 (match-end (nth 1 alist))))
|
|
1763 (linenum (string-to-int
|
|
1764 (buffer-substring
|
|
1765 (match-beginning (nth 2 alist))
|
|
1766 (match-end (nth 2 alist)))))
|
|
1767 (column (and (nth 3 alist)
|
|
1768 (match-beginning (nth 3 alist))
|
|
1769 (string-to-int
|
|
1770 (buffer-substring
|
|
1771 (match-beginning (nth 3 alist))
|
|
1772 (match-end (nth 3 alist)))))))
|
|
1773
|
|
1774 ;; Check for a comint-file-name-prefix and prepend it if
|
|
1775 ;; appropriate. (This is very useful for
|
|
1776 ;; compilation-minor-mode in an rlogin-mode buffer.)
|
|
1777 (and (boundp 'comint-file-name-prefix)
|
|
1778 ;; If the file name is relative, default-directory will
|
|
1779 ;; already contain the comint-file-name-prefix (done by
|
|
1780 ;; compile-abbreviate-directory).
|
|
1781 (file-name-absolute-p filename)
|
|
1782 (setq filename (concat comint-file-name-prefix filename)))
|
2
|
1783
|
|
1784 ;; Some compilers (e.g. Sun's java compiler, reportedly)
|
|
1785 ;; produce bogus file names like "./bar//foo.c" for the file
|
|
1786 ;; "bar/foo.c"; expand-file-name will collapse these into
|
|
1787 ;; "/foo.c" and fail to find the appropriate file. So we look
|
|
1788 ;; for doubled slashes in the file name and fix them up in the
|
|
1789 ;; buffer.
|
|
1790 (when (fboundp 'command-line-normalize-file-name)
|
|
1791 (setq filename (command-line-normalize-file-name filename)))
|
0
|
1792 (setq filename (cons filename (cons default-directory
|
|
1793 (nthcdr 4 alist))))
|
|
1794
|
|
1795
|
|
1796 ;; Locate the erring file and line.
|
|
1797 ;; Cons a new elt onto compilation-error-list,
|
|
1798 ;; giving a marker for the current compilation buffer
|
|
1799 ;; location, and the file and line number of the error.
|
|
1800 (save-excursion
|
|
1801 ;; Save as the start of the error the beginning of the
|
|
1802 ;; line containing the match unless the match starts at a
|
|
1803 ;; newline, in which case the beginning of the next line.
|
|
1804 (goto-char beginning-of-match)
|
|
1805 (forward-line (if (eolp) 1 0))
|
|
1806 (let ((this (cons (point-marker)
|
|
1807 (list filename linenum column))))
|
|
1808 ;; Don't add the same source line more than once.
|
|
1809 (if (equal (cdr this) (cdr (car compilation-error-list)))
|
|
1810 nil
|
|
1811 (setq compilation-error-list
|
|
1812 (cons this
|
|
1813 compilation-error-list))
|
|
1814 (setq compilation-num-errors-found
|
|
1815 (1+ compilation-num-errors-found)))))
|
|
1816 (and (or (and find-at-least (> compilation-num-errors-found
|
|
1817 find-at-least))
|
|
1818 (and limit-search (>= (point) limit-search)))
|
|
1819 ;; We have found as many new errors as the user wants,
|
|
1820 ;; or past the buffer position he indicated. We
|
|
1821 ;; continue to parse until we have seen all the
|
|
1822 ;; consecutive errors in the same file, so the error
|
|
1823 ;; positions will be recorded as markers in this buffer
|
|
1824 ;; that might change.
|
|
1825 (cdr compilation-error-list) ; Must check at least two.
|
|
1826 (not (equal (car (cdr (nth 0 compilation-error-list)))
|
|
1827 (car (cdr (nth 1 compilation-error-list)))))
|
|
1828 (progn
|
|
1829 ;; Discard the error just parsed, so that the next
|
|
1830 ;; parsing run can get it and the following errors in
|
|
1831 ;; the same file all at once. If we didn't do this, we
|
|
1832 ;; would have the same problem we are trying to avoid
|
|
1833 ;; with the test above, just delayed until the next run!
|
|
1834 (setq compilation-error-list
|
|
1835 (cdr compilation-error-list))
|
|
1836 (goto-char beginning-of-match)
|
|
1837 (setq found-desired t)))
|
|
1838 )
|
|
1839 )
|
|
1840 (t
|
|
1841 (error "compilation-parse-errors: known groups didn't match!")))
|
|
1842
|
116
|
1843 (when (= (% compilation-num-errors-found message-freq) 0)
|
|
1844 (message "Parsing error messages...%d (%.0f%% of buffer)"
|
|
1845 compilation-num-errors-found
|
|
1846 ;; Use floating-point because (* 100 (point)) frequently
|
|
1847 ;; exceeds the range of Emacs Lisp integers.
|
|
1848 (/ (* 100.0 (point)) (point-max))))
|
0
|
1849
|
116
|
1850 ;;; This is broken - it foils the logic above which is supposed to ensure
|
|
1851 ;;; that all errors for the current file are found before we quit.
|
|
1852 ; (and limit-search (>= (point) limit-search)
|
|
1853 ; ;; The user wanted a specific error, and we're past it.
|
|
1854 ; (setq found-desired t))
|
|
1855 )
|
0
|
1856 (setq compilation-parsing-end (if found-desired
|
|
1857 (point)
|
|
1858 ;; We have searched the whole buffer.
|
|
1859 (point-max))))
|
|
1860 (setq compilation-error-list (nreverse compilation-error-list))
|
|
1861 (message "Parsing error messages...done"))
|
|
1862
|
|
1863 ;; If directory DIR is a subdir of ORIG or of ORIG's parent,
|
|
1864 ;; return a relative name for it starting from ORIG or its parent.
|
|
1865 ;; ORIG-EXPANDED is an expanded version of ORIG.
|
|
1866 ;; PARENT-EXPANDED is an expanded version of ORIG's parent.
|
|
1867 ;; Those two args could be computed here, but we run faster by
|
|
1868 ;; having the caller compute them just once.
|
|
1869 (defun compile-abbreviate-directory (dir orig orig-expanded parent-expanded)
|
|
1870 ;; Apply canonical abbreviations to DIR first thing.
|
|
1871 ;; Those abbreviations are already done in the other arguments passed.
|
|
1872 (setq dir (abbreviate-file-name dir))
|
|
1873
|
|
1874 ;; Check for a comint-file-name-prefix and prepend it if appropriate.
|
|
1875 ;; (This is very useful for compilation-minor-mode in an rlogin-mode
|
|
1876 ;; buffer.)
|
|
1877 (if (boundp 'comint-file-name-prefix)
|
|
1878 (setq dir (concat comint-file-name-prefix dir)))
|
|
1879
|
|
1880 (if (and (> (length dir) (length orig-expanded))
|
|
1881 (string= orig-expanded
|
|
1882 (substring dir 0 (length orig-expanded))))
|
|
1883 (setq dir
|
|
1884 (concat orig
|
|
1885 (substring dir (length orig-expanded)))))
|
|
1886 (if (and (> (length dir) (length parent-expanded))
|
|
1887 (string= parent-expanded
|
|
1888 (substring dir 0 (length parent-expanded))))
|
|
1889 (setq dir
|
|
1890 (concat (file-name-directory
|
|
1891 (directory-file-name orig))
|
|
1892 (substring dir (length parent-expanded)))))
|
|
1893 dir)
|
|
1894
|
|
1895 (provide 'compile)
|
|
1896
|
|
1897 ;;; compile.el ends here
|