zsh-workers
 help / color / mirror / code / Atom feed
From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: dana <dana@dana.is>
Cc: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: [PATCH] Fix zstyle option completion
Date: Sun, 13 Dec 2020 17:31:19 +0000	[thread overview]
Message-ID: <20201213173119.GA6254@tarpaulin.shahaf.local2> (raw)
In-Reply-To: <D5C6BE91-013B-476D-BF33-505C72CF6FAC@dana.is>

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
> 
> 


  reply	other threads:[~2020-12-13 17:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-13  4:15 dana
2020-12-13 17:31 ` Daniel Shahaf [this message]
2020-12-14  9:55   ` dana
2021-03-27 20:08     ` Lawrence Velázquez
2021-03-29 13:46       ` Daniel Shahaf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201213173119.GA6254@tarpaulin.shahaf.local2 \
    --to=d.s@daniel.shahaf.name \
    --cc=dana@dana.is \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).