From 6e08e7183328635d144f8bd642c9c3aeba140856 Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Wed, 1 Nov 2023 22:47:02 +0100 Subject: [PATCH] Only keep the ':exit-function' completion property Avoid passing on properties such as ':predicate', whose value may be a function that assume a certain structure of completion candidate, which may no longer hold. * completion-preview.el (completion-preview-show): Only keep the ':exit-function' property. --- completion-preview.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/completion-preview.el b/completion-preview.el index 9c6b8ea..36ffb6e 100644 --- a/completion-preview.el +++ b/completion-preview.el @@ -113,6 +113,7 @@ Compatibility definition for `minibuffer--sort-by-length-alpha'." (pcase res (`(,_ ,beg ,end ,table . ,plist) (let* ((pred (plist-get plist :predicate)) + (exit-fn (plist-get plist :exit-function)) (string (buffer-substring beg end)) (md (completion-metadata string table pred)) (sort-fn (or (completion-metadata-get md 'cycle-sort-function) @@ -138,7 +139,7 @@ Compatibility definition for `minibuffer--sort-by-length-alpha'." (setq completion-preview--overlay (make-overlay end end)) (overlay-put completion-preview--overlay 'after-string after) (overlay-put completion-preview--overlay 'completion-preview-data - (append (list beg end (list cand)) plist)) + (list beg end (list cand) :exit-function exit-fn)) (completion-preview-active-mode))))))))))) (defun completion-preview--post-command () -- 2.39.2