summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Mendler <mail@daniel-mendler.de>2023-08-10 12:30:10 +0200
committerDaniel Mendler <mail@daniel-mendler.de>2023-08-10 12:30:10 +0200
commitfaeb9a17186e6c6acf06eeace56701a21f7beff5 (patch)
tree0e698f7ee2333ca84cd95d22466fea64d1a364a4
parent099e27d9b4782f912effa1d4964f7625984bb2b7 (diff)
Fix condition
-rw-r--r--corfu.el19
1 files 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