about summary refs log tree commit diff
path: root/Completion/X
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2000-04-11 07:57:56 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2000-04-11 07:57:56 +0000
commitfac3086d9782e73dcaf1aa65fd36a0b63a374719 (patch)
tree7bab35e2787ca17f02ec932dffae1bfff2ffcfe3 /Completion/X
parent37012f06a7e5e8a64614dbf9032c77cff1bcfcfb (diff)
downloadzsh-fac3086d9782e73dcaf1aa65fd36a0b63a374719.tar.gz
zsh-fac3086d9782e73dcaf1aa65fd36a0b63a374719.tar.xz
zsh-fac3086d9782e73dcaf1aa65fd36a0b63a374719.zip
_wanted now tests both tags and labels; change places where _wanted was called without a command; allow multiple patterns per string in file-patterns; update _next_tags to work with labels (10632)
Diffstat (limited to 'Completion/X')
-rw-r--r--Completion/X/_x_colormapid4
-rw-r--r--Completion/X/_x_display2
-rw-r--r--Completion/X/_x_extension6
-rw-r--r--Completion/X/_x_font4
-rw-r--r--Completion/X/_x_keysym4
-rw-r--r--Completion/X/_x_window6
-rw-r--r--Completion/X/_xmodmap6
-rw-r--r--Completion/X/_xutils24
-rw-r--r--Completion/X/_xwit2
9 files changed, 33 insertions, 25 deletions
diff --git a/Completion/X/_x_colormapid b/Completion/X/_x_colormapid
index 3c637c1d9..61b0a72f1 100644
--- a/Completion/X/_x_colormapid
+++ b/Completion/X/_x_colormapid
@@ -2,7 +2,7 @@
 
 local expl list desc
 
-_wanted colormapids || return 1
+_tags colormapids || return 1
 
 list=(${(f)"$(xprop -root -f RGB_COLOR_MAP 32xcccccccxx ': $0\n'|awk -F'[ ():]' '/^[a-zA-Z_]+\(RGB_COLOR_MAP\)/ {print $5, "--", $1}')"})
 
@@ -12,5 +12,5 @@ else
   desc=()
 fi
 
-_all_labels colormapids expl 'colormap id' \
+_wanted colormapids expl 'colormap id' \
     compadd "$@" "$desc[@]" - "${(@)list%% *}" 
diff --git a/Completion/X/_x_display b/Completion/X/_x_display
index 94c3fa9a4..f547a64fa 100644
--- a/Completion/X/_x_display
+++ b/Completion/X/_x_display
@@ -1,3 +1,3 @@
 #autoload
 
-_wanted displays && _hosts -S ':0 ' -r :
+_tags displays && _hosts -S ':0 ' -r :
diff --git a/Completion/X/_x_extension b/Completion/X/_x_extension
index 11e53fa6c..5b742a78c 100644
--- a/Completion/X/_x_extension
+++ b/Completion/X/_x_extension
@@ -2,18 +2,18 @@
 
 local expl
 
-_wanted extensions || return 1
+_tags extensions || return 1
 
 (( $+_xe_cache )) || _xe_cache=( "${(@)${(@f)$(xdpyinfo)}[(r)number of extensions:*,-1][2,(r)default screen number:*][1,-2]//[      ]}" )
 
 if [[ "$1" = -a ]]; then
   shift
 
-  _all_labels extensions expl 'X extensions' \
+  _wanted extensions expl 'X extensions' \
       compadd "$@" -M 'm:{a-z}={A-Z} r:|-=* r:|=*' - all "$_xe_cache[@]"
 else
   [[ "$1" = - ]] && shift
 
-  _all_labels extensions expl 'X extensions' \
+  _wanted extensions expl 'X extensions' \
       compadd "$@" -M 'm:{a-z}={A-Z} r:|-=* r:|=*' - "$_xe_cache[@]"
 fi
diff --git a/Completion/X/_x_font b/Completion/X/_x_font
index 43a713b34..228542bd2 100644
--- a/Completion/X/_x_font
+++ b/Completion/X/_x_font
@@ -2,7 +2,7 @@
 
 local expl
 
-_wanted fonts || return 1
+_tags fonts || return 1
 
 # This *has* to be improved some day...
 
@@ -12,5 +12,5 @@ if (( ! $+_font_cache )); then
  _font_cache=( "${(@)^${(@f)$(_call fonts xlsfonts)}%%--*}--" )
 fi
 
-_all_labels fonts expl font \
+_wanted fonts expl font \
     compadd -M 'r:|-=* r:|=*' "$@" -S '' - "$_font_cache[@]"
diff --git a/Completion/X/_x_keysym b/Completion/X/_x_keysym
index f50762f7e..8d4cfa1f8 100644
--- a/Completion/X/_x_keysym
+++ b/Completion/X/_x_keysym
@@ -2,7 +2,7 @@
 
 local expl
 
-_wanted keysyms || return 1
+_tags keysyms || return 1
 
 if (( ! $+_keysym_cache )); then
   local file
@@ -18,5 +18,5 @@ if (( ! $+_keysym_cache )); then
   fi
 fi
 
-_all_labels keysyms expl 'key symbol' \
+_wanted keysyms expl 'key symbol' \
     compadd "$@" -M 'm:{a-z}={A-Z} r:|-=* r:|=*' - $_keysym_cache
diff --git a/Completion/X/_x_window b/Completion/X/_x_window
index 1862db9a7..24d6048a7 100644
--- a/Completion/X/_x_window
+++ b/Completion/X/_x_window
@@ -2,17 +2,17 @@
 
 local list expl
 
-_wanted windows || return 1
+_tags windows || return 1
 
 list=( "${(@)${(M@)${(@f)$(_call windows xwininfo -root -tree)}:#[ 	]#0x[0-9a-f]# \"*}##[ 	]#}" )
 
 if [[ "$1" = -n ]]; then
   shift
 
-  _all_labels windows expl 'window name' \
+  _wanted windows expl 'window name' \
       compadd "$@" -d list - "${(@)${(@)list#*\"}%%\"*}"
 else
   [[ "$1" = - ]] && shift
 
-  _all_labels windows expl 'window ID' compadd "$@" -d list - "${(@)list%% *}"
+  _wanted windows expl 'window ID' compadd "$@" -d list - "${(@)list%% *}"
 fi
diff --git a/Completion/X/_xmodmap b/Completion/X/_xmodmap
index 6595d5adf..5c7fcf3fe 100644
--- a/Completion/X/_xmodmap
+++ b/Completion/X/_xmodmap
@@ -82,12 +82,14 @@ if [[ -n "$state" ]]; then
     [[ "$what" = *ksym* ]] && _x_keysym "$suf[@]" && ret=0
 
   else
-    if _wanted commands; then
+    _tags commands
+    while _tags; do
       while _next_label commands expl command; do
         compadd "$expl[@]" -S ' ' keycode keysym clear add remove && ret=0
         compadd "$expl[@]" -S ' = ' pointer && ret=0
       done
-    fi
+      (( ret )) || return 0
+    done
   fi
 fi
 
diff --git a/Completion/X/_xutils b/Completion/X/_xutils
index a57f7be36..c0d94a998 100644
--- a/Completion/X/_xutils
+++ b/Completion/X/_xutils
@@ -55,23 +55,29 @@ xhost)
     if [[ "$tmp" = *:* ]]; then
       if compset -P '(#b)(*):'; then
 	type="$match[1]"
-	_wanted displays &&
-            while _next_label displays expl 'disallow access'; do
+	_tags displays
+	while _tags; do
+          while _next_label displays expl 'disallow access'; do
 	      { compadd "$expl[@]" -M 'm:{a-z}={A-Z} r:|[:.]=* r:|=*' - \
 		        ${${(M)tmp:#(#i)$type:*}#(#i)$type:} ||
-	            _hosts "$expl[@]" } && return 0
-	    done
+	            _hosts "$expl[@]" } && ret=0
+	  done
+	  (( ret )) || return 0
+        done
       else
 	_alternative \
 	    'types:name family:compadd -S: ${(L)tmp%%:*}' \
 	    'hosts:host:compadd ${(@)tmp#*:}' && ret=0
       fi
     else
-      _wanted displays &&
-          while _next_label displays expl 'disallow access'; do
-	    { compadd "$expl[@]" -M 'm:{a-z}={A-Z} r:|[:.]=* r:|=*' - $tmp ||
-              _hosts "$expl[@]" } && return 0
-          done
+      _tags displays
+      while _tags; do
+        while _next_label displays expl 'disallow access'; do
+	  { compadd "$expl[@]" -M 'm:{a-z}={A-Z} r:|[:.]=* r:|=*' - $tmp ||
+            _hosts "$expl[@]" } && ret=0
+        done
+	(( ret )) || return 0
+      done
     fi
   else
     compset -P +
diff --git a/Completion/X/_xwit b/Completion/X/_xwit
index 998627869..69b210e5b 100644
--- a/Completion/X/_xwit
+++ b/Completion/X/_xwit
@@ -17,7 +17,7 @@ _xwit_guard () {
 _xwit_compopts () {
   local expl
   _wanted options expl option compadd - ${(k)no[(R)*~0]} ||
-      _all_labels options expl option compadd - ${(k)no}
+      _wanted options expl option compadd - ${(k)no}
 }
 
 _regex_arguments _xwit_parse \