From 254c3d7b1ae8224d305aff7f55817c6fd9fca1c5 Mon Sep 17 00:00:00 2001 From: Daniel Mendler Date: Sun, 15 Dec 2024 10:57:59 +0100 Subject: [PATCH] completion-eager-display: Use buffer content instead of INITIAL-INPUT * lisp/minibuffer.el (completing-read-default): Use the minibuffer content instead of handling INITIAL-INPUT directly. --- lisp/minibuffer.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index dfc62c25f38..91495f9f941 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -4857,8 +4857,10 @@ completing-read-default ;; `completion-eager-display' is t or if eager display ;; has been requested by the completion table. (when completion-eager-display - (let* ((md (completion-metadata (or initial-input "") - collection predicate)) + (let* ((md (completion-metadata + (buffer-substring-no-properties + (minibuffer-prompt-end) (point)) + collection predicate)) (fun (completion-metadata-get md 'eager-display))) (when (or fun (eq completion-eager-display t)) (funcall (if (functionp fun) -- 2.45.2