about summary refs log tree commit diff
path: root/Completion/User/_netscape
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/User/_netscape')
-rw-r--r--Completion/User/_netscape45
1 files changed, 20 insertions, 25 deletions
diff --git a/Completion/User/_netscape b/Completion/User/_netscape
index 3caaad05e..2f0537133 100644
--- a/Completion/User/_netscape
+++ b/Completion/User/_netscape
@@ -1,9 +1,9 @@
 #compdef netscape
 
-local context state line ret=1
+local curcontext="$curcontext" state line ret=1
 typeset -A opt_args
 
-_x_arguments \
+_x_arguments -C \
   '-xrm:resource:_x_resource' \
   '-help[show usage message]' \
   '-version[show the version number and build date]' \
@@ -25,7 +25,7 @@ _x_arguments \
   '*:location:->urls' && ret=0
 
 [[ "$state" = "urls" ]] &&
-  _tags "$context" files && _files "$@" && return 0
+  _files "$@" && return 0
 
 
 # Handle netscape remote commands
@@ -40,35 +40,33 @@ if [[ "$state" = "remote" ]]; then
     openFile*) _files -W ~;;
     saveAs*) 
       if compset -P "*,"; then
-        if _tags "$context" types; then
-          _description expl 'data type'
-          compadd -s")" -M 'm:{a-zA-Z}={A-Za-z}' HTML Text PostScript &&
-              ret=0
+        _wanted types expl 'data type' &&
+            compadd -s")" -M 'm:{a-zA-Z}={A-Za-z}' HTML Text PostScript &&
+                ret=0
         fi
       else
-        _tags "$context" files && _path_files -W ~ && ret=0
+        _tags files && _path_files -W ~ && ret=0
       fi
     ;;
     mailto*)
       compset -P "*,"
       if compset -P '*@'; then
-        if _tags "$context" hosts; then
-          _description expl 'remote host name'
-          _hosts "$expl[@]" -q -S, && ret=0
+        _wanted hosts expl 'remote host name' &&
+            _hosts "$expl[@]" -q -S, && ret=0
         fi
       else
-        if _tags "$context" users; then
-          _description expl 'login name'
-          _users "$expl[@]" -q -S@ && ret=0
+        _wanted users expl 'login name' && _users "$expl[@]" -q -S@ && ret=0
         fi
       fi
     ;;
     *)
-      if _tags "$context" commands; then
+      if _wanted commands expl 'remote commands'; then
         if [[ "$QIPREFIX" ]]; then
-          compadd -q -S '(' -M 'm:{a-zA-Z}={A-Za-z}' $remote_commands && ret=0
+          compadd "$expl[@]" -qS '(' -M 'm:{a-zA-Z}={A-Za-z}' - \
+                  $remote_commands && ret=0
         else
-	  compadd -s'(' -S '' -M 'm:{a-zA-Z}={A-Za-z}' $remote_commands && ret=0
+	  compadd "$expl[@]" -s'(' -S '' -M 'm:{a-zA-Z}={A-Za-z}' - \
+                  $remote_commands && ret=0
 	fi
       fi
     ;;
@@ -77,15 +75,12 @@ fi
 
 if [[ "$state" = "urls" ]]; then
   # Complete netscape urls
-  if [[ -prefix about: ]]; then
-    if _tags "$context" values; then
-      _description expl 'about what'
-      compset -P about:
-      compadd authors blank cache document fonts global hype image-cache \
-          license logo memory-cache mozilla plugins && ret=0
-    fi
+  if compset about: ; then
+    _wanted values expl 'about what' &&
+        compadd authors blank cache document fonts global hype image-cache \
+            license logo memory-cache mozilla plugins && ret=0
   else
-    if _tags "$context" prefixes; then
+    if _tags prefixes; then
       _description expl 'URL prefix'
       compadd "$expl[@]" -S '' about: mocha: javascript:
       _urls "$@" && ret=0