[Top][All Lists]

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

Re: [GNU ELPA] New package proposal: aggressive-completion.el

From: Tassilo Horn
Subject: Re: [GNU ELPA] New package proposal: aggressive-completion.el
Date: Mon, 05 Apr 2021 09:17:24 +0200
User-agent: mu4e 1.5.11; emacs 28.0.50

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>>>> (defcustom aggressive-completion-no-complete-commands
>>>>   '( left-char icomplete-fido-backward-updir minibuffer-complete
>>>>      right-char delete-backward-char backward-kill-word
>>>>      backward-kill-paragraph backward-kill-sentence backward-kill-sexp
>>>>      delete-char kill-word kill-line completion-at-point)
>>>>   "Commands after which automatic completion is not performed."
>>>>   :type '(repeat command))
> [...]
>> How hard can it be to get it right on the first try?!? ;-)
> BTW, you might want to document (via comments) the reason behind all
> those choices.  E.g. the set of possible completions generally depends
> on the position of `point` (e.g. for the `partial-completion` style,
> there's an implicit `*` at point), so whether or not to refresh the
> *Completions* buffer after `left-char` (for example) is not as obvious
> a decision as one might think.

I've replaced that variable with
`aggressive-completion-auto-complete-commands' which lists the commands
after which automatic completion is performed (as you've implicitly
suggested).  The default value is just '(self-insert-command yank).  I
think that's much less controversial than what commands previously had
to go into the blacklist.

> Also, listing command names inevitably can cause problems for
> circumstances where another command name (e.g. defined as a thin
> wrapper for a standard command) is used.  I don't really have a better
> solution to offer, tho, unless you can think of a clear statement of
> which kinds of commands should be included/excluded, such that we
> could then check using hooks that let us record what the command has
> actually done.

Now with the whitelist approach, the criterion for triggering
auto-completion is basically "you have inserted something".  I think the
current default value captures 99% of the cases.  Some people might also
want to add things like `transpose-chars' but I prefer an explicit tab
after such a correction.

That's indeed the main motivation why I changed the blacklist to a
whitelist approach: it isn't too bad when you have to TAB explicitly
sometimes but it has been highly annoying when it auto-completed when
you didn't want to.  For example, before `left-char' and `left-word'
where on the blacklist you essentially couldn't move point leftwards for
editing.  It would just pop back to the end unless you were able to
invoke each movement/editing command with a delay < 0.3 seconds.


reply via email to

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