From b4cb492ebe4c7905b83bfbcd81e6bc8385d0a760 Mon Sep 17 00:00:00 2001 From: Jim Porter Date: Sat, 11 Nov 2023 13:26:44 -0800 Subject: [PATCH] Forward completion text properties when using 'completion-table-with-quoting' This fixes an issue with 'pcomplete-here-using-help', which passes annotation strings along as text properties. Previously, those got clobbered when the completions got requoted. * lisp/minibuffer.el (completion--twq-all): Apply text properties from the first character of the unquoted completion to the quoted completion. --- lisp/minibuffer.el | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 3e2e3b6c6f2..fc75cd9cb66 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -677,6 +677,13 @@ completion--twq-all 'completions-common-part) qprefix)))) (qcompletion (concat qprefix qnew))) + ;; Some completion tables (including this one) pass + ;; along necessary information as text properties + ;; on the first character of the completion. Make + ;; sure the quoted completion has these properties + ;; too. + (add-text-properties 0 1 (text-properties-at 0 completion) + qcompletion) ;; Attach unquoted completion string, which is needed ;; to score the completion in `completion--flex-score'. (put-text-property 0 1 'completion--unquoted -- 2.25.1