From: Eshel Yaron Date: Wed, 1 Nov 2023 21:47:02 +0000 (+0100) Subject: Only keep the ':exit-function' completion property X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=6e08e7183328635d144f8bd642c9c3aeba140856;p=completion-preview.git 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. --- 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 ()