From 8d3ed5f815de0e12fb11f809d295c2820643295d Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Tue, 27 Oct 2020 10:17:13 +0100 Subject: [PATCH] Don't do compilation-transform-file-match-alist if there's no file name * lisp/progmodes/compile.el (compilation-error-properties): There may not be a file name (bug#40111). In that case, don't do the `compilation-transform-file-match-alist' thing. --- lisp/progmodes/compile.el | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 9188a08e780..de0ea428d5e 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -1242,12 +1242,12 @@ POS and RES.") 2))) ;; Remove matches like /bin/sh and do other file name transforms. (save-match-data - (let ((file-name - (and (consp file) - (not (bufferp (car file))) - (if (cdr file) - (expand-file-name (car file) (cdr file)) - (car file))))) + (when-let ((file-name + (and (consp file) + (not (bufferp (car file))) + (if (cdr file) + (expand-file-name (car file) (cdr file)) + (car file))))) (cl-loop for (regexp replacement) in compilation-transform-file-match-alist when (string-match regexp file-name) -- 2.39.2