comparison lisp/progmodes/compile.el @ 90533:8a8e69664178

Merge from emacs--devo--0 Patches applied: * emacs--devo--0 (patch 343-356) - Update from CVS - Update for ERC 5.1.3. - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 113-115) - Merge from emacs--devo--0 - Update from CVS Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-90
author Miles Bader <miles@gnu.org>
date Wed, 19 Jul 2006 00:42:56 +0000
parents a8190f7e546e adaad9cef326
children 858cb33ae39d
comparison
equal deleted inserted replaced
90532:e22cf6d2400c 90533:8a8e69664178
221 (gcc-include 221 (gcc-include
222 "^\\(?:In file included\\| \\) from \ 222 "^\\(?:In file included\\| \\) from \
223 \\(.+\\):\\([0-9]+\\)\\(?:\\(:\\)\\|\\(,\\)\\)?" 1 2 nil (3 . 4)) 223 \\(.+\\):\\([0-9]+\\)\\(?:\\(:\\)\\|\\(,\\)\\)?" 1 2 nil (3 . 4))
224 224
225 (gnu 225 (gnu
226 ;; I have no idea what this first line is supposed to match, but it
227 ;; makes things ambiguous with output such as "foo:344:50:blabla" since
228 ;; the "foo" part can match this first line (in which case the file
229 ;; name as "344"). To avoid this, we disallow filenames exclusively
230 ;; composed of digits. --Stef
226 "^\\(?:[[:alpha:]][-[:alnum:].]+: ?\\)?\ 231 "^\\(?:[[:alpha:]][-[:alnum:].]+: ?\\)?\
227 \\([/.]*[a-zA-Z]:?[^ \t\n:]*\\|{standard input}\\): ?\ 232 \\([0-9]*[^0-9\n].*?\\): ?\
228 \\([0-9]+\\)\\([.:]?\\)\\([0-9]+\\)?\ 233 \\([0-9]+\\)\\(?:\\([.:]\\)\\([0-9]+\\)\\)?\
229 \\(?:-\\(?:\\([0-9]+\\)\\3\\)?\\.?\\([0-9]+\\)?\\)?:\ 234 \\(?:-\\([0-9]+\\)?\\(?:\\3\\([0-9]+\\)\\)?\\)?:\
230 \\(?: *\\(\\(?:Future\\|Runtime\\)?[Ww]arning\\|W:\\)\\|\ 235 \\(?: *\\(\\(?:Future\\|Runtime\\)?[Ww]arning\\|W:\\)\\|\
231 *\\([Ii]nfo\\(?:\\>\\|rmationa?l?\\)\\|I:\\|instantiated from\\)\\)?" 236 *\\([Ii]nfo\\(?:\\>\\|rmationa?l?\\)\\|I:\\|instantiated from\\)\\)?"
232 1 (2 . 5) (4 . 6) (7 . 8)) 237 1 (2 . 5) (4 . 6) (7 . 8))
233 238
234 (lcc 239 (lcc
291 (4bsd 296 (4bsd
292 "\\(?:^\\|:: \\|\\S ( \\)\\(/[^ \n\t()]+\\)(\\([0-9]+\\))\ 297 "\\(?:^\\|:: \\|\\S ( \\)\\(/[^ \n\t()]+\\)(\\([0-9]+\\))\
293 \\(?:: \\(warning:\\)?\\|$\\| ),\\)" 1 2 nil (3)) 298 \\(?:: \\(warning:\\)?\\|$\\| ),\\)" 1 2 nil (3))
294 299
295 (gcov-file 300 (gcov-file
296 "^ *-: *\\(0\\):Source:\\(.+\\)$" 301 "^ *-: *\\(0\\):Source:\\(.+\\)$"
297 2 1 nil 0 nil 302 2 1 nil 0 nil
298 (1 compilation-line-face prepend) (2 compilation-info-face prepend)) 303 (1 compilation-line-face prepend) (2 compilation-info-face prepend))
299 (gcov-header 304 (gcov-header
300 "^ *-: *\\(0\\):\\(?:Object\\|Graph\\|Data\\|Runs\\|Programs\\):.+$" 305 "^ *-: *\\(0\\):\\(?:Object\\|Graph\\|Data\\|Runs\\|Programs\\):.+$"
301 nil 1 nil 0 nil 306 nil 1 nil 0 nil
310 nil 1 nil 0 nil 315 nil 1 nil 0 nil
311 (0 'default t) 316 (0 'default t)
312 (1 compilation-line-face prepend)) 317 (1 compilation-line-face prepend))
313 (gcov-called-line 318 (gcov-called-line
314 "^ *\\([0-9]+\\): *\\([0-9]+\\):.*$" 319 "^ *\\([0-9]+\\): *\\([0-9]+\\):.*$"
315 nil 2 nil 0 nil 320 nil 2 nil 0 nil
316 (0 'default t) 321 (0 'default t)
317 (1 compilation-info-face prepend) (2 compilation-line-face prepend)) 322 (1 compilation-info-face prepend) (2 compilation-line-face prepend))
318 (gcov-never-called 323 (gcov-never-called
319 "^ *\\(#####\\): *\\([0-9]+\\):.*$" 324 "^ *\\(#####\\): *\\([0-9]+\\):.*$"
320 nil 2 nil 2 nil 325 nil 2 nil 2 nil
321 (0 'default t) 326 (0 'default t)
322 (1 compilation-error-face prepend) (2 compilation-line-face prepend)) 327 (1 compilation-error-face prepend) (2 compilation-line-face prepend))
323 ) 328 )
324 "Alist of values for `compilation-error-regexp-alist'.") 329 "Alist of values for `compilation-error-regexp-alist'.")
398 (defvar compilation-page-delimiter 403 (defvar compilation-page-delimiter
399 "^\\(?:\f\\|.*\\(?:Entering\\|Leaving\\) directory `.+'\n\\)+" 404 "^\\(?:\f\\|.*\\(?:Entering\\|Leaving\\) directory `.+'\n\\)+"
400 "Value of `page-delimiter' in Compilation mode.") 405 "Value of `page-delimiter' in Compilation mode.")
401 406
402 (defvar compilation-mode-font-lock-keywords 407 (defvar compilation-mode-font-lock-keywords
403 '(;; configure output lines. 408 '(;; Don't highlight this as a compilation message.
409 ("^Compilation started at.*"
410 (0 '(face nil message nil help-echo nil mouse-face nil) t))
411 ("^Compiling file .*"
412 (0 '(face nil message nil help-echo nil mouse-face nil) t))
413 ;; configure output lines.
404 ("^[Cc]hecking \\(?:[Ff]or \\|[Ii]f \\|[Ww]hether \\(?:to \\)?\\)?\\(.+\\)\\.\\.\\. *\\(?:(cached) *\\)?\\(\\(yes\\(?: .+\\)?\\)\\|no\\|\\(.*\\)\\)$" 414 ("^[Cc]hecking \\(?:[Ff]or \\|[Ii]f \\|[Ww]hether \\(?:to \\)?\\)?\\(.+\\)\\.\\.\\. *\\(?:(cached) *\\)?\\(\\(yes\\(?: .+\\)?\\)\\|no\\|\\(.*\\)\\)$"
405 (1 font-lock-variable-name-face) 415 (1 font-lock-variable-name-face)
406 (2 (compilation-face '(4 . 3)))) 416 (2 (compilation-face '(4 . 3))))
407 ;; Command output lines. Recognize `make[n]:' lines too. 417 ;; Command output lines. Recognize `make[n]:' lines too.
408 ("^\\([[:alnum:]_/.+-]+\\)\\(\\[\\([0-9]+\\)\\]\\)?[ \t]*:" 418 ("^\\([[:alnum:]_/.+-]+\\)\\(\\[\\([0-9]+\\)\\]\\)?[ \t]*:"
409 (1 font-lock-function-name-face) (3 compilation-line-face nil t)) 419 (1 font-lock-function-name-face) (3 compilation-line-face nil t))
410 (" --?o\\(?:utfile\\|utput\\)?[= ]?\\(\\S +\\)" . 1) 420 (" --?o\\(?:utfile\\|utput\\)?[= ]?\\(\\S +\\)" . 1)
411 ("^Compilation \\(finished\\)" 421 ("^Compilation \\(finished\\).*"
422 (0 '(face nil message nil help-echo nil mouse-face nil) t)
412 (1 compilation-info-face)) 423 (1 compilation-info-face))
413 ("^Compilation \\(exited abnormally\\|interrupt\\|killed\\|terminated\\)\\(?:.*with code \\([0-9]+\\)\\)?" 424 ("^Compilation \\(exited abnormally\\|interrupt\\|killed\\|terminated\\)\\(?:.*with code \\([0-9]+\\)\\)?.*"
425 (0 '(face nil message nil help-echo nil mouse-face nil) t)
414 (1 compilation-error-face) 426 (1 compilation-error-face)
415 (2 compilation-error-face nil t))) 427 (2 compilation-error-face nil t)))
416 "Additional things to highlight in Compilation mode. 428 "Additional things to highlight in Compilation mode.
417 This gets tacked on the end of the generated expressions.") 429 This gets tacked on the end of the generated expressions.")
418 430
1789 If DIRECTORY. is relative, it is combined with `default-directory'. 1801 If DIRECTORY. is relative, it is combined with `default-directory'.
1790 If DIRECTORY. is nil, that means use `default-directory'. 1802 If DIRECTORY. is nil, that means use `default-directory'.
1791 If FILENAME is not found at all, ask the user where to find it. 1803 If FILENAME is not found at all, ask the user where to find it.
1792 Pop up the buffer containing MARKER and scroll to MARKER if we ask the user." 1804 Pop up the buffer containing MARKER and scroll to MARKER if we ask the user."
1793 (or formats (setq formats '("%s"))) 1805 (or formats (setq formats '("%s")))
1794 (save-excursion 1806 (let ((dirs compilation-search-path)
1795 (let ((dirs compilation-search-path) 1807 (spec-dir (if directory
1796 (spec-dir (if directory 1808 (expand-file-name directory)
1797 (expand-file-name directory) 1809 default-directory))
1798 default-directory)) 1810 buffer thisdir fmts name)
1799 buffer thisdir fmts name) 1811 (if (file-name-absolute-p filename)
1800 (if (file-name-absolute-p filename) 1812 ;; The file name is absolute. Use its explicit directory as
1801 ;; The file name is absolute. Use its explicit directory as 1813 ;; the first in the search path, and strip it from FILENAME.
1802 ;; the first in the search path, and strip it from FILENAME. 1814 (setq filename (abbreviate-file-name (expand-file-name filename))
1803 (setq filename (abbreviate-file-name (expand-file-name filename)) 1815 dirs (cons (file-name-directory filename) dirs)
1804 dirs (cons (file-name-directory filename) dirs) 1816 filename (file-name-nondirectory filename)))
1805 filename (file-name-nondirectory filename))) 1817 ;; Now search the path.
1806 ;; Now search the path. 1818 (while (and dirs (null buffer))
1807 (while (and dirs (null buffer)) 1819 (setq thisdir (or (car dirs) spec-dir)
1808 (setq thisdir (or (car dirs) spec-dir) 1820 fmts formats)
1809 fmts formats) 1821 ;; For each directory, try each format string.
1810 ;; For each directory, try each format string. 1822 (while (and fmts (null buffer))
1811 (while (and fmts (null buffer)) 1823 (setq name (expand-file-name (format (car fmts) filename) thisdir)
1812 (setq name (expand-file-name (format (car fmts) filename) thisdir) 1824 buffer (and (file-exists-p name)
1813 buffer (and (file-exists-p name) 1825 (find-file-noselect name))
1814 (find-file-noselect name)) 1826 fmts (cdr fmts)))
1815 fmts (cdr fmts))) 1827 (setq dirs (cdr dirs)))
1816 (setq dirs (cdr dirs))) 1828 (while (null buffer) ;Repeat until the user selects an existing file.
1817 (or buffer 1829 ;; The file doesn't exist. Ask the user where to find it.
1818 ;; The file doesn't exist. Ask the user where to find it. 1830 (save-excursion ;This save-excursion is probably not right.
1819 (let ((pop-up-windows t)) 1831 (let ((pop-up-windows t))
1820 (compilation-set-window (display-buffer (marker-buffer marker)) 1832 (compilation-set-window (display-buffer (marker-buffer marker))
1821 marker) 1833 marker)
1822 (let ((name (expand-file-name 1834 (let* ((name (read-file-name
1823 (read-file-name 1835 (format "Find this %s in (default %s): "
1824 (format "Find this %s in (default %s): " 1836 compilation-error filename)
1825 compilation-error filename) 1837 spec-dir filename t nil
1826 spec-dir filename t)))) 1838 ;; Try to make sure the user can only select
1827 (if (file-directory-p name) 1839 ;; a valid answer. This predicate may be ignored,
1828 (setq name (expand-file-name filename name))) 1840 ;; tho, so we still have to double-check afterwards.
1829 (setq buffer (and (file-exists-p name) 1841 ;; TODO: We should probably fix read-file-name so
1830 (find-file name)))))) 1842 ;; that it never ignores this predicate, even when
1831 ;; Make intangible overlays tangible. 1843 ;; using popup dialog boxes.
1832 (mapcar (function (lambda (ov) 1844 (lambda (name)
1833 (when (overlay-get ov 'intangible) 1845 (if (file-directory-p name)
1834 (overlay-put ov 'intangible nil)))) 1846 (setq name (expand-file-name filename name)))
1835 (overlays-in (point-min) (point-max))) 1847 (file-exists-p name))))
1836 buffer))) 1848 (origname name))
1849 (cond
1850 ((not (file-exists-p name))
1851 (message "Cannot find file `%s'" name)
1852 (ding) (sit-for 2))
1853 ((and (file-directory-p name)
1854 (not (file-exists-p
1855 (setq name (expand-file-name filename name)))))
1856 (message "No `%s' in directory %s" filename origname)
1857 (ding) (sit-for 2))
1858 (t
1859 (setq buffer (find-file-noselect name))))))))
1860 ;; Make intangible overlays tangible.
1861 ;; This is weird: it's not even clear which is the current buffer,
1862 ;; so the code below can't be expected to DTRT here. -- Stef
1863 (dolist (ov (overlays-in (point-min) (point-max)))
1864 (when (overlay-get ov 'intangible)
1865 (overlay-put ov 'intangible nil)))
1866 buffer))
1837 1867
1838 (defun compilation-get-file-structure (file &optional fmt) 1868 (defun compilation-get-file-structure (file &optional fmt)
1839 "Retrieve FILE's file-structure or create a new one. 1869 "Retrieve FILE's file-structure or create a new one.
1840 FILE should be (FILENAME) or (RELATIVE-FILENAME . DIRNAME). 1870 FILE should be (FILENAME) or (RELATIVE-FILENAME . DIRNAME).
1841 In the former case, FILENAME may be relative or absolute. 1871 In the former case, FILENAME may be relative or absolute.