1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

; (completion-preview--try-table): Propagate extra properties.

* lisp/completion-preview.el
(completion-preview--try-table): Let-bind
'completion-extra-properties' to completion properties
that the completion backend (capf) provides, so that these
properties take effect when querying the completion table.
* test/lisp/completion-preview-tests.el
(completion-preview-propagates-properties): Add test.
This commit is contained in:
Eshel Yaron 2025-03-02 08:03:04 +01:00
parent 828e08a996
commit 365a91622e
No known key found for this signature in database
GPG key ID: EF3EE9CA35D78618
2 changed files with 14 additions and 0 deletions

View file

@ -306,4 +306,17 @@ instead."
(should exit-fn-called)
(should (equal exit-fn-args '("foobar" finished))))))
(ert-deftest completion-preview-propagates-properties ()
"Test the completion metadata handling of Completion Preview mode."
(with-temp-buffer
(setq-local
completion-preview-sort-function #'minibuffer-sort-alphabetically
completion-at-point-functions
(list (completion-preview-tests--capf '("foobaz" "foobar")
:display-sort-function #'identity)))
(insert "foo")
(let ((this-command 'self-insert-command))
(completion-preview--post-command))
(completion-preview-tests--check-preview "baz" 'completion-preview-common)))
;;; completion-preview-tests.el ends here