branch: externals/vertico
commit b3c3850e3025efeeff12e8fc1efe25d00a96a58d
Author: Daniel Mendler <[email protected]>
Commit: Daniel Mendler <[email protected]>

    vertico-multiform-mode: Check state of modes during minibuffer setup
---
 extensions/vertico-multiform.el | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/extensions/vertico-multiform.el b/extensions/vertico-multiform.el
index afa9a7c4b5..91ffe1c216 100644
--- a/extensions/vertico-multiform.el
+++ b/extensions/vertico-multiform.el
@@ -132,11 +132,15 @@ The keys in LIST can be symbols or regexps."
          (push (if (keymapp key) key (apply #'define-keymap key)) kmaps))
         (`(:not . ,fs)
          (dolist (f fs)
-           (let ((sym (and (symbolp f) (intern-soft (format "vertico-%s-mode" 
f)))))
-             (push (cons :not (if (and sym (fboundp sym)) sym f)) modes))))
+           (let* ((sym (and (symbolp f) (intern-soft (format "vertico-%s-mode" 
f))))
+                  (mode (if (and sym (fboundp sym)) sym f)))
+             (when (or (not (symbolp mode)) (not (boundp mode)) (symbol-value 
mode))
+               (push (cons :not mode) modes)))))
         ((or (pred functionp) (pred symbolp))
-         (let ((sym (and (symbolp x) (intern-soft (format "vertico-%s-mode" 
x)))))
-           (push (if (and sym (fboundp sym)) sym x) modes)))
+         (let* ((sym (and (symbolp x) (intern-soft (format "vertico-%s-mode" 
x))))
+                (mode (if (and sym (fboundp sym)) sym x)))
+           (when (or (not (symbolp mode)) (not (boundp mode)) (not 
(symbol-value mode)))
+             (push mode modes))))
         (`(,k . ,v) (set (make-local-variable k) v))
         (_ (error "Invalid multiform setting %S" x))))
     (push modes vertico-multiform--stack)

Reply via email to