unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Tassilo Horn <tsdh@gnu.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: "Basil L. Contovounesios" <contovob@tcd.ie>, emacs-devel@gnu.org
Subject: Re: [GNU ELPA] New package proposal: aggressive-completion.el
Date: Mon, 05 Apr 2021 09:17:24 +0200	[thread overview]
Message-ID: <87eefp18q2.fsf@gnu.org> (raw)
In-Reply-To: <jwvy2dxu7lw.fsf-monnier+emacs@gnu.org>

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.

Bye,
Tassilo



  reply	other threads:[~2021-04-05  7:17 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-03  7:53 [GNU ELPA] New package proposal: aggressive-completion.el Tassilo Horn
2021-04-03  8:37 ` Tassilo Horn
2021-04-03  9:11 ` Manuel Uberti
2021-04-03  9:42   ` Tassilo Horn
2021-04-03 10:14     ` Jean Louis
2021-04-03 11:17     ` Jean Louis
2021-04-03 10:07   ` Jean Louis
2021-04-03  9:36 ` Jean Louis
2021-04-03 10:03   ` Tassilo Horn
2021-04-03 10:19     ` Jean Louis
2021-04-03 10:24       ` Tassilo Horn
2021-04-04 13:53     ` Basil L. Contovounesios
2021-04-04 19:05       ` Tassilo Horn
2021-04-04 20:12         ` T.V Raman
2021-04-05  7:01           ` Tassilo Horn
2021-04-05 14:21             ` T.V Raman
2021-04-04 20:26         ` Stefan Monnier
2021-04-05  7:17           ` Tassilo Horn [this message]
2021-04-03  9:49 ` Jean Louis
2021-04-03 10:05   ` Tassilo Horn
2021-04-03 11:53 ` Philip Kaludercic
2021-04-03 11:55 ` Philip Kaludercic
2021-04-03 13:43   ` Tassilo Horn
2021-04-03 17:22     ` [GNU ELPA] New package proposal: aggressive-completion.El Philip Kaludercic
2021-04-03 18:03       ` Tassilo Horn
2021-04-03 14:04 ` [GNU ELPA] New package proposal: aggressive-completion.el Stefan Monnier
2021-04-03 18:29   ` Tassilo Horn
2021-04-03 19:30     ` Tassilo Horn
2021-04-03 21:01       ` Stefan Monnier
2021-04-03 20:02 ` Gabriel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87eefp18q2.fsf@gnu.org \
    --to=tsdh@gnu.org \
    --cc=contovob@tcd.ie \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).