From 7601a77d8a6ab567bd221777ca2964c934e1e4b9 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Fri, 6 May 2022 14:14:31 +0200 Subject: [PATCH] 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 6753cf0b027..2c5f4687ac7 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)) -- 2.39.2