summaryrefslogtreecommitdiff
path: root/corfu.el
diff options
context:
space:
mode:
authorDaniel Mendler <mail@daniel-mendler.de>2023-08-08 15:35:02 +0200
committerDaniel Mendler <mail@daniel-mendler.de>2023-08-08 15:35:02 +0200
commitddcccc4271803552fdf0ef27f24d133de804a14d (patch)
tree77bc44f14e31a2cf344dd85c831fa7b7fce69592 /corfu.el
parent0de9193ae5c35abc209209caeddc82de55cf87df (diff)
Introduce global-corfu-modesglobal-modes
Diffstat (limited to 'corfu.el')
-rw-r--r--corfu.el15
1 files changed, 6 insertions, 9 deletions
diff --git a/corfu.el b/corfu.el
index c6265db..a5b3135 100644
--- a/corfu.el
+++ b/corfu.el
@@ -123,10 +123,6 @@ separator: Only stay alive if there is no match and
`corfu-separator' has been inserted."
:type '(choice boolean (const separator)))
-(defcustom corfu-exclude-modes nil
- "List of modes excluded by `global-corfu-mode'."
- :type '(repeat symbol))
-
(defcustom corfu-left-margin-width 0.5
"Width of the left margin in units of the character width."
:type 'float)
@@ -1272,14 +1268,15 @@ Quit if no candidate is selected."
(kill-local-variable 'completion-in-region-function))))
;;;###autoload
-(define-globalized-minor-mode global-corfu-mode corfu-mode corfu--on :group 'corfu)
+(compat-call define-globalized-minor-mode global-corfu-mode
+ corfu-mode corfu--on
+ :predicate t
+ :group 'corfu)
(defun corfu--on ()
"Turn `corfu-mode' on."
- (unless (or noninteractive
- (eq (aref (buffer-name) 0) ?\s)
- (apply #'derived-mode-p corfu-exclude-modes))
- (corfu-mode 1)))
+ (unless (or noninteractive (eq (aref (buffer-name) 0) ?\s)
+ (corfu-mode 1))))
;; Emacs 28: Do not show Corfu commands with M-X
(dolist (sym '(corfu-next corfu-previous corfu-first corfu-last corfu-quit corfu-reset