zsh-workers
 help / color / mirror / code / Atom feed
* [PATCH] Fix typo in compwid.yo
@ 2023-05-18 20:53 Marlon Richert
  2023-05-18 20:53 ` [PATCH] Use zstyle verbose for _parameters descriptions Marlon Richert
  2023-05-18 20:53 ` [PATCH] Show alias values in command completions Marlon Richert
  0 siblings, 2 replies; 10+ messages in thread
From: Marlon Richert @ 2023-05-18 20:53 UTC (permalink / raw)
  To: zsh-workers

r and R were listed in the wrong order.
---
 Doc/Zsh/compwid.yo | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Doc/Zsh/compwid.yo b/Doc/Zsh/compwid.yo
index d32a0702f..9461ace17 100644
--- a/Doc/Zsh/compwid.yo
+++ b/Doc/Zsh/compwid.yo
@@ -112,7 +112,7 @@ vindex(QIPREFIX)
 item(tt(QIPREFIX))(
 This parameter is read-only and contains the quoted string up to the
 word being completed. E.g. when completing `tt("foo)', this parameter
-contains the double quote. If the tt(-q) option of tt(compset) is used
+contains the double quote. If the tt(-q) option of tt(compset) is used
 (see below), and the original string was `tt("foo bar)' with the
 cursor on the `tt(bar)', this parameter contains `tt("foo )'.
 )
@@ -1082,8 +1082,8 @@ enditem()
 )
 xitem(tt(l:)tt(|)var(word-pat)tt(=)var(match-pat))
 xitem(tt(L:)tt(|)var(word-pat)tt(=)var(match-pat))
-xitem(tt(R:)var(word-pat)tt(|)tt(=)var(match-pat))
-item(tt(r:)var(word-pat)tt(|)tt(=)var(match-pat))(
+xitem(tt(r:)var(word-pat)tt(|)tt(=)var(match-pat))
+item(tt(R:)var(word-pat)tt(|)tt(=)var(match-pat))(

 If there is a substring at the tt(l:)eft or tt(r:)ight edge of the current word
 that matches var(word-pat), then broaden the corresponding part of the match
--
2.39.2 (Apple Git-143)



^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH] Use zstyle verbose for _parameters descriptions
  2023-05-18 20:53 [PATCH] Fix typo in compwid.yo Marlon Richert
@ 2023-05-18 20:53 ` Marlon Richert
  2023-05-23 18:27   ` Bart Schaefer
  2023-05-18 20:53 ` [PATCH] Show alias values in command completions Marlon Richert
  1 sibling, 1 reply; 10+ messages in thread
From: Marlon Richert @ 2023-05-18 20:53 UTC (permalink / raw)
  To: zsh-workers

According to the manual, extra-verbose means "more verbose at the cost
of a probable decrease in completion speed". That's not the case here.
---
 Completion/Zsh/Type/_parameters | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Completion/Zsh/Type/_parameters b/Completion/Zsh/Type/_parameters
index b5da45c58..7f6f33e0e 100644
--- a/Completion/Zsh/Type/_parameters
+++ b/Completion/Zsh/Type/_parameters
@@ -21,7 +21,7 @@ zstyle -t ":completion:${curcontext}:parameters" prefix-needed &&
 _description parameters expl parameter
 zparseopts -D -K -E g:=pattern

-if zstyle -t ":completion:${curcontext}:parameters" extra-verbose; then
+if zstyle -t ":completion:${curcontext}:parameters" verbose; then
   described=(
       "${(@M)${(@k)parameters[(R)$~pattern[2]~*(hideval|local|special)*]}:#$~pfilt*}"
   )
--
2.39.2 (Apple Git-143)



^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH] Show alias values in command completions
  2023-05-18 20:53 [PATCH] Fix typo in compwid.yo Marlon Richert
  2023-05-18 20:53 ` [PATCH] Use zstyle verbose for _parameters descriptions Marlon Richert
@ 2023-05-18 20:53 ` Marlon Richert
  1 sibling, 0 replies; 10+ messages in thread
From: Marlon Richert @ 2023-05-18 20:53 UTC (permalink / raw)
  To: zsh-workers

Show the value of each alias when descriptions are shown. Enabled by default.
---
 Completion/Zsh/Type/_command_names | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/Completion/Zsh/Type/_command_names b/Completion/Zsh/Type/_command_names
index 12cbd69c1..d445be06e 100644
--- a/Completion/Zsh/Type/_command_names
+++ b/Completion/Zsh/Type/_command_names
@@ -4,7 +4,7 @@
 # complete only external commands and executable files. This and a
 # `-' as the first argument is then removed from the arguments.

-local args defs expl ffilt
+local args defs expl ffilt verbose

 zstyle -t ":completion:${curcontext}:commands" rehash && rehash

@@ -33,13 +33,19 @@ else
   defs=( "$defs[@]"
     'builtins:builtin command:compadd -Qk builtins'
     "functions:shell function:compadd -k 'functions$ffilt'"
-    'aliases:alias:compadd -Qk aliases'
     'suffix-aliases:suffix alias:_suffix_alias_files'
     'reserved-words:reserved word:compadd -Qk reswords'
     'jobs:: _jobs -t'
     'parameters:: _parameters -g "^*(readonly|association)*" -qS= -r "\n\t\- =[+"'
     'parameters:: _parameters -g "*association*~*readonly*" -qS\[ -r "\n\t\- =[+"'
   )
+
+  if zstyle -T ":completion:${curcontext}:aliases" verbose; then
+    printf -v verbose %s:%s\  ${(@q+)${(kv)aliases}[@]//\:/\\:}
+    defs+=( "aliases:alias:(( $verbose ))" )
+  else
+    defs+=( 'aliases:alias:compadd -Qk aliases' )
+  fi
 fi

 args=( "$@" )
--
2.39.2 (Apple Git-143)



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] Use zstyle verbose for _parameters descriptions
  2023-05-18 20:53 ` [PATCH] Use zstyle verbose for _parameters descriptions Marlon Richert
@ 2023-05-23 18:27   ` Bart Schaefer
  2023-05-24 12:42     ` [PATCH] Fix verbose parameter completion tests Marlon Richert
  2023-05-30 18:49     ` [PATCH] Use zstyle verbose for _parameters descriptions Vin Shelton
  0 siblings, 2 replies; 10+ messages in thread
From: Bart Schaefer @ 2023-05-23 18:27 UTC (permalink / raw)
  To: Marlon Richert; +Cc: zsh-workers

Test/Y01completion.ztst needs to be updated for this patch.

Test ./Y01completion.ztst failed: output differs from expected as
shown above for:
  comptesteval "typeset -a bar=({$'\\0'..$'\\C-?'})"
  comptesteval 'typeset -A bat=( "$bar[@]" )'
  comptesteval 'typeset bay="$bar"'
  comptesteval 'zstyle ":completion:*:parameters" extra-verbose yes'
  comptesteval 'zstyle ":completion:*" fake-parameters bar bat bay'
  comptest $': $ba\t'
Was testing: extra-verbose shows parameter values


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH] Fix verbose parameter completion tests
  2023-05-23 18:27   ` Bart Schaefer
@ 2023-05-24 12:42     ` Marlon Richert
  2023-05-30 18:49     ` [PATCH] Use zstyle verbose for _parameters descriptions Vin Shelton
  1 sibling, 0 replies; 10+ messages in thread
From: Marlon Richert @ 2023-05-24 12:42 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: zsh-workers

---
 Test/Y01completion.ztst | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/Test/Y01completion.ztst b/Test/Y01completion.ztst
index 693ea7d58..293b6c4a8 100644
--- a/Test/Y01completion.ztst
+++ b/Test/Y01completion.ztst
@@ -299,10 +299,10 @@ F:regression test workers/31611
   comptesteval "typeset -a bar=({$'\\0'..$'\\C-?'})"
   comptesteval 'typeset -A bat=( "$bar[@]" )'
   comptesteval 'typeset bay="$bar"'
-  comptesteval 'zstyle ":completion:*:parameters" extra-verbose yes'
+  comptesteval 'zstyle ":completion:*:parameters" verbose yes'
   comptesteval 'zstyle ":completion:*" fake-parameters bar bat bay'
   comptest $': $ba\t'
-0:extra-verbose shows parameter values
+0:verbose shows parameter values
 >line: {: $ba}{}
 >DESCRIPTION:{parameter}
 >NO:{bar  -- ( '^@' '^A' '^B' '^C' '^D' '^E' '^F' '^G' '^H' '\t' '\n' '^K' '^L' '}
@@ -312,15 +312,15 @@ F:regression test workers/31611
   comptesteval "path=( $ZTST_srcdir:A )"
   comptesteval 'typeset -H paths=HIDDEN'
   comptest $': $path\t'
-0:extra-verbose doesn't show special or hidden parameter values
+0:verbose doesn't show special or hidden parameter values
 >line: {: $path}{}
 >DESCRIPTION:{parameter}
 >NO:{path}
 >NO:{paths}

-  comptesteval 'zstyle -d ":completion:*:parameters" extra-verbose'
+  comptesteval 'zstyle -d ":completion:*:parameters" verbose'
   comptest $': $ba\t'
-0:parameter values not shown without extra-verbose
+0:parameter values not shown without verbose
 >line: {: $ba}{}
 >DESCRIPTION:{parameter}
 >NO:{bar}
--
2.39.2 (Apple Git-143)



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] Use zstyle verbose for _parameters descriptions
  2023-05-23 18:27   ` Bart Schaefer
  2023-05-24 12:42     ` [PATCH] Fix verbose parameter completion tests Marlon Richert
@ 2023-05-30 18:49     ` Vin Shelton
  2023-06-05  7:53       ` Jun T
  1 sibling, 1 reply; 10+ messages in thread
From: Vin Shelton @ 2023-05-30 18:49 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: Marlon Richert, zsh-workers

[-- Attachment #1: Type: text/plain, Size: 1046 bytes --]

Indeed.  I'm getting this error when I test the latest sources:

  comptesteval 'zstyle ":completion:*" fake-parameters bar bat bay'
  comptest $': $ba\t'
Was testing: extra-verbose shows parameter values
../../../src/zsh-2023-05-30/Test/Y01completion.ztst: test failed.
../../../src/zsh-2023-05-30/Test/Y02compmatch.ztst: starting.


This is on arch linux, in case it matters.  Many thanks for fixing this.

  - Vin


On Tue, May 23, 2023 at 2:28 PM Bart Schaefer <schaefer@brasslantern.com>
wrote:

> Test/Y01completion.ztst needs to be updated for this patch.
>
> Test ./Y01completion.ztst failed: output differs from expected as
> shown above for:
>   comptesteval "typeset -a bar=({$'\\0'..$'\\C-?'})"
>   comptesteval 'typeset -A bat=( "$bar[@]" )'
>   comptesteval 'typeset bay="$bar"'
>   comptesteval 'zstyle ":completion:*:parameters" extra-verbose yes'
>   comptesteval 'zstyle ":completion:*" fake-parameters bar bat bay'
>   comptest $': $ba\t'
> Was testing: extra-verbose shows parameter values
>
>

[-- Attachment #2: Type: text/html, Size: 2698 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] Use zstyle verbose for _parameters descriptions
  2023-05-30 18:49     ` [PATCH] Use zstyle verbose for _parameters descriptions Vin Shelton
@ 2023-06-05  7:53       ` Jun T
  2023-06-05 20:24         ` Bart Schaefer
  0 siblings, 1 reply; 10+ messages in thread
From: Jun T @ 2023-06-05  7:53 UTC (permalink / raw)
  To: zsh-workers

It seems the fix is so trivial that no one is prepareing it.
I'll push the following.


diff --git a/Test/Y01completion.ztst b/Test/Y01completion.ztst
index a4060e9a4..fb369ea69 100644
--- a/Test/Y01completion.ztst
+++ b/Test/Y01completion.ztst
@@ -281,10 +281,10 @@ F:regression test workers/31611
   comptesteval "typeset -a bar=({$'\\0'..$'\\C-?'})"
   comptesteval 'typeset -A bat=( "$bar[@]" )'
   comptesteval 'typeset bay="$bar"'
-  comptesteval 'zstyle ":completion:*:parameters" extra-verbose yes'
+  comptesteval 'zstyle ":completion:*:parameters" verbose yes'
   comptesteval 'zstyle ":completion:*" fake-parameters bar bat bay'
   comptest $': $ba\t'
-0:extra-verbose shows parameter values
+0:verbose shows parameter values
 >line: {: $ba}{}
 >DESCRIPTION:{parameter}
 >NO:{bar  -- ( '^@' '^A' '^B' '^C' '^D' '^E' '^F' '^G' '^H' '\t' '\n' '^K' '^L' '}
@@ -294,15 +294,15 @@ F:regression test workers/31611
   comptesteval "path=( $ZTST_srcdir:A )"
   comptesteval 'typeset -H paths=HIDDEN'
   comptest $': $path\t'
-0:extra-verbose doesn't show special or hidden parameter values
+0:verbose doesn't show special or hidden parameter values
 >line: {: $path}{}
 >DESCRIPTION:{parameter}
 >NO:{path}
 >NO:{paths}
 
-  comptesteval 'zstyle -d ":completion:*:parameters" extra-verbose'
+  comptesteval 'zstyle -d ":completion:*:parameters" verbose'
   comptest $': $ba\t'
-0:parameter values not shown without extra-verbose
+0:parameter values not shown without verbose
 >line: {: $ba}{}
 >DESCRIPTION:{parameter}
 >NO:{bar}




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] Use zstyle verbose for _parameters descriptions
  2023-06-05  7:53       ` Jun T
@ 2023-06-05 20:24         ` Bart Schaefer
  2023-06-05 21:12           ` Vin Shelton
  2023-06-06  2:09           ` Jun T
  0 siblings, 2 replies; 10+ messages in thread
From: Bart Schaefer @ 2023-06-05 20:24 UTC (permalink / raw)
  To: Jun T; +Cc: zsh-workers

On Mon, Jun 5, 2023 at 12:53 AM Jun T <takimoto-j@kba.biglobe.ne.jp> wrote:
>
> It seems the fix is so trivial that no one is prepareing it.
> I'll push the following.

Marlon posted something very similar (if not identical) in
workers/51779 -- I've been away for my son's wedding and consequently
haven't picked up or applied anything recently.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] Use zstyle verbose for _parameters descriptions
  2023-06-05 20:24         ` Bart Schaefer
@ 2023-06-05 21:12           ` Vin Shelton
  2023-06-06  2:09           ` Jun T
  1 sibling, 0 replies; 10+ messages in thread
From: Vin Shelton @ 2023-06-05 21:12 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: Jun T, zsh-workers

[-- Attachment #1: Type: text/plain, Size: 553 bytes --]

Although I'm subscribed to zsh-workers, I didn't see Marlon's follow-up.

  - Vin

On Mon, Jun 5, 2023 at 4:25 PM Bart Schaefer <schaefer@brasslantern.com>
wrote:

> On Mon, Jun 5, 2023 at 12:53 AM Jun T <takimoto-j@kba.biglobe.ne.jp>
> wrote:
> >
> > It seems the fix is so trivial that no one is prepareing it.
> > I'll push the following.
>
> Marlon posted something very similar (if not identical) in
> workers/51779 -- I've been away for my son's wedding and consequently
> haven't picked up or applied anything recently.
>
>

[-- Attachment #2: Type: text/html, Size: 1257 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] Use zstyle verbose for _parameters descriptions
  2023-06-05 20:24         ` Bart Schaefer
  2023-06-05 21:12           ` Vin Shelton
@ 2023-06-06  2:09           ` Jun T
  1 sibling, 0 replies; 10+ messages in thread
From: Jun T @ 2023-06-06  2:09 UTC (permalink / raw)
  To: zsh-workers


> 2023/06/06 5:24, Bart Schaefer <schaefer@brasslantern.com> wrote:
> 
> On Mon, Jun 5, 2023 at 12:53 AM Jun T <takimoto-j@kba.biglobe.ne.jp> wrote:
>> 
>> It seems the fix is so trivial that no one is prepareing it.
>> I'll push the following.
> 
> Marlon posted something very similar (if not identical) in
> workers/51779

Sorry. He changed the subject and my MUA was not able to follow it.

I've pushed it.

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2023-06-06  2:10 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-18 20:53 [PATCH] Fix typo in compwid.yo Marlon Richert
2023-05-18 20:53 ` [PATCH] Use zstyle verbose for _parameters descriptions Marlon Richert
2023-05-23 18:27   ` Bart Schaefer
2023-05-24 12:42     ` [PATCH] Fix verbose parameter completion tests Marlon Richert
2023-05-30 18:49     ` [PATCH] Use zstyle verbose for _parameters descriptions Vin Shelton
2023-06-05  7:53       ` Jun T
2023-06-05 20:24         ` Bart Schaefer
2023-06-05 21:12           ` Vin Shelton
2023-06-06  2:09           ` Jun T
2023-05-18 20:53 ` [PATCH] Show alias values in command completions Marlon Richert

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