emacs-diffs
[Top][All Lists]
Advanced

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

master 7601a77d8a: Make compilation-parse-errors more resilient


From: Lars Ingebrigtsen
Subject: master 7601a77d8a: Make compilation-parse-errors more resilient
Date: Fri, 6 May 2022 08:15:25 -0400 (EDT)

branch: master
commit 7601a77d8a6ab567bd221777ca2964c934e1e4b9
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Make compilation-parse-errors more resilient
    
    * lisp/progmodes/compile.el (compilation-parse-errors): Be more
    resilient in the presence of regexp alist not being completely set
    up (bug#55282).
---
 lisp/progmodes/compile.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 6753cf0b02..2c5f4687ac 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -1520,7 +1520,8 @@ to `compilation-error-regexp-alist' if RULES is nil."
         ;; FIXME-omake: Doing it here seems wrong, at least it should depend on
         ;; whether or not omake's own error messages are recognized.
         (cond
-         ((not omake-included) nil)
+         ((or (not omake-included) (not pat))
+          nil)
          ((string-match "\\`\\([^^]\\|\\^\\( \\*\\|\\[\\)\\)" pat)
           nil) ;; Not anchored or anchored but already allows empty spaces.
          (t (setq pat (concat "^\\(?:      \\)?" (substring pat 1)))))
@@ -1539,7 +1540,7 @@ to `compilation-error-regexp-alist' if RULES is nil."
           (error "HYPERLINK should be an integer: %s" (nth 5 item)))
 
         (goto-char start)
-        (while (re-search-forward pat end t)
+        (while (and pat (re-search-forward pat end t))
           (when (setq props (compilation-error-properties
                              file line end-line col end-col
                              (or type 2) fmt rule))



reply via email to

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