Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: File completion with **/ (with solution)
- X-seq: zsh-users 21956
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: File completion with **/ (with solution)
- Date: Thu, 22 Sep 2016 21:12:14 +0000
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=NMYdfQ1XM82C+Jx1Pi/5p2pjHe4=; b=vxLjfR /uOsAi0xJKJWt6vE+Y83v66VlVCGio2aHY1uRAWnd01QZ53q/g78A6b5ixwPeFBS cdMKYHdTgFzjAOSNBbm9dbmgRN9RFp3ybentw+ApMizDaW5MuY1/xGLtmsNqYAix rCIosL5BAr5a91MfI48AqF22TSnz0BlkxFZZE=
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=NMYdfQ1XM82C+Jx1Pi/5p2pjHe4=; b=e/8AI i3hxayKL2BuAkDKXnzBYxDBToLj3+KKa/34JqQixSt9lzFWrC2NtYFRzMzMbXB4x hoyIXu1zbE/gSLm7eXCNL7Wam6ZRuCwfUq7rcvOcnvhHfie9LfwtpIa1AYDjpNwp KMq8wPWcGpJpVjVS17C7DmtJPOZt871lYhwMts=
- In-reply-to: <160920175623.ZM32730__25904.0603101768$1474419485$gmane$org@torch.brasslantern.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <160920175623.ZM32730__25904.0603101768$1474419485$gmane$org@torch.brasslantern.com>
Bart Schaefer wrote on Tue, Sep 20, 2016 at 17:56:23 -0700:
> _glob_expand() { reply=( $~1* ) }
> zstyle :completion::user-expand:: user-expand _glob_expand
> zstyle :completion::user-expand:: tag-order expansions all-expansions
> zstyle ':completion:*' completer _expand _complete _match _user_expand
>
> Daniel, this might be the "better answer" to your _match question, too.
Right: I could use _user_expand instead of _expand in my completer
style, and implement a policy such as
.
1. Try _expand if $condition
2. Try _match
3. Try _expand if not $condition
.
with $condition being the *[*][*]* pattern from the _match thread.
> The other thing it might be useful to call out in the doc is to note that
> because _user_expand is called AS a completer, it has access to more of
> the zstyle $context when it is called than when the "completer" style is
> looked up. This could be handy when deciding what to assign to $reply.
I don't see that additional context: if I define _f as a completer
function, then it's called with curcontext=:f::.
Thanks again for all the investigations. I've switched to your 'zstyle
-e' solution since this way I don't have to munge $curcontext in my
wrapper function.
Cheers,
Daniel
Messages sorted by:
Reverse Date,
Date,
Thread,
Author