| 1 | From 631df3f68c79cca2a26bc8ea1a98a332ef53751e Mon Sep 17 00:00:00 2001
|
| 2 | Message-ID: <631df3f68c79cca2a26bc8ea1a98a332ef53751e.1790072851.git.csantosb@disroot.org>
|
| 3 | From: "Basil L. Contovounesios" <[email protected]>
|
| 4 | Date: Mon, 9 Mar 2026 22:02:11 +0100
|
| 5 | Subject: [PATCH] Avoid nil predicate with cl-remove-if-not
|
| 6 |
|
| 7 | Emacs 31 no longer silently accepts a nil predicate.
|
| 8 |
|
| 9 | * ivy.el (ivy--reset-state): Skip alist filtering in the absence of
|
| 10 | a predicate.
|
| 11 | ---
|
| 12 | ivy.el | 3 ++-
|
| 13 | 1 file changed, 2 insertions(+), 1 deletion(-)
|
| 14 |
|
| 15 | diff --git a/ivy.el b/ivy.el
|
| 16 | index a6aca7a..9d5f805 100644
|
| 17 | |
| 18 | |
| 19 | @@ -2497,7 +2497,8 @@ This is useful for recursive `ivy-read'."
|
| 20 | ivy--all-candidates
|
| 21 | (ivy--dynamic-collection-cands (or initial-input "")))))
|
| 22 | ((consp (car-safe collection))
|
| 23 | - (setq collection (cl-remove-if-not predicate collection))
|
| 24 | + (when predicate
|
| 25 | + (setq collection (cl-remove-if-not predicate collection)))
|
| 26 | (when (and sort (setq sort-fn (ivy--sort-function caller)))
|
| 27 | (setq collection (sort (copy-sequence collection) sort-fn))
|
| 28 | (setq sort nil))
|
| 29 | --
|
| 30 | 2.54.0
|
| 31 |
|