]> git.eshelyaron.com Git - emacs.git/commitdiff
Don't do compilation-transform-file-match-alist if there's no file name
authorLars Ingebrigtsen <larsi@gnus.org>
Tue, 27 Oct 2020 09:17:13 +0000 (10:17 +0100)
committerLars Ingebrigtsen <larsi@gnus.org>
Tue, 27 Oct 2020 09:17:13 +0000 (10:17 +0100)
* 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

index 9188a08e780b3421db65f4b999e286f87bcaf205..de0ea428d5eaeefdea3e7c6e1c39a37b6cab3051 100644 (file)
@@ -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)