zsh-users
 help / color / mirror / code / Atom feed
* Incomplete completion for w3m under 4.1.1
@ 2003-10-15 19:26 Lloyd Zusman
  2003-10-16  9:45 ` Peter Stephenson
  2003-10-17  5:50 ` Zvi Har'El
  0 siblings, 2 replies; 6+ messages in thread
From: Lloyd Zusman @ 2003-10-15 19:26 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 684 bytes --]

The zsh-4.1.1 completion specification for the 'w3m' program
(specification attached) is incomplete.  It will only try to complete
the final argument if it's some sort of URL.  For example ..

  w3m [ -options ] http://some.url.goes.here

However, w3m can also properly be used in the following way:

  w3m file.html

... where 'file.html' is a file on disk that I want to view.  However,
zsh is not completing these cases.

How can the _w3m completion spec be changed so that both kinds of values
can validly be completed for the final argument? ... or at least so
that I can cause it to switch between the two types of completion
with some sort of keystroke.    Thanks in advance.


[-- Attachment #2: zsh-4.1.1 _w3m --]
[-- Type: text/plain, Size: 1103 bytes --]

#compdef w3m

local curcontext="$curcontext" state line
typeset -A opt_args

_arguments -C \
  '-t[tabwidth]:tabwidth:' \
  '-r[ignore backspace effect]' \
  '-l[preserved lines]:number of lines:' \
  '-B[load bookmark]' \
  '-bookmark:bookmark file:_files' \
  '-T[content-type]:content type:' \
  '-m[internet message mode]' \
  '-v[visual startup mode]' \
  '-M[monochrome display]' \
  '-F[automatically render frame]' \
  '(-dump_source -dump_head)-dump' \
  '-cols:column width:' \
  '(-dump -dump_head)-dump_source' \
  '(-dump -dump_source)-dump_head' \
  '+:goto line:' \
  '-num[show line number]' \
  '-no-proxy' \
  '-no-mouse' \
  '(-no-cookie)-cookie' \
  '(-cookie)-no-cookie' \
  '-no-graph' \
  '-S[squeeze multiple blank lines]' \
  '-W[toggle wrap search mode]' \
  '-X[do not use termcap init/deinit]' \
  '-o[option]:option-value:' \
  '-config:config file:_files' \
  '-debug' \
  ':url:->url' && return 0

case $state in
	url)
	local _w3mhistory

	if [[ -s ~/.w3m/history ]]; then
	   _w3mhistory=(${(f)"$(<$HOME/.w3m/history)"})
	   compadd $_w3mhistory
	fi

	_urls -f
	;;

esac

[-- Attachment #3: Type: text/plain, Size: 36 bytes --]



-- 
 Lloyd Zusman
 ljz@asfast.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2003-10-21 21:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-15 19:26 Incomplete completion for w3m under 4.1.1 Lloyd Zusman
2003-10-16  9:45 ` Peter Stephenson
2003-10-21 18:29   ` Lloyd Zusman
2003-10-21 21:06     ` Lloyd Zusman
2003-10-17  5:50 ` Zvi Har'El
2003-10-21 18:30   ` Lloyd Zusman

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).