From fd894df715ab2b26456ee79ffc9e3e2cabe8e7b0 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 1 Jul 2025 16:55:14 -0400 Subject: [PATCH] (load-path-filter): Loading can happen in the middle of completion * 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 | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/lisp/startup.el b/lisp/startup.el index 5c28084e9bc..2568f0e8ba2 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -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'. -- 2.39.5