diff options
Diffstat (limited to 'lisp/progmodes/compile.el')
-rw-r--r-- | lisp/progmodes/compile.el | 78 |
1 files changed, 51 insertions, 27 deletions
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 2771cee977e..5de2c6afa53 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -134,7 +134,7 @@ and a string describing how the process finished.") ;; emacs -batch -l compile-tests.el -f ert-run-tests-batch-and-exit (defvar compilation-error-regexp-alist-alist - '((absoft + `((absoft "^\\(?:[Ee]rror on \\|[Ww]arning on\\( \\)\\)?[Ll]ine[ \t]+\\([0-9]+\\)[ \t]+\ of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2 nil (1)) @@ -255,16 +255,46 @@ of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2 nil (1)) ;; can be composed of any non-newline char, but it also rules out some ;; valid but unlikely cases, such as a trailing space or a space ;; followed by a -, or a colon followed by a space. - + ;; ;; The "in \\|from " exception was added to handle messages from Ruby. - "^\\(?:[[:alpha:]][-[:alnum:].]+: ?\\|[ \t]+\\(?:in \\|from \\)\\)?\ -\\([0-9]*[^0-9\n]\\(?:[^\n :]\\| [^-/\n]\\|:[^ \n]\\)*?\\): ?\ -\\([0-9]+\\)\\(?:-\\(?4:[0-9]+\\)\\(?:\\.\\(?5:[0-9]+\\)\\)?\ -\\|[.:]\\(?3:[0-9]+\\)\\(?:-\\(?:\\(?4:[0-9]+\\)\\.\\)?\\(?5:[0-9]+\\)\\)?\\)?:\ -\\(?: *\\(\\(?:Future\\|Runtime\\)?[Ww]arning\\|W:\\)\\|\ - *\\([Ii]nfo\\(?:\\>\\|rmationa?l?\\)\\|I:\\|\\[ skipping .+ \\]\\|\ -\\(?:instantiated\\|required\\) from\\|[Nn]ote\\)\\|\ - *[Ee]rror\\|[0-9]?\\(?:[^0-9\n]\\|$\\)\\|[0-9][0-9][0-9]\\)" + ,(rx + bol + (? (| (regexp "[[:alpha:]][-[:alnum:].]+: ?") + (regexp "[ \t]+\\(?:in \\|from\\)"))) + (group-n 1 (: (regexp "[0-9]*[^0-9\n]") + (*? (| (regexp "[^\n :]") + (regexp " [^-/\n]") + (regexp ":[^ \n]"))))) + (regexp ": ?") + (group-n 2 (regexp "[0-9]+")) + (? (| (: "-" + (group-n 4 (regexp "[0-9]+")) + (? "." (group-n 5 (regexp "[0-9]+")))) + (: (in ".:") + (group-n 3 (regexp "[0-9]+")) + (? "-" + (? (group-n 4 (regexp "[0-9]+")) ".") + (group-n 5 (regexp "[0-9]+")))))) + ":" + (| (: (* " ") + (group-n 6 (| "FutureWarning" + "RuntimeWarning" + "Warning" + "warning" + "W:"))) + (: (* " ") + (group-n 7 (| (regexp "[Ii]nfo\\(?:\\>\\|rmationa?l?\\)") + "I:" + (: "[ skipping " (+ ".") " ]") + "instantiated from" + "required from" + (regexp "[Nn]ote")))) + (: (* " ") + (regexp "[Ee]rror")) + (: (regexp "[0-9]?") + (| (regexp "[^0-9\n]") + eol)) + (regexp "[0-9][0-9][0-9]"))) 1 (2 . 4) (3 . 5) (6 . 7)) (lcc @@ -447,6 +477,8 @@ File = \\(.+\\), Line = \\([0-9]+\\)\\(?:, Column = \\([0-9]+\\)\\)?" ;; "^\\([^ \t\r\n(]+\\) (\\([0-9]+\\):\\([0-9]+\\)) " 1 2 3) + (guile-file "^In \\(.+\\):\n" 1) + (guile-line "^ *\\([0-9]+\\): *\\([0-9]+\\)" nil 1 2) ) "Alist of values for `compilation-error-regexp-alist'.") @@ -937,19 +969,12 @@ POS and RES.") (cons (copy-marker pos) (if prev (copy-marker prev)))) prev) ((and prev (= prev cache)) - (if cache - (set-marker (car compilation--previous-directory-cache) pos) - (setq compilation--previous-directory-cache - (cons (copy-marker pos) nil))) + (set-marker (car compilation--previous-directory-cache) pos) (cdr compilation--previous-directory-cache)) (t - (if cache - (progn - (set-marker cache pos) - (setcdr compilation--previous-directory-cache - (copy-marker prev))) - (setq compilation--previous-directory-cache - (cons (copy-marker pos) (if prev (copy-marker prev))))) + (set-marker cache pos) + (setcdr compilation--previous-directory-cache + (copy-marker prev)) prev)))) (if (markerp res) (marker-position res) res)))) @@ -2054,8 +2079,7 @@ Optional argument MINOR indicates this is called from (if minor (progn (font-lock-add-keywords nil (compilation-mode-font-lock-keywords)) - (if font-lock-mode - (font-lock-fontify-buffer))) + (font-lock-flush)) (setq font-lock-defaults '(compilation-mode-font-lock-keywords t)))) (defun compilation--unsetup () @@ -2064,8 +2088,7 @@ Optional argument MINOR indicates this is called from (remove-hook 'before-change-functions 'compilation--flush-parse t) (kill-local-variable 'compilation--parsed) (compilation--remove-properties) - (if font-lock-mode - (font-lock-fontify-buffer))) + (font-lock-flush)) ;;;###autoload (define-minor-mode compilation-shell-minor-mode @@ -2271,6 +2294,7 @@ looking for the next message." (or (compilation-buffer-p (current-buffer)) (error "Not in a compilation buffer")) (or pt (setq pt (point))) + (compilation--ensure-parse pt) (let* ((msg (get-text-property pt 'compilation-message)) ;; `loc', `msg', and `last' are used by the compilation-loop macro. (loc (and msg (compilation--message->loc msg))) @@ -2283,7 +2307,8 @@ looking for the next message." (line-beginning-position))) (unless (setq msg (get-text-property (max (1- pt) (point-min)) 'compilation-message)) - (setq pt (next-single-property-change pt 'compilation-message nil + (setq pt (compilation-next-single-property-change + pt 'compilation-message nil (line-end-position))) (or (setq msg (get-text-property pt 'compilation-message)) (setq pt (point))))) @@ -2294,7 +2319,6 @@ looking for the next message." "No more %ss yet" "Moved past last %s") (point-max)) - (compilation--ensure-parse pt) ;; Don't move "back" to message at or before point. ;; Pass an explicit (point-min) to make sure pt is non-nil. (setq pt (previous-single-property-change |