diff --git a/lisp/emacs-lisp/crm.el b/lisp/emacs-lisp/crm.el index 425a606cb12..f1e5e4fc63e 100644 --- a/lisp/emacs-lisp/crm.el +++ b/lisp/emacs-lisp/crm.el @@ -285,7 +285,8 @@ with empty strings removed." (unless (eq require-match t) require-match)) (setq-local minibuffer--require-match require-match) (setq-local minibuffer--original-buffer buffer) - (setq-local crm-completion-table table)) + (setq-local crm-completion-table table) + (completions--start-eager-display)) (setq input (read-from-minibuffer (format-spec crm-prompt diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 43fe2dd196d..6e2dce2844f 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -2767,9 +2767,19 @@ so that the update is less likely to interfere with user typing." (completions--start-eager-display)))) (defun completions--start-eager-display () - "Display the *Completions* buffer when the user is next idle." - (setq completion-eager-display--timer - (run-with-idle-timer 0 nil #'completions--eager-display))) + "Maybe display the *Completions* buffer when the user is next idle. + +Only displays if `completion-eager-display' is t, or if eager display +has been requested by the completion table." + (when completion-eager-display + (when (or (eq completion-eager-display t) + (completion-metadata-get + (completion-metadata + (buffer-substring-no-properties (minibuffer-prompt-end) (point)) + minibuffer-completion-table minibuffer-completion-predicate) + 'eager-display)) + (setq completion-eager-display--timer + (run-with-idle-timer 0 nil #'completions--eager-display))))) (defun completions--post-command-update () "Update displayed *Completions* buffer after command, once." @@ -5159,18 +5169,7 @@ See `completing-read' for the meaning of the arguments." (setq-local minibuffer--original-buffer buffer) ;; Copy the value from original buffer to the minibuffer. (setq-local completion-ignore-case c-i-c) - ;; Show the completion help eagerly if - ;; `completion-eager-display' is t or if eager display - ;; has been requested by the completion table. - (when completion-eager-display - (when (or (eq completion-eager-display t) - (completion-metadata-get - (completion-metadata - (buffer-substring-no-properties - (minibuffer-prompt-end) (point)) - collection predicate) - 'eager-display)) - (completions--start-eager-display)))) + (completions--start-eager-display)) (read-from-minibuffer prompt initial-input keymap nil hist def inherit-input-method)))) (when (and (equal result "") def)