about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--Completion/Unix/Command/.distfiles1
-rw-r--r--Completion/Unix/Command/_w3m19
-rw-r--r--Completion/Unix/Command/_w3mhistory10
4 files changed, 23 insertions, 14 deletions
diff --git a/ChangeLog b/ChangeLog
index 345fa29f2..c23de4cca 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2003-10-27  Peter Stephenson  <pws@csr.com>
+
+	* zsh-users/6727: from Lloyd Zusman: Completion/Unix/Command/_w3m,
+	Completion/Unix/Command/_w3mhistory,
+	Completion/Unix/Command/.distfiles: improved w3m support inspired
+	by _lynx.
+
 2003-10-26  Bart Schaefer  <schaefer@zsh.org>
 
 	* zsh-users/6738: Functions/Zle/url-quote-magic: replacement for
diff --git a/Completion/Unix/Command/.distfiles b/Completion/Unix/Command/.distfiles
index 04e83bead..33d62a6b9 100644
--- a/Completion/Unix/Command/.distfiles
+++ b/Completion/Unix/Command/.distfiles
@@ -23,4 +23,5 @@ _perforce     _python       _antiword     _screen       _renice       _apm
 _ecasound     _gpg	    _subversion   _aap          _sablotron    _nmap
 _chmod        _du
 _nice	      _rar	    _vorbis
+_w3mhistory
 '
diff --git a/Completion/Unix/Command/_w3m b/Completion/Unix/Command/_w3m
index 70ac75e4c..683a9f67d 100644
--- a/Completion/Unix/Command/_w3m
+++ b/Completion/Unix/Command/_w3m
@@ -1,6 +1,6 @@
 #compdef w3m
 
-local curcontext="$curcontext" state line ret=1
+local curcontext="$curcontext" state line
 typeset -A opt_args
 
 _arguments -C \
@@ -31,19 +31,10 @@ _arguments -C \
   '-o[option]:option-value:' \
   '-config:config file:_files' \
   '-debug' \
-  ':url:->url' && ret=0
+  ':url:->html' && return 0
 
 case $state in
-  url)
-    local _w3mhistory
-
-    if [[ -s ~/.w3m/history ]]; then
-      _w3mhistory=(${(f)"$(<$HOME/.w3m/history)"})
-      compadd $_w3mhistory && ret=0
-    fi
-
-    _urls -f && ret=0
-  ;;
+	html)
+	_alternative 'files:file:_files -g "*.x#html"' 'urls:url:_w3mhist'
+	;;
 esac
-
-return ret
diff --git a/Completion/Unix/Command/_w3mhistory b/Completion/Unix/Command/_w3mhistory
new file mode 100644
index 000000000..f0f944138
--- /dev/null
+++ b/Completion/Unix/Command/_w3mhistory
@@ -0,0 +1,10 @@
+#autoload
+
+local _w3mhistory
+
+if [[ -s ~/.w3m/history ]]; then
+   _w3mhistory=(${(f)"$(<$HOME/.w3m/history)"})
+   compadd $_w3mhistory
+fi
+
+_urls -f