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

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



On Tue, 30 Apr 2002, Kingsley G. Morse Jr. wrote:

> 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))'
>
> When I press <tab> after typing the start of an alias [...]
> zsh returns the same error message as before [...]

First thing to try is, run the perl all by itself:

perl -ne 'print "$1\n" if /^\s+alias\s+(\S+)\s+.*/;' ~/.muttrc

Does this produce an error message?  Does it produce the right output?

If that appears to work, you dan debug the completion itself by using

$ mutt -s "A silly subject" Joe_Do<C-x ?>

That is, type control-x question-mark instead of tab.  This will dump a
trace of the completion code to a temp file, where you can look at it.
Search it for "perl" to see whether and how the style above is being used.



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