bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#66948: [PATCH] Add Completion Preview mode


From: Eshel Yaron
Subject: bug#66948: [PATCH] Add Completion Preview mode
Date: Mon, 06 Nov 2023 16:30:50 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

Hi,

Juri Linkov <juri@linkov.net> writes:

>>> and that there is no option to cycle between inexact completions.
>>
>> That's interesting, can you elaborate about the use case that you have
>> in mind?  I thought about adding a command to do that, but I wasn't sure
>> there'd be a good use case for it since you can always dismiss the
>> preview (e.g. with `C-g`) and say `C-M-i` to pick another candidate.
>
> Is it possible to avoid typing `C-g` before typing `C-M-i` for the list
> of completions?  I mean that I'd prefer only TAB or RET to accept the
> completion suggestion, but not `C-M-i`.  Then when the proposed preview
> is correct, TAB or RET will accept it, otherwise `C-M-i` will immediately
> display a list of alternative completions.

I'm attaching a new patch (v2) following Juri's and Philip's comments.
The differences from the previous patch are:

1. TAB now accepts the completion suggestions when the preview is visible.
   RET remains untouched, as I find binding it by default too intrusive.

2. Completion Preview avoids altering the behavior of
   `completion-at-point` by default, so if you say `C-M-i` while the
   preview is visible you get the usual list of completion candidates.
   New user option `completion-preview-insert-on-completion` allows users
   to regain the behavior of my original patch, where `C-M-i` would insert
   accept the completion suggestion when the preview is visible.

3. New commands for cycling the candidate that the preview suggests.
   These are currently unbound by default, but I added a recommendation in
   the manual to bind `completion-preview-next-candidate` and
   `completion-preview-prev-candidate` to `M-n` and `M-p` in
   `completion-preview-active-mode-map`.  That works nicely.

If you try it out and have any other suggestions, please let me know.
Here's the updated patch:

Attachment: v2-0001-Add-Completion-Preview-mode.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]