From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14914 invoked from network); 28 Jun 2005 11:38:18 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 28 Jun 2005 11:38:18 -0000 Received: (qmail 70825 invoked from network); 28 Jun 2005 11:38:12 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 28 Jun 2005 11:38:12 -0000 Received: (qmail 8766 invoked by alias); 28 Jun 2005 11:38:09 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 21392 Received: (qmail 8756 invoked from network); 28 Jun 2005 11:38:09 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 28 Jun 2005 11:38:09 -0000 Received: (qmail 70529 invoked from network); 28 Jun 2005 11:38:09 -0000 Received: from grunt23.ihug.com.au (203.109.249.143) by a.mx.sunsite.dk with SMTP; 28 Jun 2005 11:38:04 -0000 Received: from 203-173-53-249.dyn.iinet.net.au (localhost.localdomain) [203.173.53.249] by grunt23.ihug.com.au with esmtp (Exim 3.35 #1 (Debian)) id 1DnEPF-0006cx-00; Tue, 28 Jun 2005 21:37:45 +1000 Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by localhost.localdomain (8.12.8/8.12.8) with ESMTP id j5SBUt9b007720 for ; Tue, 28 Jun 2005 21:31:07 +1000 Received: (from doug@localhost) by localhost.localdomain (8.12.8/8.12.8/Submit) id j5SBUevo007709 for zsh-workers@sunsite.dk; Tue, 28 Jun 2005 21:30:40 +1000 X-Authentication-Warning: localhost.localdomain: doug set sender to dougkearns@gmail.com using -f Date: Tue, 28 Jun 2005 21:30:40 +1000 From: Doug Kearns To: zsh-workers@sunsite.dk Subject: PATCH: _w3m update for 0.5.x Message-ID: <20050628113040.GA4407@localhost.localdomain> Mail-Followup-To: zsh-workers@sunsite.dk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4i X-Spam-Checker-Version: SpamAssassin 3.0.2 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, score=-2.6 required=6.0 tests=AWL,BAYES_00 autolearn=ham version=3.0.2 X-Spam-Hits: -2.6 Here's an update of w3m completion for 0.5.x with some general improvements. Regards, Doug Index: Completion/Unix/Command/_w3m =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_w3m,v retrieving revision 1.11 diff -u -r1.11 _w3m --- Completion/Unix/Command/_w3m 26 Feb 2004 12:57:21 -0000 1.11 +++ Completion/Unix/Command/_w3m 28 Jun 2005 11:24:51 -0000 @@ -1,51 +1,106 @@ #compdef w3m +# w3m version w3m/0.5.1 + local curcontext="$curcontext" state line expl ret=1 typeset -A opt_args _arguments -C \ - '-t[tabwidth]:tabwidth:' \ + '-t[set tab width]:tab width:' \ '-r[ignore backspace effect]' \ - '-l[preserved lines]:number of lines:' \ - '-B[load bookmark]' \ - '-bookmark:bookmark file:_files' \ - '-T[content-type]:content type' \ + '-l[specify number of preserved lines]:number of lines (default 10000):' \ + '-I[document charset]:charset:->charset' \ + '-O[display/output charset]:charset:->charset' \ + '( -s -j)-e[EUC-JP]' \ + '(-e -j)-s[Shift_JIS]' \ + '(-e -s )-j[JIS]' \ + '(-v *)-B[load bookmark]' \ + '-bookmark[specify bookmark file]:bookmark file:_files' \ + '-T[specify content-type]:content type:_mime_types' \ '-m[internet message mode]' \ - '-v[visual startup mode]' \ + '(-B *)-v[visual startup mode]' \ '-M[monochrome display]' \ + '-N[open URL of command line on each new tab]' \ '-F[automatically render frame]' \ - '(-dump_source -dump_head)-dump' \ - '-cols:column width' \ - '(-dump -dump_head)-dump_source' \ - '(-dump -dump_source)-dump_head' \ + '-cols[specify column width (used with -dump)]:column width' \ + '-ppc[specify the number of pixels per character (4.0...32.0)]:number of pixels (4.0...32.0):' \ + '-ppl[specify the number of pixels per line (4.0...64.0)]:number of pixels (4.0...64.0):' \ + '( -dump_head -dump_source -dump_both -dump_extra)-dump[dump formatted page into stdout]' \ + '(-dump -dump_source -dump_both -dump_extra)-dump_head[dump HEAD and source into stdout]' \ + '(-dump -dump_head -dump_both -dump_extra)-dump_source[dump page source into stdout]' \ + '(-dump -dump_head -dump_source -dump_extra)-dump_both[dump HEAD and source into stdout]' \ + '(-dump -dump_head -dump_source -dump_both )-dump_extra[dump HEAD, source, and extra information into stdout]' \ + '-post[use POST method with file content]:POST data file:_files' \ + '-header[insert string as a header]:header:' \ + '+-[goto specified line]:line number:_guard "[0-9]#" "line number"' \ '-num[show line number]' \ - '-no-proxy' \ - '-no-mouse' \ - '(-no-cookie)-cookie' \ - '(-cookie)-no-cookie' \ - '-no-graph' \ + "-no-proxy[don't use proxy]" \ + '(-6)-4[IPv4 only (-o dns_order=4)]' \ + '(-4)-6[IPv6 only (-o dns_order=6)]' \ + "-no-mouse[don't use mouse]" \ + '(-no-cookie)-cookie[use cookie]' \ + "(-cookie)-no-cookie[don't use cookie]" \ + '-pauth[proxy authentication]:user\:pass:->pauth' \ + '(-no-graph)-graph[use graphic character]' \ + "(-graph)-no-graph[don't use graphic character]" \ '-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' \ + "-X[don't use termcap init/deinit]" \ + '-title=[set buffer name to terminal title string]:terminal:_terminals' \ + '*-o[assign value to config option]:option=value:->option' \ + '(- *)-show-option[print all config options]' \ + '-config[specify config file]:configuration file:_files' \ + '(- *)-help[print usage information]' \ + '(- *)-version[print version information]' \ '-debug' \ - ':URL:->html' \ - '+:goto line' && ret=0 - -if [[ -n $state ]]; then - local w3mhistory + '(-B -v)*:URL:->html' && ret=0 - _tags files w3mhistory urls - while _tags; do - _requested files expl 'file' _files -g "*.x#html(-.)" && ret=0 - _requested urls expl 'URL' _urls && ret=0 - if [[ -s ~/.w3m/history ]] && _requested w3mhistory; then +case "$state" in + charset) + local -a charsets + charsets=( + US-ASCII ISO-8859-1 ISO-8859-2 ISO-8859-3 ISO-8859-4 ISO-8859-5 + ISO-8859-6 ISO-8859-7 ISO-8859-8 ISO-8859-9 ISO-8859-10 ISO-8859-11 + ISO-8859-13 ISO-8859-14 ISO-8859-15 ISO-8859-16 EUC-JP Shift_JIS + Shift_JISX0213 ISO-2022-JP ISO-2022-JP-2 ISO-2022-JP-3 EUC-CN GBK GB18030 + HZ-GB-2312 ISO-2022-CN EUC-TW Big5 HKSCS EUC-KR UHC Johab ISO-2022-KR + TIS-620 TCVN-5712 VISCII VPS KOI8-R KOI8-U NeXTSTEP CP437 CP737 CP775 + CP850 CP852 CP855 CP856 CP857 CP860 CP861 CP862 CP863 CP864 CP865 CP866 + CP869 CP874 CP1006 CP1250 CP1251 CP1252 CP1253 CP1254 CP1255 CP1256 + CP1257 CP1258 UTF-8 UTF-7 + ) + _wanted charsets expl 'character set' compadd -a charsets && ret=0 + ;; + html) + local -a bookmarks w3mhistory + if [[ -s ~/.w3m/bookmark.html ]]; then + bookmarks=( ${${(M)${(f)"$(<~/.w3m/bookmark.html)"}:#
  • *}/(#b)
  • */$match[1]} ) + fi + if [[ -s ~/.w3m/history ]]; then w3mhistory=( ${(f)"$(<~/.w3m/history)"} ) - _all_labels w3mhistory expl 'URL from history' compadd -a w3mhistory fi - (( ret )) || break - done -fi + _alternative \ + 'files:file:_files -g "*.x#html(-.)"' \ + 'urls:URL:_urls' \ + 'bookmarks:bookmarks:compadd -a bookmarks' \ + 'history:history:compadd -a w3mhistory' && ret=0 + ;; + option) + local -a options + options=( ${${(M)${(f)"$(_call_program options $words[1] -show-option 2>/dev/null)"}:# -o *}/(#b) -o (*)=[^ ]#[[:blank:]]##(*)/$match[1]:${match[2]:l}} ) + if compset -P '*='; then + _message -e values 'value' + else + _describe -t options 'option' options -S '=' && ret=0 + fi + ;; + pauth) + if compset -P '*:'; then + _message -e passwords 'password' + else + _users -S ':' && ret=0 + fi + ;; +esac return ret