From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9824 invoked from network); 12 Dec 2001 11:25:06 -0000 Received: from ns2.primenet.com.au (HELO primenet.com.au) (?TdLb7USRC0fxpQTK75yvQGF4uHvFdqmK?@203.24.36.3) by ns1.primenet.com.au with SMTP; 12 Dec 2001 11:25:06 -0000 Received: (qmail 5536 invoked from network); 12 Dec 2001 11:25:04 -0000 Received: from sunsite.dk (130.225.247.90) by proxy.melb.primenet.com.au with SMTP; 12 Dec 2001 11:25:04 -0000 Received: (qmail 26858 invoked by alias); 12 Dec 2001 11:24:57 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 16330 Received: (qmail 26847 invoked from network); 12 Dec 2001 11:24:57 -0000 X-VirusChecked: Checked X-Authentication-Warning: iris.logica.co.uk: Host kiddleo@rambo.logica.co.uk [158.234.33.58] claimed to be yahoo.co.uk Sender: kiddleo@iris.logica.co.uk Message-ID: <3C173E6B.251ACAD4@yahoo.co.uk> Date: Wed, 12 Dec 2001 11:24:27 +0000 From: Oliver Kiddle X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.2.15 i686) X-Accept-Language: en MIME-Version: 1.0 To: Tanaka Akira CC: zsh-workers@sunsite.dk Subject: Re: _urls -f References: <3C163FA6.BC9C1A66@yahoo.co.uk> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Tanaka Akira wrote: > Oliver Kiddle writes: > > I don't like the behaviour of _urls -f in that it completes files before > > urls without letting you define a style to complete both together or > > urls first. > > Agreed. I think it was my fault. Good, I'll apply that then. Here's the patch to make the same change for netscape, links, lynx and w3m. For netscape, a tag-order of urls before files doesn't seem to work entirely so I think I'm still misunderstanding the tags stuff there somewhere. Oliver Index: Completion/Unix/Command/_links =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_links,v retrieving revision 1.1 diff -u -r1.1 _links --- Completion/Unix/Command/_links 2001/08/22 21:37:00 1.1 +++ Completion/Unix/Command/_links 2001/12/12 11:22:08 @@ -24,8 +24,6 @@ '-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 Index: Completion/Unix/Command/_lynx =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_lynx,v retrieving revision 1.1 diff -u -r1.1 _lynx --- Completion/Unix/Command/_lynx 2001/04/02 11:56:16 1.1 +++ Completion/Unix/Command/_lynx 2001/12/12 11:22:08 @@ -107,6 +107,6 @@ outside_telnet print shell suspend telnet_port useragent ;; html) - _files -g '*.html' || _urls + _alternative 'files:file:_files "*.html"' 'urls:url:_urls' ;; esac Index: Completion/Unix/Command/_w3m =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_w3m,v retrieving revision 1.2 diff -u -r1.2 _w3m --- Completion/Unix/Command/_w3m 2001/05/03 13:05:49 1.2 +++ Completion/Unix/Command/_w3m 2001/12/12 11:22:09 @@ -42,7 +42,7 @@ compadd $_w3mhistory fi - _urls || _files -g '*.html' + _alternative 'files:file:_files "*.html"' 'urls:url:_urls' ;; esac Index: Completion/X/Command/_netscape =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/X/Command/_netscape,v retrieving revision 1.1 diff -u -r1.1 _netscape --- Completion/X/Command/_netscape 2001/04/02 12:14:25 1.1 +++ Completion/X/Command/_netscape 2001/12/12 11:22:09 @@ -24,9 +24,6 @@ -{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 @@ 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 _____________________________________________________________________ This message has been checked for all known viruses by the MessageLabs Virus Scanning Service. For further information visit http://www.messagelabs.com/stats.asp