about summary refs log tree commit diff
diff options
context:
space:
mode:
authorOliver Kiddle <opk@users.sourceforge.net>2001-12-12 11:29:34 +0000
committerOliver Kiddle <opk@users.sourceforge.net>2001-12-12 11:29:34 +0000
commitaed1bad64acc50aaa4c34495957dd7b9c218b38d (patch)
treed1ff58017e4fd7af709343805581d6e2c7c2deef
parent5cf4508f4260768a6e0a764e127046e79f9ce068 (diff)
downloadzsh-aed1bad64acc50aaa4c34495957dd7b9c218b38d.tar.gz
zsh-aed1bad64acc50aaa4c34495957dd7b9c218b38d.tar.xz
zsh-aed1bad64acc50aaa4c34495957dd7b9c218b38d.zip
allow tag-order to select order of files and urls (16330)
-rw-r--r--ChangeLog9
-rw-r--r--Completion/Unix/Command/_links8
-rw-r--r--Completion/Unix/Command/_lynx2
-rw-r--r--Completion/Unix/Command/_w3m2
-rw-r--r--Completion/X/Command/_netscape46
5 files changed, 38 insertions, 29 deletions
diff --git a/ChangeLog b/ChangeLog
index 18d6f6fa8..9fae33a17 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,13 @@
+2001-12-12  Oliver Kiddle  <opk@zsh.org>
+
+	* 16330: Completion/X/Command/_netscape, 
+	Completion/Unix/Command/_lynx, Completion/Unix/Command/_links,
+	Completion/Unix/Command/_w3m: allow tag-order to select order of
+	files and urls instead of files first
+
 2001-12-11  Clint Adams  <clint@zsh.org>
 
-	* 16326: Completion/Debian/Command/_dpkg:
+	* 16327: Completion/Debian/Command/_dpkg:
 	glob for udebs as well as debs.
 
 	* 16326: Completion/Unix/Command/_webbrowser,
diff --git a/Completion/Unix/Command/_links b/Completion/Unix/Command/_links
index 1eb7e4d21..ce8512fc1 100644
--- a/Completion/Unix/Command/_links
+++ b/Completion/Unix/Command/_links
@@ -24,8 +24,6 @@ _arguments -C \
        '-help' \
        ':url:->html' && return 0
 
-case "$state" in
-html)
-  _files -g '*.html' || _urls
-  ;;
-esac
+if [[ "$state" = html ]]; then
+  _alternative 'files:file:_files "*.html"' 'urls:url:_urls'
+fi
diff --git a/Completion/Unix/Command/_lynx b/Completion/Unix/Command/_lynx
index 2d5978d27..c87563047 100644
--- a/Completion/Unix/Command/_lynx
+++ b/Completion/Unix/Command/_lynx
@@ -107,6 +107,6 @@ restrictions)
     outside_telnet print shell suspend telnet_port useragent
   ;;
 html)
-  _files -g '*.html' || _urls
+  _alternative 'files:file:_files "*.html"' 'urls:url:_urls'
   ;;
 esac
diff --git a/Completion/Unix/Command/_w3m b/Completion/Unix/Command/_w3m
index a2a0d0b32..798f2e760 100644
--- a/Completion/Unix/Command/_w3m
+++ b/Completion/Unix/Command/_w3m
@@ -42,7 +42,7 @@ case $state in
 	   compadd $_w3mhistory
 	fi
 
-	_urls || _files -g '*.html'
+	_alternative 'files:file:_files "*.html"' 'urls:url:_urls'
 	;;
 
 esac
diff --git a/Completion/X/Command/_netscape b/Completion/X/Command/_netscape
index 99d6ee45c..be38e0c85 100644
--- a/Completion/X/Command/_netscape
+++ b/Completion/X/Command/_netscape
@@ -24,9 +24,6 @@ _x_arguments -C \
   -{component-bar,composer,edit,messenger,mail,discussions,news} \
   '*:location:->urls' && ret=0
 
-[[ "$state" = "urls" ]] &&
-  _files "$@" && return 0
-
 # Handle netscape remote commands
 if [[ "$state" = "remote" ]]; then  
   local -a remote_commands
@@ -69,24 +66,31 @@ if [[ "$state" = "remote" ]]; then
 fi
 
 if [[ "$state" = "urls" ]]; then
-  # Complete netscape urls
-  if compset -P 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
-  elif compset -P news: ; then
-    _newsgroups "$@" && ret=0
-  else
-    _tags prefixes
-    while _tags; do
-      while _next_label prefixes expl 'URL prefix' "$@"; do
-        _urls "$expl[@]" && ret=0
-	compset -S '[^:]*'
-        compadd -S '' "$expl[@]" about: news: mocha: javascript: && ret=0
-      done
-      (( ret )) || return 0
-    done
-  fi
+  _tags files urls
+  while _tags; do
+    _requested files expl 'file' _files "$@" && ret=0
+    if _requested urls; then
+      # Complete netscape urls
+      if compset -P 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
+      elif compset -P news: ; then
+	_newsgroups "$@" && ret=0
+      else
+	_tags prefixes
+	while _tags; do
+	  while _next_label prefixes expl 'URL prefix' "$@"; do
+            _urls "$expl[@]" && ret=0
+	    compset -S '[^:]*'
+            compadd -S '' "$expl[@]" about: news: mocha: javascript: && ret=0
+	  done
+	  (( ret )) || return 0
+	done
+      fi
+    fi
+    (( ret )) || return 0
+  done
 fi
 
 return ret