about summary refs log tree commit diff
path: root/Completion/X/_xmodmap
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/X/_xmodmap')
-rw-r--r--Completion/X/_xmodmap20
1 files changed, 11 insertions, 9 deletions
diff --git a/Completion/X/_xmodmap b/Completion/X/_xmodmap
index 0f6514eb6..1cd461d4c 100644
--- a/Completion/X/_xmodmap
+++ b/Completion/X/_xmodmap
@@ -1,11 +1,9 @@
 #compdef xmodmap
 
-setopt localoptions extendedglob
+local curcontext="$curcontext" state line ret=1
+typeset -A opt_args
 
-local state line ret=1
-typeset -A options
-
-_x_arguments \
+_x_arguments -C \
   -{help,grammar,verbose,quiet} \
   '-n[only show what would be done]' \
   '*-e[specify expression]:expression:->expr' \
@@ -57,7 +55,7 @@ if [[ -n "$state" ]]; then
     pointer*)
       if compset -P '*=[ 	]#'; then
         compset -P '*[ 	]'
-        _description expl 'button code'
+        _description values expl 'button code'
         compadd "$expl[@]" -qS ' ' 1 2 3 4 5 default
         return
       else
@@ -84,9 +82,13 @@ if [[ -n "$state" ]]; then
     [[ "$what" = *ksym* ]] && _x_keysym "$suf[@]" && ret=0
 
   else
-    _description expl command
-    compadd "$expl[@]" -S ' ' keycode keysym clear add remove && ret=0
-    compadd "$expl[@]" -S ' = ' pointer && ret=0
+    if _wanted commands; then
+      while _next_label commands expl command; do
+        compadd "$expl[@]" -S ' ' keycode keysym clear add remove && ret=0
+        compadd "$expl[@]" -S ' = ' pointer && ret=0
+        (( ret )) || return 0
+      done
+    fi
   fi
 fi