[imp] Autocomplete auto-select when composing?

Michael Wing marsfurrycreature at gmail.com
Thu Aug 2 13:23:36 UTC 2012


On Thu, Aug 2, 2012 at 1:03 AM, Simon Wilson <simon at simonandkate.net> wrote:

> ----- Message from Michael M Slusarz <slusarz at horde.org> ---------
>    Date: Wed, 01 Aug 2012 23:55:03 -0600
>    From: Michael M Slusarz <slusarz at horde.org>
> Subject: Re: [imp] Autocomplete auto-select when composing?
>      To: imp at lists.horde.org
>
>
>
>  Quoting Michael Wing <marsfurrycreature at gmail.com>:
>>
>>  When composing a message, after typing a few characters into the "To"
>>> field, the autocomplete brings up a dropdown list of matching addresses.
>>> Is there any way to make it so that the address is actually populated IN
>>> the To field?  For instance, if there is only one matching address,
>>> currently I still have to hit Tab, or the down-arrow to select that
>>> address.
>>>
>>
>> That is correct.
>>
>>  Ideally, that one single address would be automatically populated
>>> in the To field.
>>>
>>
>> This is a terrible idea.  Just because there is one entry, doesn't mean
>> that this is the *correct* entry.  That is a dangerous, and incorrect,
>> assumption.
>>
>
> Particularly given the current bug where Imp matches email addresses to
> contacts with multiple emails, but only returns the first email address as
> an auto-complete match.
>
>
>
>> This is a very common scenario:
>>
>> 1. Enter a few characters.
>> 2. Auto-complete comes up with 1 entry, but it is the wrong entry.
>> 3. User realizes that maybe he doesn't have address of user he wants to
>> send to, so he wants to cancel auto-correct.
>> 4. Incorrect auto-correct entry is populated in address box.
>>
>> It is correct UI to require the user to verify that the address is
>> proper/correct.  An address should NEVER be automatically inserted into the
>> address field without user verification.
>>
>> michael
>>
>
>
> ...which, BTW, is what Outlook does - when entering text it offers
> matches, but you have to physically select it (with either mouse or by
> hitting Enter) for that suggestion to be accepted.
>
> Current Imp behaviour is just fine...
>
> Simon
>
>
Fair enough.  For those who might want a behavior similar to this, I've
included a patch below.

When the autocomplete code brings up the dropdown list, if you hit TAB, it
will automatically select the top-most entry in the list, and then move to
the next field.  If you hit ENTER, it will automatically select the
top-most entry in the list, and then allow another recipient to be selected.

This removes any dangerous assumptions about whether or not the recipient
is correct.  It also allows you to very quickly compose emails by typing
just enough characters to bring your desired recipient to the top of the
list.  If you're sending many emails to the same recipient, this can
significantly decrease the time it takes to fill in the header fields of
the email.

--- ./keynavlist.js.orig        2012-08-02 08:18:03.000000000 -0500
+++ ./keynavlist.js     2012-08-02 08:18:36.000000000 -0500
@@ -203,6 +203,10 @@

         switch (e.keyCode) {
         case Event.KEY_TAB:
+            this.opts.onChoose(this.getCurrentEntry());
+            this.hide();
+            return;
+
         case Event.KEY_RETURN:
             this.opts.onChoose(this.getCurrentEntry());
             this.hide();
@@ -283,6 +287,7 @@

     getCurrentEntry: function()
     {
+        if (! this.selected) this.markNext();
         return this.selected
             ? this.selected.retrieve('v')
             : null;


More information about the imp mailing list