]> git.eshelyaron.com Git - emacs.git/commitdiff
(load-path-filter): Loading can happen in the middle of completion
authorStefan Monnier <monnier@iro.umontreal.ca>
Tue, 1 Jul 2025 20:55:14 +0000 (16:55 -0400)
committerEshel Yaron <me@eshelyaron.com>
Wed, 23 Jul 2025 20:12:22 +0000 (22:12 +0200)
* lisp/startup.el (load-path-filter-cache-directory-files):
Don't get confused by the context's `completion-regexp-list`.

(cherry picked from commit b3b83b3603e9922c48eb782102933c6ac7fd16e9)

lisp/startup.el

index 5c28084e9bc53b6b9686f6e24c2aeb687ac6a845..2568f0e8ba2c3bcf8f42c130338d158722ff5940 100644 (file)
@@ -1140,14 +1140,15 @@ This function is called from `load' via `load-path-filter-function'."
                     (make-hash-table :test #'equal))))))
       (if (null ht)
           path
-        (seq-filter
-         (lambda (dir)
-           (when (file-directory-p dir)
-             (try-completion
-              file
-              (with-memoization (gethash dir ht)
-                (directory-files dir nil rx t)))))
-         path)))))
+        (let ((completion-regexp-list nil))
+          (seq-filter
+           (lambda (dir)
+             (when (file-directory-p dir)
+               (try-completion
+                file
+                (with-memoization (gethash dir ht)
+                  (directory-files dir nil rx t)))))
+           path))))))
 
 (defun command-line ()
   "A subroutine of `normal-top-level'.