diff options
Diffstat (limited to 'lisp/progmodes/compile.el')
-rw-r--r-- | lisp/progmodes/compile.el | 76 |
1 files changed, 47 insertions, 29 deletions
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 3c63d5f01b1..e8c09113d39 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -226,14 +226,19 @@ of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2 nil (1)) ;; I have no idea what this first line is supposed to match, but it ;; makes things ambiguous with output such as "foo:344:50:blabla" since ;; the "foo" part can match this first line (in which case the file - ;; name as "344"). To avoid this, we disallow filenames exclusively - ;; composed of digits. --Stef + ;; name as "344"). To avoid this, the second line disallows filenames + ;; exclusively composed of digits. --Stef + ;; Similarly, we get lots of false positives with messages including + ;; times of the form "HH:MM:SS" where MM is taken as a line number, so + ;; the last line tries to rule out message where the info after the + ;; line number starts with "SS". --Stef "^\\(?:[[:alpha:]][-[:alnum:].]+: ?\\)?\ \\([0-9]*[^0-9\n].*?\\): ?\ \\([0-9]+\\)\\(?:\\([.:]\\)\\([0-9]+\\)\\)?\ \\(?:-\\([0-9]+\\)?\\(?:\\3\\([0-9]+\\)\\)?\\)?:\ \\(?: *\\(\\(?:Future\\|Runtime\\)?[Ww]arning\\|W:\\)\\|\ - *\\([Ii]nfo\\(?:\\>\\|rmationa?l?\\)\\|I:\\|instantiated from\\)\\)?" + *\\([Ii]nfo\\(?:\\>\\|rmationa?l?\\)\\|I:\\|instantiated from\\)\\|\ +\[0-9]?\\(?:[^0-9\n]\\|$\\)\\|[0-9][0-9][0-9]\\)" 1 (2 . 5) (4 . 6) (7 . 8)) (lcc @@ -405,10 +410,7 @@ you may also want to change `compilation-page-delimiter'.") "Value of `page-delimiter' in Compilation mode.") (defvar compilation-mode-font-lock-keywords - '(;; Don't highlight this as a compilation message. - ("^Compilation started at.*" - (0 '(face nil message nil help-echo nil mouse-face nil) t)) - ;; configure output lines. + '(;; configure output lines. ("^[Cc]hecking \\(?:[Ff]or \\|[Ii]f \\|[Ww]hether \\(?:to \\)?\\)?\\(.+\\)\\.\\.\\. *\\(?:(cached) *\\)?\\(\\(yes\\(?: .+\\)?\\)\\|no\\|\\(.*\\)\\)$" (1 font-lock-variable-name-face) (2 (compilation-face '(4 . 3)))) @@ -419,7 +421,7 @@ you may also want to change `compilation-page-delimiter'.") ("^Compilation \\(finished\\).*" (0 '(face nil message nil help-echo nil mouse-face nil) t) (1 compilation-info-face)) - ("^Compilation \\(exited abnormally\\|interrupt\\|killed\\|terminated\\)\\(?:.*with code \\([0-9]+\\)\\)?.*" + ("^Compilation \\(exited abnormally\\|interrupt\\|killed\\|terminated\\|segmentation fault\\)\\(?:.*with code \\([0-9]+\\)\\)?.*" (0 '(face nil message nil help-echo nil mouse-face nil) t) (1 compilation-error-face) (2 compilation-error-face nil t))) @@ -1823,28 +1825,44 @@ Pop up the buffer containing MARKER and scroll to MARKER if we ask the user." (find-file-noselect name)) fmts (cdr fmts))) (setq dirs (cdr dirs))) - (or buffer - ;; The file doesn't exist. Ask the user where to find it. - (save-excursion ;This save-excursion is probably not right. - (let ((pop-up-windows t)) - (compilation-set-window (display-buffer (marker-buffer marker)) - marker) - (let ((name (expand-file-name - (read-file-name - (format "Find this %s in (default %s): " - compilation-error filename) - spec-dir filename t)))) - (if (file-directory-p name) - (setq name (expand-file-name filename name))) - (setq buffer (and (file-exists-p name) - (find-file-noselect name))))))) + (while (null buffer) ;Repeat until the user selects an existing file. + ;; The file doesn't exist. Ask the user where to find it. + (save-excursion ;This save-excursion is probably not right. + (let ((pop-up-windows t)) + (compilation-set-window (display-buffer (marker-buffer marker)) + marker) + (let* ((name (read-file-name + (format "Find this %s in (default %s): " + compilation-error filename) + spec-dir filename t nil + ;; Try to make sure the user can only select + ;; a valid answer. This predicate may be ignored, + ;; tho, so we still have to double-check afterwards. + ;; TODO: We should probably fix read-file-name so + ;; that it never ignores this predicate, even when + ;; using popup dialog boxes. + (lambda (name) + (if (file-directory-p name) + (setq name (expand-file-name filename name))) + (file-exists-p name)))) + (origname name)) + (cond + ((not (file-exists-p name)) + (message "Cannot find file `%s'" name) + (ding) (sit-for 2)) + ((and (file-directory-p name) + (not (file-exists-p + (setq name (expand-file-name filename name))))) + (message "No `%s' in directory %s" filename origname) + (ding) (sit-for 2)) + (t + (setq buffer (find-file-noselect name)))))))) ;; Make intangible overlays tangible. - ;; This is very weird: it's not even clear which is the current buffer, - ;; so the code below can't be expected to DTRT here. --Stef - (mapcar (function (lambda (ov) - (when (overlay-get ov 'intangible) - (overlay-put ov 'intangible nil)))) - (overlays-in (point-min) (point-max))) + ;; This is weird: it's not even clear which is the current buffer, + ;; so the code below can't be expected to DTRT here. -- Stef + (dolist (ov (overlays-in (point-min) (point-max))) + (when (overlay-get ov 'intangible) + (overlay-put ov 'intangible nil))) buffer)) (defun compilation-get-file-structure (file &optional fmt) |