Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH 2/3] Document _email_addresses.
- X-seq: zsh-workers 39708
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [PATCH 2/3] Document _email_addresses.
- Date: Sat, 22 Oct 2016 21:54:06 +0000
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=date:from:in-reply-to:message-id :references:subject:to:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=yqDPZ /4RYGLiXc/EFei7o/TEpKs=; b=HmqIkt2OApOw2iW0mZHEE0sAyhs7FhcSo9HZQ Gv+y8lSyZYZxoYooCNeICWYB7WuXhHnZ8hXMRwbw+yYB/gO+Owf3aMUt4KzgRzJg 4C/AEA0SXl83AGKPnMSL2FUtemCWazs3KgxtsTL4LYYfHHRehk0rTtdU9GyEsWbu FWjsFI=
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=date:from:in-reply-to:message-id :references:subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=yqDP Z/4RYGLiXc/EFei7o/TEpKs=; b=MNX1moqN280T1y1MReiUVaiSbs8tLmsI6Uf4 lBXvOsOY1pcENv5ooxKFXtI5tKxlRi0k0Ck4zbrpdI3D0aY3LB3U5fN2Ox/D9vtx M3FR8JsA2rXOv5d3tZ0jSfTVBGRyH7XmDURRCJBXN5tx95hLw/jGvapmDSRFtKzP PAmhgvk=
- In-reply-to: <1477173247-12720-1-git-send-email-danielsh@fujitsu.shahaf.local2>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <1477173247-12720-1-git-send-email-danielsh@fujitsu.shahaf.local2>
---
Completion/Unix/Type/_email_addresses | 2 ++
Doc/Zsh/compsys.yo | 42 +++++++++++++++++++++++++++++++++++
2 files changed, 44 insertions(+)
diff --git a/Completion/Unix/Type/_email_addresses b/Completion/Unix/Type/_email_addresses
index 7d5c942..8a5877a 100644
--- a/Completion/Unix/Type/_email_addresses
+++ b/Completion/Unix/Type/_email_addresses
@@ -5,6 +5,8 @@
# -s sep - complete a list of addresses separated by specified character
# -c - e-mail address must be of form user@host (no comments or aliases)
#
+# TODO: with -n, have the named plugin complete not only aliases but also addresses?
+#
# Plugins are written as separate functions with names starting `_email-'.
# They should either do their own completion or return the addresses in the
# reply array in the form 'alias:address' and return 300. The -c option is
diff --git a/Doc/Zsh/compsys.yo b/Doc/Zsh/compsys.yo
index f56daa4..33ba92c 100644
--- a/Doc/Zsh/compsys.yo
+++ b/Doc/Zsh/compsys.yo
@@ -826,6 +826,10 @@ kindex(domains, completion tag)
item(tt(domains))(
for network domains
)
+kindex(email-*, completion tag)
+item(tt(email-)var(plugin))(
+for email addresses from the `tt(_email-)var(plugin)' backend of tt(_email_addresses)
+)
kindex(expansions, completion tag)
item(tt(expansions))(
used by the tt(_expand) completer for individual words (as opposed to
@@ -4387,6 +4391,44 @@ tt($service) to the var(string) being tried, and sets
the var(context/command) field (the fourth) of the tt($curcontext)
parameter to the var(context) given as the first argument.
)
+findex(_email_addresses)
+item(tt(_email_addresses) [ tt(-c) ] [ tt(-n) var(plugin) ])(
+Complete email addresses. Addresses are provided by plugins.
+
+startitem()
+item(tt(-c))(
+Complete bare tt(localhost@xxxxxxxxxx) addresses, without a name part or
+a comment.
+Without this option, RFC822 `var(Firstname Lastname) tt(<)var(address)tt(>)'
+strings are completed.
+)
+item(tt(-n) var(plugin))(
+Complete aliases from var(plugin).
+)
+COMMENT(Intentionally leaving tt(-s) undocumented: new code should use
+tt(_sequence) instead.)\
+enditem()
+
+The following plugins are available by default:
+tt(_email-ldap) (see the tt(filter) style),
+tt(_email-local) (completes var(user)tt(@)var(hostname) Unix addresses),
+tt(_email-mail) (completes aliases from tt(~/.mailrc)),
+tt(_email-mush),
+tt(_email-mutt),
+and
+tt(_email-pine).
+
+Addresses from the tt(_email-)var(foo) plugin are added under the
+tag `tt(email-)var(foo)'.
+
+em(Writing plugins)
+
+Plugins are written as separate functions with names starting with `tt(_email-)'.
+They are invoked with the tt(-c) option and tt(compadd) options.
+They should either do their own completion or
+set the tt($reply) array to a list of `var(alias)tt(:)var(address)' elements and return tt(300).
+New plugins will be picked up and run automatically.
+)
findex(_files)
item(tt(_files))(
The function tt(_files) calls tt(_path_files) with all the arguments it
Messages sorted by:
Reverse Date,
Date,
Thread,
Author