From 969e30c9396c64cf869594918e7c044f6c222517 Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Thu, 4 Jan 2024 16:24:26 +0100 Subject: [PATCH] ; Fix completions restriction descriptions with boundaries * lisp/minibuffer.el (minibuffer-narrow-completions-to-current): Respect completion boundaries when formatting restriction description. --- lisp/minibuffer.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index b2529d9595c..2722656c418 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -5172,6 +5172,7 @@ exclude matches to current input from completions list." (let* ((table (make-hash-table :test #'equal)) (beg-end (minibuffer--completion-boundaries)) (beg (car beg-end)) (end (cdr beg-end)) + (current (buffer-substring beg end)) (start (minibuffer-prompt-end)) (input (buffer-substring start (point-max))) (all (completion-all-completions @@ -5195,7 +5196,7 @@ exclude matches to current input from completions list." ((symbolp cand) (symbol-name cand)) (t (car cand))))) (not (gethash key table)))) - (concat "excluding matches for " (prin1-to-string input))) + (concat "excluding matches for " (prin1-to-string current))) (minibuffer--add-completions-predicate (lambda (cand &rest _) (let ((key (cond @@ -5203,7 +5204,7 @@ exclude matches to current input from completions list." ((symbolp cand) (symbol-name cand)) (t (car cand))))) (gethash key table))) - (concat "narrowing to " (prin1-to-string input)))))) + (concat "narrowing to " (prin1-to-string current)))))) (defun minibuffer-widen-completions (&optional all) "Remove restrictions on current minibuffer completions list. -- 2.39.2