From faeb9a17186e6c6acf06eeace56701a21f7beff5 Mon Sep 17 00:00:00 2001 From: Daniel Mendler Date: Thu, 10 Aug 2023 12:30:10 +0200 Subject: Fix condition --- corfu.el | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/corfu.el b/corfu.el index 65bb569..4626e5e 100644 --- a/corfu.el +++ b/corfu.el @@ -1280,16 +1280,15 @@ symbols or elements of the form (not modes)." (defun corfu--on () "Turn `corfu-mode' on." - (unless (or noninteractive - (eq (aref (buffer-name) 0) ?\s) - ;; TODO backport `easy-mmode--globalized-predicate-p' - (eq t global-corfu-modes) - (eq t (cl-loop for p in global-corfu-modes thereis - (pcase-exhaustive p - ('t t) - ('nil 0) - ((pred symbolp) (and (derived-mode-p p) t)) - (`(not . ,m) (and (apply #'derived-mode-p m) 0)))))) + (when (and (not (or noninteractive (eq (aref (buffer-name) 0) ?\s))) + ;; TODO backport `easy-mmode--globalized-predicate-p' + (or (eq t global-corfu-modes) + (eq t (cl-loop for p in global-corfu-modes thereis + (pcase-exhaustive p + ('t t) + ('nil 0) + ((pred symbolp) (and (derived-mode-p p) t)) + (`(not . ,m) (and (apply #'derived-mode-p m) 0))))))) (corfu-mode 1))) ;; Emacs 28: Do not show Corfu commands with M-X -- cgit v1.0