From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8894 invoked by alias); 22 Oct 2016 22:06:25 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 39706 Received: (qmail 21048 invoked from network); 22 Oct 2016 22:06:24 -0000 X-Qmail-Scanner-Diagnostics: from out1-smtp.messagingengine.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(66.111.4.25):SA:0(0.0/5.0):. Processed in 0.762136 secs); 22 Oct 2016 22:06:24 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: d.s@daniel.shahaf.name X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at daniel.shahaf.name does not designate permitted sender hosts) 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=A00pF unRshcPkQpmIAl9HotIz04=; b=ctAyui1qnrIAxluGeo0AibYXQtrZyDwdNr/NZ M33o28XvbYInAU4vQRqNmeguA0RRoWe0lw6BRmUEmv7IuDyRXbJhJ7PoP5tBvgjg kh9EpeEiNbMPOSdp7+J07d7t6LqvRowErDAqNKvn16CQz2QrbMTnBUQ7wIUBBToq mrwtMI= 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=A00p FunRshcPkQpmIAl9HotIz04=; b=fpDm/FW15y4Y4BmJbDoeDqrF5c1MPHTyKTpM TAsOCwpiTG8rwQmuS0cgEmeUCaqatiu/S3j/Ax2WFDFH5jXUCMJNAZyIiA9joqtq bG2IKL/vwxmKyAOyUp2bUad600fX8nVsGLJASU4WuSFq/Wz/j2/W6QUk2iru3YFS L73Ilrg= X-Sasl-enc: /i7p9IfvEZsViimp7ZlnFuwKoBrwIRcmhh15Q2QWFFmI 1477173371 From: Daniel Shahaf To: zsh-workers@zsh.org Subject: [PATCH 3/3] _tilde_files: Offer named directories. Document. Date: Sat, 22 Oct 2016 21:54:07 +0000 Message-Id: <1477173247-12720-3-git-send-email-danielsh@fujitsu.shahaf.local2> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1477173247-12720-1-git-send-email-danielsh@fujitsu.shahaf.local2> References: <1477173247-12720-1-git-send-email-danielsh@fujitsu.shahaf.local2> --- It would be nice if the named-directories completion would use _describe with the hash's keys as completions and its values as descriptions. However, that's for another day. Cheers, Daniel Completion/Unix/Type/_tilde_files | 3 ++- Doc/Zsh/compsys.yo | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Completion/Unix/Type/_tilde_files b/Completion/Unix/Type/_tilde_files index ee6b180..b1b3b37 100644 --- a/Completion/Unix/Type/_tilde_files +++ b/Completion/Unix/Type/_tilde_files @@ -30,7 +30,8 @@ case "$PREFIX" in ;; \~*) compset -P '?' - _users "$@" + local -a expl=( "$@" ) + _alternative -O expl users:user:_users named-directories:'named directory':'compadd -k nameddirs' ;; *) _files "$@" diff --git a/Doc/Zsh/compsys.yo b/Doc/Zsh/compsys.yo index 33ba92c..4248276 100644 --- a/Doc/Zsh/compsys.yo +++ b/Doc/Zsh/compsys.yo @@ -5019,6 +5019,12 @@ allows tt(_tags) to use a more specific context without having to change and reset the tt(curcontext) parameter (which has the same effect). ) +findex(_tilde_files) +item(tt(_tilde_files))( +Like tt(_files), but resolve leading tildes according to the rules of +filename expansion, so the suggested completions don't start with +a `tt(~)' even if the filename on the command-line does. +) findex(_values) item(tt(_values) [ tt(-O) var(name) ] [ tt(-s) var(sep) ] [ tt(-S) var(sep) ] [ tt(-wC) ] var(desc) var(spec) ...)( This is used to complete arbitrary keywords (values) and their arguments,