Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Setting the 'completer' style - _match and **
- X-seq: zsh-users 21952
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: Setting the 'completer' style - _match and **
- Date: Tue, 20 Sep 2016 08:46:07 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=mtU9Zp6pPOFOz4Rtrxxm8mdCTPmZmP3gsXwzYZNO6j8=; b=B2mj9PNNyuzitv78ptKvEvAgHOsbyUwWqvGvDCH0Y75eO2oPGuNAOWB0EpMLuT+Yic AiUXvUlO7hDQj8G/EZ5o+cI2lVSqeMzmV97amfZ7YVaSbSCisOVJsOsVGDPRCEVpqxP4 rlyav0sKwbFOrtLjBE4jhvOSQTSWrF7YCnj75giY4V9/pHfKtmTBGU9YRjt83/9rdItb G5ijwEy3m4iSD/GZHAsD5ntsNYcdC5oAqqmVMFXhyfrUQN8hF7HsQdzPRe4xq/N868kH bmzd7k++9z1EuWVXoyIRAn/+NcXv7xnfvcMt1QW04wHSntf0epzHyuTkkcAj9FSOi0Oz odJQ==
- In-reply-to: <20160920085431.GA3720@fujitsu.shahaf.local2>
- 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: <20160912233028.GA17257@fujitsu.shahaf.local2> <160919074515.ZM28018__10595.0927398682$1474296416$gmane$org@torch.brasslantern.com> <20160920085431.GA3720@fujitsu.shahaf.local2>
On Sep 20, 8:54am, Daniel Shahaf wrote:
}
} [ Your MUA seems to have changed the subject: your email has a hyphen
} where the email you reply to had an em dash. ]
Sorry about that; mail to my home desktop passes through a number of
gateways and processing steps, some of which think non-ascii subjects
are potential spam indicators.
} > } The idea is that if a pattern contains "**" then _match('s wrapper) will
} > } leave it for _expand to process.
} >
} > You could probably come up with a "zstyle -e" formulation that would only
} > include_match in the completer value in the right circurmstances.
}
} How would I do that? I think the "right circumstances" are [[ $curtag
} == *(file|dir)* ]], but the 'completer' style is looked up under the
} context :completion:::::, before tags are known.
I was thinking quite literally what you said about the pattern:
zstyle -e ':completion:*' completer \
'[[ $PREFIX$SUFFIX == *[*][*]* ]] && reply=(... _expand ...) || \
reply=(... _match ...)'
But you could add to the [[ ]] e.g. "&& $words[1] == service" (the
value of $service hasn't been set yet there either because it's a
feature of _complete).
Messages sorted by:
Reverse Date,
Date,
Thread,
Author