From: Eshel Yaron Date: Thu, 4 Jan 2024 15:24:26 +0000 (+0100) Subject: ; Fix completions restriction descriptions with boundaries X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=969e30c9396c64cf869594918e7c044f6c222517;p=emacs.git ; Fix completions restriction descriptions with boundaries * lisp/minibuffer.el (minibuffer-narrow-completions-to-current): Respect completion boundaries when formatting restriction description. --- 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.