From e73dbcf26d9de114b3ba228edaf946418b476052 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Wed, 29 Jun 2022 11:53:16 +0200 Subject: [PATCH] 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). --- lisp/progmodes/compile.el | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) 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 -- 2.39.2