branch: externals/corfu commit 12c30824b3d177cc3a65eba440c5cf499e06017a Author: Daniel Mendler <m...@daniel-mendler.de> Commit: Daniel Mendler <m...@daniel-mendler.de>
Require Emacs 28.1 --- CHANGELOG.org | 4 ++++ README.org | 6 +++--- corfu.el | 28 ++++++---------------------- extensions/corfu-echo.el | 2 +- extensions/corfu-history.el | 2 +- extensions/corfu-indexed.el | 2 +- extensions/corfu-info.el | 2 +- extensions/corfu-popupinfo.el | 4 ++-- extensions/corfu-quick.el | 2 +- 9 files changed, 20 insertions(+), 32 deletions(-) diff --git a/CHANGELOG.org b/CHANGELOG.org index 907890687f..96cd7d7a19 100644 --- a/CHANGELOG.org +++ b/CHANGELOG.org @@ -2,6 +2,10 @@ #+author: Daniel Mendler #+language: en +* Development + +- Require Emacs 28.1. + * Version 1.5 (2024-07-26) - New customization variable =global-corfu-minibuffer= to enable Corfu in the diff --git a/README.org b/README.org index 1e68ec8d8d..ab4ed4e389 100644 --- a/README.org +++ b/README.org @@ -146,9 +146,9 @@ Here is an example configuration: ;; try `cape-dict'. (text-mode-ispell-word-completion nil) - ;; Emacs 28 and newer: Hide commands in M-x which do not apply to the current - ;; mode. Corfu commands are hidden, since they are not used via M-x. This - ;; setting is useful beyond Corfu. + ;; Hide commands in M-x which do not apply to the current mode. Corfu + ;; commands are hidden, since they are not used via M-x. This setting is + ;; useful beyond Corfu. (read-extended-command-predicate #'command-completion-default-include-p)) #+end_src diff --git a/corfu.el b/corfu.el index e96c569af7..a668ae330c 100644 --- a/corfu.el +++ b/corfu.el @@ -6,7 +6,7 @@ ;; Maintainer: Daniel Mendler <m...@daniel-mendler.de> ;; Created: 2021 ;; Version: 1.5 -;; Package-Requires: ((emacs "27.1") (compat "30")) +;; Package-Requires: ((emacs "28.1") (compat "30")) ;; Homepage: https://github.com/minad/corfu ;; Keywords: abbrev, convenience, matching, completion, text @@ -340,7 +340,7 @@ See also the settings `corfu-auto-delay', `corfu-auto-prefix' and '((mode-line-format . nil) (header-line-format . nil) (tab-line-format . nil) - (tab-bar-format . nil) ;; Emacs 28 tab-bar-format + (tab-bar-format . nil) (frame-title-format . "") (truncate-lines . t) (cursor-in-non-selected-windows . nil) @@ -629,7 +629,7 @@ FRAME is the existing frame." (after (substring str pt)) (corfu--metadata (completion-metadata before table pred)) ;; bug#47678: `completion-boundaries' fails for `partial-completion' - ;; if the cursor is moved between the slashes of "~//". + ;; if the cursor is moved before the slashes of "~//". ;; See also vertico.el which has the same issue. (bounds (condition-case nil (completion-boundaries before table pred after) @@ -1347,15 +1347,6 @@ Quit if no candidate is selected." (remove-hook 'post-command-hook #'corfu--auto-post-command 'local) (kill-local-variable 'completion-in-region-function)))) -(defcustom global-corfu-modes t - "List of modes where Corfu should be enabled by `global-corfu-mode'. -The variable can either be t, nil or a list of t, nil, mode -symbols or elements of the form (not modes). Examples: - - Enable everywhere, except in Org: ((not org-mode) t). - - Enable in programming modes except Python: ((not python-mode) prog-mode). - - Enable only in text modes: (text-mode)." - :type '(choice (const t) (repeat sexp))) - (defcustom global-corfu-minibuffer t "Corfu should be enabled in the minibuffer by `global-corfu-mode'. The variable can either be t, nil or a custom predicate function. If @@ -1366,6 +1357,7 @@ local `completion-at-point-functions'." ;;;###autoload (define-globalized-minor-mode global-corfu-mode corfu-mode corfu--on + :predicate t :group 'corfu (remove-hook 'minibuffer-setup-hook #'corfu--minibuffer-on) (when (and global-corfu-mode global-corfu-minibuffer) @@ -1373,15 +1365,7 @@ local `completion-at-point-functions'." (defun corfu--on () "Enable `corfu-mode' in the current buffer respecting `global-corfu-modes'." - (when (and (not noninteractive) (not (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 (seq-some #'derived-mode-p m) 0))))))) + (unless (or noninteractive (eq (aref (buffer-name) 0) ?\s)) (corfu-mode 1))) (defun corfu--minibuffer-on () @@ -1392,7 +1376,7 @@ local `completion-at-point-functions'." (local-variable-p 'completion-at-point-functions))) (corfu-mode 1))) -;; Emacs 28: Do not show Corfu commands with M-X +;; Do not show Corfu commands with M-X (dolist (sym '(corfu-next corfu-previous corfu-first corfu-last corfu-quit corfu-reset corfu-complete corfu-insert corfu-scroll-up corfu-scroll-down corfu-expand corfu-send corfu-insert-separator corfu-prompt-beginning corfu-prompt-end diff --git a/extensions/corfu-echo.el b/extensions/corfu-echo.el index b97f46e1b7..8175d472cc 100644 --- a/extensions/corfu-echo.el +++ b/extensions/corfu-echo.el @@ -6,7 +6,7 @@ ;; Maintainer: Daniel Mendler <m...@daniel-mendler.de> ;; Created: 2022 ;; Version: 1.5 -;; Package-Requires: ((emacs "27.1") (compat "30") (corfu "1.5")) +;; Package-Requires: ((emacs "28.1") (compat "30") (corfu "1.5")) ;; Homepage: https://github.com/minad/corfu ;; This file is part of GNU Emacs. diff --git a/extensions/corfu-history.el b/extensions/corfu-history.el index cf7a872868..7c394ed0fe 100644 --- a/extensions/corfu-history.el +++ b/extensions/corfu-history.el @@ -6,7 +6,7 @@ ;; Maintainer: Daniel Mendler <m...@daniel-mendler.de> ;; Created: 2022 ;; Version: 1.5 -;; Package-Requires: ((emacs "27.1") (compat "30") (corfu "1.5")) +;; Package-Requires: ((emacs "28.1") (compat "30") (corfu "1.5")) ;; Homepage: https://github.com/minad/corfu ;; This file is part of GNU Emacs. diff --git a/extensions/corfu-indexed.el b/extensions/corfu-indexed.el index 7e71855a9d..c216a6ee75 100644 --- a/extensions/corfu-indexed.el +++ b/extensions/corfu-indexed.el @@ -6,7 +6,7 @@ ;; Maintainer: Daniel Mendler <m...@daniel-mendler.de> ;; Created: 2022 ;; Version: 1.5 -;; Package-Requires: ((emacs "27.1") (compat "30") (corfu "1.5")) +;; Package-Requires: ((emacs "28.1") (compat "30") (corfu "1.5")) ;; Homepage: https://github.com/minad/corfu ;; This file is part of GNU Emacs. diff --git a/extensions/corfu-info.el b/extensions/corfu-info.el index 3dbc41d6a0..64b17aadc5 100644 --- a/extensions/corfu-info.el +++ b/extensions/corfu-info.el @@ -6,7 +6,7 @@ ;; Maintainer: Daniel Mendler <m...@daniel-mendler.de> ;; Created: 2022 ;; Version: 1.5 -;; Package-Requires: ((emacs "27.1") (compat "30") (corfu "1.5")) +;; Package-Requires: ((emacs "28.1") (compat "30") (corfu "1.5")) ;; Homepage: https://github.com/minad/corfu ;; This file is part of GNU Emacs. diff --git a/extensions/corfu-popupinfo.el b/extensions/corfu-popupinfo.el index fcbd2f7c6f..b8d9656d00 100644 --- a/extensions/corfu-popupinfo.el +++ b/extensions/corfu-popupinfo.el @@ -6,7 +6,7 @@ ;; Maintainer: Daniel Mendler <m...@daniel-mendler.de> ;; Created: 2022 ;; Version: 1.5 -;; Package-Requires: ((emacs "27.1") (compat "30") (corfu "1.5")) +;; Package-Requires: ((emacs "28.1") (compat "30") (corfu "1.5")) ;; Homepage: https://github.com/minad/corfu ;; This file is part of GNU Emacs. @@ -514,7 +514,7 @@ not be displayed until this command is called again, even if (cl-loop for (k . v) in corfu-popupinfo--initial-state do (set k v)) (cl-callf2 assq-delete-all #'corfu-popupinfo-mode minor-mode-overriding-map-alist)) -;; Emacs 28: Do not show Corfu commands with M-X +;; Do not show Corfu commands with M-X (dolist (sym '(corfu-popupinfo-scroll-down corfu-popupinfo-scroll-up corfu-popupinfo-documentation corfu-popupinfo-location corfu-popupinfo-beginning corfu-popupinfo-end diff --git a/extensions/corfu-quick.el b/extensions/corfu-quick.el index 82b728ee4d..974ab9f0f0 100644 --- a/extensions/corfu-quick.el +++ b/extensions/corfu-quick.el @@ -6,7 +6,7 @@ ;; Maintainer: Daniel Mendler <m...@daniel-mendler.de> ;; Created: 2022 ;; Version: 1.5 -;; Package-Requires: ((emacs "27.1") (compat "30") (corfu "1.5")) +;; Package-Requires: ((emacs "28.1") (compat "30") (corfu "1.5")) ;; Homepage: https://github.com/minad/corfu ;; This file is part of GNU Emacs.