zsh-workers
 help / color / mirror / code / Atom feed
* Re: Incomplete completion for w3m under 4.1.1
       [not found] <m3fzhmz4f2.fsf@asfast.com>
@ 2003-10-27 11:18 ` Peter Stephenson
  0 siblings, 0 replies; 4+ messages in thread
From: Peter Stephenson @ 2003-10-27 11:18 UTC (permalink / raw)
  To: ljz, zsh-workers

Lloyd Zusman wrote:
> Correction: the _w3mhist function I sent in my earlier message should
> begin something like this:  #compdef w3m
> 
> The "-default-" I put there was wrong.

I suspect you want `#autoload' since _w3m already has the #compdef w3m.
I've committed it with that in.

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, UK                          Tel: +44 (0)1223 692070


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************


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

* Re: Incomplete completion for w3m under 4.1.1
  2003-12-16 17:00   ` Zvi Har'El
  2003-12-16 17:40     ` Oliver Kiddle
@ 2003-12-16 18:17     ` Zvi Har'El
  1 sibling, 0 replies; 4+ messages in thread
From: Zvi Har'El @ 2003-12-16 18:17 UTC (permalink / raw)
  To: Lloyd Zusman; +Cc: Zsh hackers list

Actually, the submitted patch lost the w3m history. A much simpler patch seems
to be correct:


--- zsh-4.1.1/Completion/Unix/Command/_w3m.~20021015175942~	2002-10-15 19:59:42.000000000 +0200
+++ zsh-4.1.1/Completion/Unix/Command/_w3m	2003-12-16 20:08:43.000000000 +0200
@@ -42,7 +42,7 @@
 	   compadd $_w3mhistory
 	fi
 
-	_urls -f
+      _alternative 'files:file:_files -g "*.x#html"' 'urls:url:_urls'
 	;;
 
 esac

I suggest also that the function _url should be fixed to add https:// to the
list of protocols it generates - this is much more common this days than
gopher:// ;-)


On Tue, 16 Dec 2003 19:00:58 +0200, Zvi Har'El wrote about "Re: Incomplete completion for w3m under 4.1.1":
> The following patch enables file name completion in addition to url
> completion in w3m, the way lynx does: 
> 
> 
> --- zsh-4.1.1/Completion/Unix/Command/_w3m.~20021015175942~	2002-10-15 19:59:42.000000000 +0200
> +++ zsh-4.1.1/Completion/Unix/Command/_w3m	2003-12-16 18:54:56.000000000 +0200
> @@ -31,7 +31,7 @@
>    '-o[option]:option-value:' \
>    '-config:config file:_files' \
>    '-debug' \
> -  ':url:->url' && return 0
> +  ':url:->html' && return 0
>  
>  case $state in
>  	url)
> @@ -44,5 +44,7 @@
>  
>  	_urls -f
>  	;;
> +	html)
> +      _alternative 'files:file:_files -g "*.x#html"' 'urls:url:_urls'
>  
>  esac
> 
> On Fri, 17 Oct 2003 07:50:46 +0200, Zvi Har'El wrote about "Re: Incomplete completion for w3m under 4.1.1":
> > Perhaps _w3m should be fixed to resemble _lynx, i.e., the last parameter for
> > the _arguments function should be ':url:->html' rather then ':url:->url' .
> > What I do now when I wish zsh to complete files in the current directory is to
> > start with "w3m fi<TAB>" and next "w3m file://<TAB>" which completes the
> > current directory. 
> > 
> > On Wed, 15 Oct 2003 15:26:16 -0400, Lloyd Zusman wrote about "Incomplete completion for w3m under 4.1.1":
> > > 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.
> > > 
> > 
> > Content-Description: zsh-4.1.1 _w3m
> > > #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
> > 
> > > 
> > > 
> > > -- 
> > >  Lloyd Zusman
> > >  ljz@asfast.com
> > 
> > 
> > -- 
> > Dr. Zvi Har'El     mailto:rl@math.technion.ac.il     Department of Mathematics
> > tel:+972-54-227607 icq:179294841     Technion - Israel Institute of Technology
> > fax:+972-4-8293388 http://www.math.technion.ac.il/~rl/     Haifa 32000, ISRAEL
> > "If you can't say somethin' nice, don't say nothin' at all." -- Thumper (1942)
> >                               Friday, 21 Tishri 5764, 17 October 2003,  7:40AM
> 
> -- 
> Dr. Zvi Har'El     mailto:rl@math.technion.ac.il     Department of Mathematics
> tel:+972-54-227607 icq:179294841     Technion - Israel Institute of Technology
> fax:+972-4-8293388 http://www.math.technion.ac.il/~rl/     Haifa 32000, ISRAEL
> "If you can't say somethin' nice, don't say nothin' at all." -- Thumper (1942)
>                             Tuesday, 22 Kislev 5764, 16 December 2003,  6:47PM

-- 
Dr. Zvi Har'El     mailto:rl@math.technion.ac.il     Department of Mathematics
tel:+972-54-227607 icq:179294841     Technion - Israel Institute of Technology
fax:+972-4-8293388 http://www.math.technion.ac.il/~rl/     Haifa 32000, ISRAEL
"If you can't say somethin' nice, don't say nothin' at all." -- Thumper (1942)
                            Tuesday, 22 Kislev 5764, 16 December 2003,  8:14PM


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

* Re: Incomplete completion for w3m under 4.1.1
  2003-12-16 17:00   ` Zvi Har'El
@ 2003-12-16 17:40     ` Oliver Kiddle
  2003-12-16 18:17     ` Zvi Har'El
  1 sibling, 0 replies; 4+ messages in thread
From: Oliver Kiddle @ 2003-12-16 17:40 UTC (permalink / raw)
  To: Zvi Har'El; +Cc: Zsh hackers list

"Zvi Har'El" wrote:
> The following patch enables file name completion in addition to url
> completion in w3m, the way lynx does: 

The _w3m in cvs (both branches) has changed significantly since the one
distributed with zsh 4.1.1 so your patch is no longer pertinent. Thanks
in any case.

Arguably the same change in _webbrowser should be backported to 4.0.

Oliver


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

* Re: Incomplete completion for w3m under 4.1.1
       [not found] ` <20031017055046.GA1976@fermat.math.technion.ac.il>
@ 2003-12-16 17:00   ` Zvi Har'El
  2003-12-16 17:40     ` Oliver Kiddle
  2003-12-16 18:17     ` Zvi Har'El
  0 siblings, 2 replies; 4+ messages in thread
From: Zvi Har'El @ 2003-12-16 17:00 UTC (permalink / raw)
  To: Lloyd Zusman; +Cc: Zsh hackers list

The following patch enables file name completion in addition to url
completion in w3m, the way lynx does: 


--- zsh-4.1.1/Completion/Unix/Command/_w3m.~20021015175942~	2002-10-15 19:59:42.000000000 +0200
+++ zsh-4.1.1/Completion/Unix/Command/_w3m	2003-12-16 18:54:56.000000000 +0200
@@ -31,7 +31,7 @@
   '-o[option]:option-value:' \
   '-config:config file:_files' \
   '-debug' \
-  ':url:->url' && return 0
+  ':url:->html' && return 0
 
 case $state in
 	url)
@@ -44,5 +44,7 @@
 
 	_urls -f
 	;;
+	html)
+      _alternative 'files:file:_files -g "*.x#html"' 'urls:url:_urls'
 
 esac

On Fri, 17 Oct 2003 07:50:46 +0200, Zvi Har'El wrote about "Re: Incomplete completion for w3m under 4.1.1":
> Perhaps _w3m should be fixed to resemble _lynx, i.e., the last parameter for
> the _arguments function should be ':url:->html' rather then ':url:->url' .
> What I do now when I wish zsh to complete files in the current directory is to
> start with "w3m fi<TAB>" and next "w3m file://<TAB>" which completes the
> current directory. 
> 
> On Wed, 15 Oct 2003 15:26:16 -0400, Lloyd Zusman wrote about "Incomplete completion for w3m under 4.1.1":
> > 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.
> > 
> 
> Content-Description: zsh-4.1.1 _w3m
> > #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
> 
> > 
> > 
> > -- 
> >  Lloyd Zusman
> >  ljz@asfast.com
> 
> 
> -- 
> Dr. Zvi Har'El     mailto:rl@math.technion.ac.il     Department of Mathematics
> tel:+972-54-227607 icq:179294841     Technion - Israel Institute of Technology
> fax:+972-4-8293388 http://www.math.technion.ac.il/~rl/     Haifa 32000, ISRAEL
> "If you can't say somethin' nice, don't say nothin' at all." -- Thumper (1942)
>                               Friday, 21 Tishri 5764, 17 October 2003,  7:40AM

-- 
Dr. Zvi Har'El     mailto:rl@math.technion.ac.il     Department of Mathematics
tel:+972-54-227607 icq:179294841     Technion - Israel Institute of Technology
fax:+972-4-8293388 http://www.math.technion.ac.il/~rl/     Haifa 32000, ISRAEL
"If you can't say somethin' nice, don't say nothin' at all." -- Thumper (1942)
                            Tuesday, 22 Kislev 5764, 16 December 2003,  6:47PM


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

end of thread, other threads:[~2003-12-16 18:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <m3fzhmz4f2.fsf@asfast.com>
2003-10-27 11:18 ` Incomplete completion for w3m under 4.1.1 Peter Stephenson
     [not found] <m3u16afgkn.fsf@asfast.com>
     [not found] ` <20031017055046.GA1976@fermat.math.technion.ac.il>
2003-12-16 17:00   ` Zvi Har'El
2003-12-16 17:40     ` Oliver Kiddle
2003-12-16 18:17     ` Zvi Har'El

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).