Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] Fix zstyle option completion
- X-seq: zsh-workers 47740
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: dana <dana@xxxxxxx>
- Subject: Re: [PATCH] Fix zstyle option completion
- Date: Sun, 13 Dec 2020 17:31:19 +0000
- Archived-at: <https://zsh.org/workers/47740>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-workers/2020-12/20201213173119.GA6254%40tarpaulin.shahaf.local2>
- Authentication-results: zsh.org; iprev=pass (out2-smtp.messagingengine.com) smtp.remote-ip=66.111.4.26; dkim=pass header.d=daniel.shahaf.name header.s=fm2 header.a=rsa-sha256; dkim=pass header.d=messagingengine.com header.s=fm1 header.a=rsa-sha256; dmarc=none header.from=daniel.shahaf.name; arc=none
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=date:from:to:cc:subject:message-id :references:mime-version:content-type:content-transfer-encoding :in-reply-to; s=fm2; bh=uyX+AS9pLk34VJ+33uWFoYzSMVwEPMjg5DFDLy9+ 64c=; b=LdcNZPxdm+N+dVWZnSl06C7Gsa+oWyKi/ycg2JgxCzDgmPsbdRnMu1GU JozPSAJ7NzfnJTK5z3Fg4D9TV04vs1Y2+2p9AL8yvwes6vKz1mkQvRyU6ZIa/aLe nAE4+jFlPap5z+6wJCpqITE5ObpVTpvAy+hegl5TExiX3z7uwwosPqoPbmwEedQs uGUqCoEwS7X1Fs+2zs+cC7Ke4J0HdqSTPmW8LGHRQVP4aLD8ODRGxTN5BQKLM21i MdcCV0+Pb9VFgz6Co3HNl5IjIhY8ueAKxiz7R2ykuy92BC7i+yDE4ZSn+BCtQu8H ZvLm7xK3Alb4jY3dquO4rK3a6nU+1w==
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=uyX+AS9pLk34VJ+33uWFoYzSMVwEPMjg5DFDLy9+6 4c=; b=bWexiFp9ca7ySCm/cINjimg5zb69cLwq/QMNPWGw94kmb8tRZGrtCdZL+ VGwkPSMkBWMgAiQiCm2g5aIU4vAgx5URHGt97QNwhEnSj6JWfCYnwJ1AyK2lpg1i KJuzYIct95oBRVwliXqjHhyNT0O3lSn0CELg7zWKaRdCd8VPJnO2NP771oi7GuUU H0ND58RyuJafmJMwD7dByaKkuP4YX2LG740TxeSau2LvgeZSd8SynKnVA2Dxg/ry fOcxqhSjPfpSYUxMPBxFNxfTR5Au0r15xDTla3SThotqlB/yv8rcqwmw/JeWbcLj BWiNSH6Elp0f22+Gp5zPNTzKrASIQ==
- In-reply-to: <D5C6BE91-013B-476D-BF33-505C72CF6FAC@dana.is>
- List-archive: <http://www.zsh.org/sympa/arc/zsh-workers>
- List-help: <mailto:sympa@zsh.org?subject=help>
- List-id: <zsh-workers.zsh.org>
- List-owner: <mailto:zsh-workers-request@zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-subscribe: <mailto:sympa@zsh.org?subject=subscribe%20zsh-workers>
- List-unsubscribe: <mailto:sympa@zsh.org?subject=unsubscribe%20zsh-workers>
- References: <D5C6BE91-013B-476D-BF33-505C72CF6FAC@dana.is>
- Sender: zsh-workers-request@xxxxxxx
dana wrote on Sat, Dec 12, 2020 at 22:15:47 -0600:
> I often retrieve zstyle commands from history and then edit them to add -d or
> whatever at the beginning. But the completion function won't complete for you
> there because of the change made by Daniel in workers/39659.
>
A regression, then? Sorry about that.
Could you clarify the precise LBUFFER/RBUFFER values that "won't
complete"?
> @Daniel: I think this achieves what you wanted without breaking my use case,
> doesn't it? Or did you have something else in mind that i'm not seeing?
What I had in mind in that commit was to complete the correct non-option
arguments after the options listed in the log message; e.g., «zstyle -s
<TAB>», «zstyle -s foo <TAB>», «zstyle -s foo bar <TAB>».
The «(-)» exclusions in the line changed were designed to make that line
complete the "set a zstyle" syntax, «zstyle foo bar baz» without any of
the options (not even -e, which is handled separately).
As written, I think the patch will cause «zstyle -g foo bar baz <TAB>»
to offer completions, whereas currently it correctly completes nothing.
(Just observing; not implying any conclusions.)
Cheers,
Daniel
(ENOTIME to test, sorry)
> diff --git a/Completion/Zsh/Command/_zstyle b/Completion/Zsh/Command/_zstyle
> index 75acde5f7..9e82d8ad5 100644
> --- a/Completion/Zsh/Command/_zstyle
> +++ b/Completion/Zsh/Command/_zstyle
> @@ -217,7 +217,7 @@ taglist=(
> )
>
> # Be careful with the context arguments here. They like to masquerade.
> -_arguments -C \
> +_arguments -C -A '-*' \
> '(: -)-L[output in form of zstyle commands]:pattern for context patterns:->metapatterns:style:->metastyles' \
> '(: -)-d[delete style definitions]:verbatim context pattern:->patterns:*:styles:->pstyles' \
> '(: -)-e[value is evaluated when style is looked up]:context pattern:->contexts:style:->styles:*:command:_cmdstring' \
> @@ -228,7 +228,7 @@ _arguments -C \
> '(: -)-t[test a style, returning false if it'\''s undefined]:context name:->contexts:style:->styles:*:strings to test presence of: ' \
> '(: -)-T[test a style, returning true if it'\''s undefined]:context name:->contexts:style:->styles:*:strings to test presence of: ' \
> '(: -)-m[pattern-match values of a style]:context name:->contexts:style:->styles:pattern: ' \
> - '(-):context pattern:->contexts' '(-):style:->styles' '(-)*:argument:->style-arg'
> + ':context pattern:->contexts' ':style:->styles' '*:argument:->style-arg'
>
> while (( $#state )); do
> case "$state[1]" in
>
>
Messages sorted by:
Reverse Date,
Date,
Thread,
Author