branch: externals/vertico commit 28e5a19fcf89733d0e34b701772f034a40fb4ec9 Author: Daniel Mendler <m...@daniel-mendler.de> Commit: Daniel Mendler <m...@daniel-mendler.de>
Disable completion-eager-display if Vertico is active (Emacs 31) --- CHANGELOG.org | 1 + README.org | 18 ++++++++---------- extensions/vertico-multiform.el | 2 +- vertico.el | 3 ++- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.org b/CHANGELOG.org index ee7236a82c..112d67fbbb 100644 --- a/CHANGELOG.org +++ b/CHANGELOG.org @@ -6,6 +6,7 @@ - =vertico-multiform-mode=: Add =:keymap= setting per command or completion category. Either specify a list of key bindings or a keymap directly. +- Disable =completion-eager-display= if Vertico is active. * Version 2.3 (2025-06-10) diff --git a/README.org b/README.org index dcf07be8a1..bb2dfaea31 100644 --- a/README.org +++ b/README.org @@ -213,10 +213,10 @@ even use Corfu in the minibuffer. The function ~completing-read-multiple~ is similar to ~completing-read~ but returns a list of completed strings. The strings are separated by ~crm-separator~ in the -minibuffer. However ~completing-read-multiple~ does not indicate to the user that -multiple strings can be completed. I have contributed a patch to Emacs 31, which -fixes this minor issue. See the variable ~crm-prompt~ and [[https://debbugs.gnu.org/cgi/bugreport.cgi?bug=76028][bug#76028]]. On older -Emacs versions you can use the following: +minibuffer. On Emacs 30 and older, ~completing-read-multiple~ does not indicate to +the user that multiple strings can be completed. I have contributed a patch to +Emacs 31, which fixes this issue. See the variable ~crm-prompt~ and [[https://debbugs.gnu.org/cgi/bugreport.cgi?bug=76028][bug#76028]]. On +older Emacs versions you can use the following advice: #+begin_src emacs-lisp ;; Prompt indicator for `completing-read-multiple'. @@ -588,9 +588,8 @@ can be completed separately. Ideally this issue would be fixed in Org. ** ~tmm-menubar~ -*NOTE*: I have implemented a fix for this problem which is part of Emacs 31. You -can set ~completion-eager-display~ to ~nil~ in your configuration. See [[https://debbugs.gnu.org/cgi/bugreport.cgi?bug=74616][bug#74616]] for -the upstream bug report. +*NOTE*: I have implemented a fix for this problem upstream in Emacs, see +[[https://debbugs.gnu.org/cgi/bugreport.cgi?bug=74616][bug#74616]]. From Emacs 31 and newer the workaround is not needed anymore. The text menu bar works well with Vertico but always shows a =*Completions*= buffer, which is unwanted if Vertico is used. Right now the completion buffer @@ -604,9 +603,8 @@ prefer the Vertico interface you may also overwrite the default F10 keybinding. ** ~ffap-menu~ -*NOTE*: I have implemented a fix for this problem which is part of Emacs 31. You -can set ~completion-eager-display~ to ~nil~ in your configuration. See [[https://debbugs.gnu.org/cgi/bugreport.cgi?bug=74616][bug#74616]] for -the upstream bug report. +*NOTE*: I have implemented a fix for this problem upstream in Emacs, see +[[https://debbugs.gnu.org/cgi/bugreport.cgi?bug=74616][bug#74616]]. From Emacs 31 and newer the workaround is not needed anymore. The command ~ffap-menu~ shows the =*Completions*= buffer by default like ~tmm-menubar~, which is unwanted if Vertico is used. The completions buffer can be diff --git a/extensions/vertico-multiform.el b/extensions/vertico-multiform.el index 9c396b313f..25cbb56a78 100644 --- a/extensions/vertico-multiform.el +++ b/extensions/vertico-multiform.el @@ -172,7 +172,7 @@ The keys in LIST can be symbols or regexps." (cl-defmethod vertico--advice (&context (vertico-multiform-mode (eql t)) &rest app) (unwind-protect - (progn + (dlet ((completion-eager-display nil)) ;; Available on Emacs 31 (vertico-multiform--toggle -1) (minibuffer-with-setup-hook #'vertico-multiform--setup (apply app))) diff --git a/vertico.el b/vertico.el index 18920c8e07..e16afe5139 100644 --- a/vertico.el +++ b/vertico.el @@ -622,7 +622,8 @@ the stack trace is shown in the *Messages* buffer." (cl-defgeneric vertico--advice (&rest app) "Advice for completion function, apply APP." - (minibuffer-with-setup-hook #'vertico--setup (apply app))) + (dlet ((completion-eager-display nil)) ;; Available on Emacs 31 + (minibuffer-with-setup-hook #'vertico--setup (apply app)))) (defun vertico-first () "Go to first candidate, or to the prompt when the first candidate is selected."