From: Lars Ingebrigtsen Date: Wed, 29 Jun 2022 09:53:16 +0000 (+0200) Subject: Fix compilation-mode parsing of file names in Gradle errors X-Git-Tag: emacs-29.0.90~1447^2~1394 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=e73dbcf26d9de114b3ba228edaf946418b476052;p=emacs.git Fix compilation-mode parsing of file names in Gradle errors * lisp/progmodes/compile.el (compilation-error-regexp-alist-alist): Fix parsing of file names in Gradle output (bug#56249). --- diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index d28fce9dbd7..28a49fc0dda 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -365,9 +365,10 @@ of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2 nil (1)) ;; PROGRAM:SOURCE-FILE-NAME:LINENO: MESSAGE ;; which is used for non-interactive programs other than ;; compilers (e.g. the "jade:" entry in compilation.txt). - (? (| (: alpha (+ (in ?. ?- alnum)) ":" (? " ")) - ;; Skip indentation generated by GCC's -fanalyzer. - (: (+ " ") "|"))) + (? (: (* " ") ; Allow space to precede the program name. + (| (: alpha (+ (in ?. ?- alnum)) ":" (? " ")) + ;; Skip indentation generated by GCC's -fanalyzer. + (: (+ " ") "|")))) ;; File name group. (group-n 1 @@ -387,13 +388,13 @@ of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2 nil (1)) ;; Line number group. (group-n 2 (regexp "[0-9]+")) (? (| (: "-" - (group-n 4 (regexp "[0-9]+")) ; ending line - (? "." (group-n 5 (regexp "[0-9]+")))) ; ending column + (group-n 4 (regexp "[0-9]+")) ; ending line + (? "." (group-n 5 (regexp "[0-9]+")))) ; ending column (: (in ".:") - (group-n 3 (regexp "[0-9]+")) ; starting column + (group-n 3 (regexp "[0-9]+")) ; starting column (? "-" (? (group-n 4 (regexp "[0-9]+")) ".") ; ending line - (group-n 5 (regexp "[0-9]+")))))) ; ending column + (group-n 5 (regexp "[0-9]+")))))) ; ending column ":" (| (: (* " ") (group-n 6 (| "FutureWarning" @@ -1243,7 +1244,7 @@ POS and RES.") ;; Return a property list with all meta information on this error location. (defun compilation-error-properties (file line end-line col end-col type fmt - rule) + rule) (unless (text-property-not-all (match-beginning 0) (point) 'compilation-message nil) (if file