GNU bug report logs - #74289
30.0.92; `require-with-check' fails on non-existing files

Previous Next

Package: emacs;

Reported by: Daniel Mendler <mail <at> daniel-mendler.de>

Date: Sun, 10 Nov 2024 08:44:01 UTC

Severity: normal

Found in version 30.0.92

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Daniel Mendler <mail <at> daniel-mendler.de>
Cc: 74289 <at> debbugs.gnu.org
Subject: bug#74289: 30.0.92; `require-with-check' fails on non-existing files
Date: Sun, 10 Nov 2024 12:38:51 -0500
> `require-with-check' fails since
> 0aae02a3741c397d6952e3128d434827aca0f912 on non-existing files.
>
> See the CI run of the Compat test suite:
>
> https://github.com/emacs-compat/compat/actions/runs/11763132765/job/32766767667
>
> This call fails:
>
> (require-with-check 'compat-does-not-exist nil 'noerror)

Oops, can you confirm that the patch below works for you?


        Stefan


diff --git a/lisp/files.el b/lisp/files.el
index c3fce9f15f9..0d998e6e18e 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -1288,10 +1306,11 @@ require-with-check
              ;; we did load "it".  (bug#74040)
              ;; So use a "permissive" search which doesn't pay attention to
              ;; differences between file extensions.
-             (prefix (if (string-match
-                          (concat (regexp-opt (get-load-suffixes)) "\\'") fn)
-                         (concat (substring fn 0 (match-beginning 0)) ".")
-                       fn))
+             (prefix (when fn
+                       (if (string-match
+                            (concat (regexp-opt (get-load-suffixes)) "\\'") fn)
+                           (concat (substring fn 0 (match-beginning 0)) ".")
+                         fn)))
              (lh load-history))
         (while (and lh (let ((file (car-safe (car lh))))
                          (not (and file (string-prefix-p prefix file)))))





This bug report was last modified 194 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.