Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: zsh Newbie wants to complete mutt email addresses or aliases


Thanks for the code. 

I'm OK with just completing aliases and appreciate your pragmatic

However, probably due to my inexperience, I was unable to get your code
to work after 

1.) deleting the hard coded email addresses, leaving

        zstyle -e ':completion::complete:mutt:*:' users \
        'reply=($(perl -ne '\''print "$1\n"
                  if /^\s+alias\s+(\S+)\s+.*/;'\'' ~/.muttrc 2>/dev/null))'

2.) putting it in .zshrc and restarting zsh, and failing that,

3.) entering it at zsh's prompt.

When I press <tab> after typing the start of an alias, ie:

        $ mutt -s "A silly subject" Joe_Do<tab>

zsh returns the same error message as before:

        No matches for: `recipient', `login name', `user', or `corrections'

Since I'm so new to zsh, perhaps you can easily suggest what I might try
doing differently.


to work On Tue:13:17, Bart Schaefer wrote:
> zstyle -e ':completion::complete:mutt:*:' users \ 
>   'reply=($(perl -ne '\''print "$1\n"
>          if /^\s+alias\s+(\S+)\s+.*/;'\'' ~/.muttrc 2>/dev/null)
>        otheraddress@xxxxxxxxxxxxxxx 
>        anotheraddress@xxxxxxxxxxxxxxxxx
>        etcetc@xxxxxxxxxxxxxx)'
> You can probably figure out how to extend this to emit the addresses
> from the muttrc alias lines instead of just the alias keywords.


Messages sorted by: Reverse Date, Date, Thread, Author