diff options
| author | Daniel Mendler <mail@daniel-mendler.de> | 2023-08-08 15:35:02 +0200 |
|---|---|---|
| committer | Daniel Mendler <mail@daniel-mendler.de> | 2023-08-08 15:35:02 +0200 |
| commit | ddcccc4271803552fdf0ef27f24d133de804a14d (patch) | |
| tree | 77bc44f14e31a2cf344dd85c831fa7b7fce69592 | |
| parent | 0de9193ae5c35abc209209caeddc82de55cf87df (diff) | |
Introduce global-corfu-modesglobal-modes
| -rw-r--r-- | CHANGELOG.org | 2 | ||||
| -rw-r--r-- | README.org | 2 | ||||
| -rw-r--r-- | corfu.el | 15 |
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) @@ -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)) @@ -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 |
