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=db48de9c05b296bba8c455cbd6f4078e781839b8;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 3514dd4b5ec..2e77d9968ec 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -5168,6 +5168,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 @@ -5191,7 +5192,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 @@ -5199,7 +5200,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.