Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: completion function with compadd
- X-seq: zsh-users 8418
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: completion function with compadd
- Date: Sat, 22 Jan 2005 22:22:06 +0000
- In-reply-to: <20050120182025.GA26932@xxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20050120182025.GA26932@xxxxxxxxxxxx>
On Jan 20, 7:20pm, Eric Smith wrote:
}
} Is it possible to complete on words within that file.
} The example I am looking for is my mutt aliases
Is there something not working for you if you use the mutt completer
that's included in the zsh distribution?
Theoretically, it handles mutt alias files just fine. If for some
reason it doesn't, you can create your own plugin function called
"_email-mutt" to do the work. (Unfortunately the interface to the
plugin is rather poorly documented, but there are examples in the
Completion/Unix/Type/_email_addresses file.)
Just be sure you define the plugin function before you load the
_email_addresses file. (Autoloading both should work fine.)
} mutt alice@xxxxxxxxxxxxxxxx
}
} and not
} mutt alias aw "Alice in Wonderland" <alice@xxxxxxxxxxxxxxxx>
For that specific example, assuming that you've somehow assigned the
line from the file to the variable $line, you'd want something like
compadd ${line/(#b)*<(*)>/$match[1]}
(which assumes extendedglob is set, but it always is in completion).
Messages sorted by:
Reverse Date,
Date,
Thread,
Author