Subject: bug#78149: 31.0.50; find-file not working (cl-remove-if)

From: Spencer Baugh <[email-masked]>
Date: Wed, 30 Apr 2025 09:37:41 -0400

Eli Zaretskii <[email-masked]> writes:
>> Date: Wed, 30 Apr 2025 08:11:14 -0300
>> Cc: [email-masked]
>> From: German Pacenza <[email-masked]>
>> 
>> 
>> > I cannot reproduce this with today's master branch.  cl-remove-if is
>> > an autoloaded function, so I suspect that your loaddefs.el is outdated
>> > or something.  Try regenerating loaddefs.el and then redumping:
>> > 
>> >   $ make -C lisp autoloads-force
>> >   $ make
>> 
>> Same result, I also did a 'git clean -fdx' 'make reset --hard HEAD' 
>> 'make extraclean' and 'make bootstrap'
>> 
>> 
>> emacs -Q:
>> C-x C-f "shows error"
>> run 'bookmark-jump" C-g
>> C-x C-f "Works as expected"
>> 
>> I added (autoload 'cl-remove-if "cl-seq" nil t) to my init file and that 
>> fixes the issue
>
> Ah, I see.
>
> Spencer, please replace cl-remove-if with seq-remove or something else
> that is available when minibuffer.el is preloaded by loadup.  Calling
> cl-seq functions in preloaded files is a no-no, because the
> corresponding autoloads are not in loaddefs.el, they are in
> cl-loaddefs.el instead, and that file is not loaded until cl-lib is.

Ah, I see.  Apologies for the breakage.  Done in the attached patch.

>From edaef1805c9dc9bf6924596df89a37a117d0cfda Mon Sep 17 00:00:00 2001
From: Spencer Baugh <[email-masked]>
Date: Wed, 30 Apr 2025 09:35:29 -0400
Subject: [PATCH] Replace cl-remove-if with seq-remove in minibuffer.el

* lisp/minibuffer.el (completion--file-name-table): Replace
cl-remove-if with seq-remove. (bug#78149)
---
 lisp/minibuffer.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index bb9966d82dc..7b2b986aa1d 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -3603,8 +3603,8 @@ completion--file-name-table
                      ;; expansion, so regexps containing $ won't work.  Drop
                      ;; them; we'll return more completions, but callers need to
                      ;; handle that anyway.
-                     (cl-remove-if (lambda (regexp) (string-search "$" regexp))
-                                   completion-regexp-list)))
+                     (seq-remove (lambda (regexp) (string-search "$" regexp))
+                                 completion-regexp-list)))
                 (complete-with-action action table sifned pred))))
         (cond
          ((null action)                 ; try-completion
-- 
2.39.3