Alias completion question

Nathan Stratton Treadway muttlists at nathanst.com
Thu Mar 14 18:16:58 UTC 2019


On Tue, Mar 12, 2019 at 14:06:59 +1100, Erik Christiansen wrote:
> On 11.03.19 20:32, Jason wrote:
> > To prevent this, I usually press Tab one extra time to see how many 
> > matches pop up; just wondering if that's what everyone else does too or 
> > if there's something that would negate the need for the extra Tab press.
> 
> That's how mailbox name completion works too. It's what I expect and use.
> 
> In comparison, bash takes two additional tabs and a 'y' to bring up a
> long list after one tab has partially completed "mail/cnc":

In the general case (i.e. of simple filename completion), bash outputs a
space after the filename if the match is unique, thus letting you know
you are "done".  

For alias completion in Mutt, it seems like a possible equivalent
functionality to serve Jason's situation would be for the the
tab-completion function to output a comma (and probably also a space,
just for readability) after the characters inserted into the entry field
if those characters are a full, non-ambiguous alias.

Using Jason's example aliases:

  type:                 and get in the edit field: 
  "jo<TAB>"             "john"   
      [the cursor is right after the "n", so you know
       you haven't matched a full unambiguous alias yet]
  "d<TAB>"               "johndoe, " 
      [trailing comma tells you you're seeing a full unambiguous alias,
      and it thus it will indeed be replaced by an email address during
      parsing of the field]

(This simple approach doesn't clearly indicate the special case that you
have matched a full alias which is also the first part of a longer
alias, but the same is true for bash's filename completion.)

							Nathan


More information about the Mutt-users mailing list