Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: minor fix to compset usage



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"



Messages sorted by: Reverse Date, Date, Thread, Author