emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master e4df6203e2 3/3: More robust `gnu` pattern (bug#56249)


From: Mattias Engdegård
Subject: master e4df6203e2 3/3: More robust `gnu` pattern (bug#56249)
Date: Wed, 29 Jun 2022 11:29:17 -0400 (EDT)

branch: master
commit e4df6203e27fbb4458fda21f029f90a114465c1a
Author: Mattias Engdegård <mattiase@acm.org>
Commit: Mattias Engdegård <mattiase@acm.org>

    More robust `gnu` pattern (bug#56249)
    
    * lisp/progmodes/compile.el (compilation-error-regexp-alist-alist):
    Don't allow spaces in the file names, to avoid false matches.
    Don't allow ad-hoc spaces preceding the program name either.
---
 lisp/progmodes/compile.el | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 3393aa9b63..db57093559 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -368,17 +368,18 @@ of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2 nil (1))
        ;; Match an optional program name which is used for
        ;; non-interactive programs other than compilers (e.g. the
        ;; "jade:" entry in compilation.txt).
-       (? (: (* " ")        ; Allow space to precede the program name.
-             (| (: alpha (+ (in ?. ?- alnum)) ":" (? " "))
-                ;; Skip indentation generated by GCC's -fanalyzer.
-                (: (+ " ") "|"))))
+       (? (| (: alpha (+ (in ?. ?- alnum)) ":" (? " "))
+             ;; Skip indentation generated by GCC's -fanalyzer.
+             (: (+ " ") "|")))
 
        ;; File name group.
        (group-n 1
          ;; Avoid matching the file name as a program in the pattern
          ;; above by disallowing file names entirely composed of digits.
-         (* (in "0-9"))
-         (not (in "0-9" "\n"))
+         ;; Do not allow file names beginning with a space.
+         (| (not (in "0-9" "\n\t "))
+            (: (+ (in "0-9"))
+               (not (in "0-9" "\n"))))
          ;; A file name can be composed of any non-newline char, but
          ;; rule out some valid but unlikely cases, such as a trailing
          ;; space or a space followed by a -, or a colon followed by a



reply via email to

[Prev in Thread] Current Thread [Next in Thread]