zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: minor fix to compset usage
@ 2017-10-08 23:10 Oliver Kiddle
  0 siblings, 0 replies; only message in thread
From: Oliver Kiddle @ 2017-10-08 23:10 UTC (permalink / raw)
  To: Zsh workers

ogg123 completion does compset -p '*:' which is a typo. The intention
seems to have been -P.

We've also got a few cases where we do compset -P \?. There's nothing as
such wrong with that but compset -p 1 ought to be a more efficient way
to do the same thing. And as I tweaked them anyway to give me a few more
test cases for the previous patch, I've included that in this patch.

Oliver

diff --git a/Completion/Unix/Command/_less b/Completion/Unix/Command/_less
index 9092010f2..7f01952d2 100644
--- a/Completion/Unix/Command/_less
+++ b/Completion/Unix/Command/_less
@@ -91,7 +91,7 @@ _arguments -S -s -A "[-+]*"  \
 if [[ -n "$state" ]]; then
   case $state in
     prompts)
-      if compset -P \?; then
+      if compset -p 1; then
 	_message -e prompt
       else
 	_describe 'prompt' '(
diff --git a/Completion/Unix/Command/_vorbis b/Completion/Unix/Command/_vorbis
index eee4f7a5e..cb3e3f9d8 100644
--- a/Completion/Unix/Command/_vorbis
+++ b/Completion/Unix/Command/_vorbis
@@ -79,7 +79,7 @@ case $service in
 esac
 
 if [[ $state = devopts ]]; then
-  if compset -p '*:'; then
+  if compset -P '*:'; then
     _message -e value value
   else
     _wanted devopts expl 'device option' \
diff --git a/Completion/Unix/Type/_tilde_files b/Completion/Unix/Type/_tilde_files
index b1b3b37f0..0ee12332b 100644
--- a/Completion/Unix/Type/_tilde_files
+++ b/Completion/Unix/Type/_tilde_files
@@ -29,7 +29,7 @@ case "$PREFIX" in
   _files "$@" -W "$user"
   ;;
 \~*)
-  compset -P '?'
+  compset -p 1
   local -a expl=( "$@" )
   _alternative -O expl users:user:_users named-directories:'named directory':'compadd -k nameddirs'
   ;;
diff --git a/Completion/Zsh/Type/_globquals b/Completion/Zsh/Type/_globquals
index a904bdf0d..c855b540e 100644
--- a/Completion/Zsh/Type/_globquals
+++ b/Completion/Zsh/Type/_globquals
@@ -167,7 +167,7 @@ while [[ -n $PREFIX ]]; do
     
     ([oO])
     # complete/skip sort spec
-    if ! compset -P "?"; then
+    if ! compset -p 1; then
       alts=(
         "n:lexical order of name"
         "L:size of file"


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-10-08 23:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-08 23:10 PATCH: minor fix to compset usage Oliver Kiddle

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