summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.org2
-rw-r--r--README.org2
-rw-r--r--corfu.el15
3 files changed, 9 insertions, 10 deletions
diff --git a/CHANGELOG.org b/CHANGELOG.org
index 6aecdf0..8c91f23 100644
--- a/CHANGELOG.org
+++ b/CHANGELOG.org
@@ -6,6 +6,8 @@
- =corfu-quick=: Bugfix.
- =corfu-mode-map=: Add mode map.
+- =global-corfu-mode=: Add =global-corfu-modes= mode predicate variable. Replaces
+ =corfu-exclude-modes=.
* Version 0.37 (2023-07-02)
diff --git a/README.org b/README.org
index 3d1d29c..6337826 100644
--- a/README.org
+++ b/README.org
@@ -100,7 +100,7 @@ Here is an example configuration:
;; Recommended: Enable Corfu globally.
;; This is recommended since Dabbrev can be used globally (M-/).
- ;; See also `corfu-exclude-modes'.
+ ;; See also `global-corfu-modes'.
:init
(global-corfu-mode))
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