From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12905 invoked from network); 21 Oct 2003 18:30:15 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 21 Oct 2003 18:30:15 -0000 Received: (qmail 3774 invoked by alias); 21 Oct 2003 18:29:49 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 6723 Received: (qmail 3762 invoked from network); 21 Oct 2003 18:29:47 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 21 Oct 2003 18:29:47 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [216.27.138.216] by sunsite.dk (MessageWall 1.0.8) with SMTP; 21 Oct 2003 18:29:47 -0000 Received: from home.acholado.net (localhost.localdomain [127.0.0.1]) by home.acholado.net (8.12.8/8.12.8) with ESMTP id h9LITkWp027637 for ; Tue, 21 Oct 2003 14:29:46 -0400 Received: (from ljz@localhost) by home.acholado.net (8.12.8/8.12.8/Submit) id h9LITklI027635; Tue, 21 Oct 2003 14:29:46 -0400 X-Authentication-Warning: home.acholado.net: ljz set sender to ljz@asfast.com using -f To: zsh-users@sunsite.dk Subject: Re: Incomplete completion for w3m under 4.1.1 References: <19026.1066297547@csr.com> From: Lloyd Zusman Reply-To: ljz@asfast.com Date: Tue, 21 Oct 2003 14:29:46 -0400 In-Reply-To: <19026.1066297547@csr.com> (Peter Stephenson's message of "Thu, 16 Oct 2003 10:45:47 +0100") Message-ID: User-Agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Sender: Lloyd Zusman --=-=-= Peter Stephenson writes: > Lloyd Zusman wrote: >> How can the _w3m completion spec be changed so that both kinds of values >> can validly be completed for the final argument? > > Have a look at the _lynx completer, which deals with this problem using > _alternative; that's probably the best way since it allows the normal > tags stuff to work. That would probably be easiest if the _w3mhistory > stuff went into a function itself I very much appreciate this information. Attached are my altered _w3m and a new helper function _w3mhist. I'm pretty new at this, so could someone evaluate what I came up with? Also, I could only get this to work if I put "autoload -U _w3mhist" in my /etc/zshrc, even though the file _w3mhist is in my $fpath. What am I missing? Thanks. --=-=-= Content-Disposition: attachment; filename=_w3m Content-Description: New _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:->html' && return 0 case $state in html) _alternative 'files:file:_files -g "*.x#html"' 'urls:url:_w3mhist' ;; esac --=-=-= Content-Disposition: attachment; filename=_w3mhist Content-Description: _w3mhist #compdef -default- local _w3mhistory if [[ -s ~/.w3m/history ]]; then _w3mhistory=(${(f)"$(<$HOME/.w3m/history)"}) compadd $_w3mhistory fi _urls -f --=-=-= -- Lloyd Zusman ljz@asfast.com --=-=-=--