]> git.eshelyaron.com Git - completion-preview.git/commit
Use a dedicated capf instead of rebinding 'C-M-i'
authorEshel Yaron <me@eshelyaron.com>
Wed, 1 Nov 2023 11:35:36 +0000 (12:35 +0100)
committerEshel Yaron <me@eshelyaron.com>
Wed, 1 Nov 2023 11:41:26 +0000 (12:41 +0100)
commit87247fe388ebf4f188bb2cf71a667c92bdffcb01
treec12df4cdf814f8d71ea7aa5939d9d5a329b7bf89
parentda0c6ab9535fa1985bb57fd686632fa36a6ddef8
Use a dedicated capf instead of rebinding 'C-M-i'

Instead of rebinding 'C-M-i' to a command that inserts the suggested
completion, we make 'completion-at-point' do the right thing when the
preview is active by temporarily adding a prioritized capf.

Thanks to João Távora for suggesting this approach.

* completion-preview.el (completion-preview-active-mode-map): Remove.
(completion-preview--insert):
(completion-preview-insert-function): New functions.
(completion-preview-active-mode): Adjust.
completion-preview.el