From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5529 invoked from network); 3 Oct 2002 16:10:43 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 3 Oct 2002 16:10:43 -0000 Received: (qmail 22251 invoked by alias); 3 Oct 2002 16:10:22 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 5417 Received: (qmail 22232 invoked from network); 3 Oct 2002 16:10:20 -0000 From: "Bart Schaefer" Message-Id: <1021003160943.ZM20996@candle.brasslantern.com> Date: Thu, 3 Oct 2002 16:09:43 +0000 In-Reply-To: <15772.25139.506561.955462@paullew-ultra.cisco.com> Comments: In reply to Paul Lew "Bart's urlglobber question" (Oct 3, 8:28am) References: <15772.25139.506561.955462@paullew-ultra.cisco.com> X-Mailer: Z-Mail (5.0.0 30July97) To: Paul Lew , zsh-users@sunsite.dk Subject: Re: Bart's urlglobber question MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Oct 3, 8:28am, Paul Lew wrote: } } Seems noglob does not handle the '&' Of course not. It's not a glob character, it's a statement separator. } then how can I ever achieve the original goal of not supplying quotes } when using w3m? Did you see my url-magic-space posting? http://www.zsh.org/cgi-bin/mla/redirect?USERNUMBER=5319 Here's a slight variation on it: ---- 8< ---- snip ---- 8< ---- function url-quote-magic { local words back=0 words=("${(@Q)${(q)=LBUFFER}}") [[ "$KEYS" != [[:space:]] ]] && back=1 case "$words[-1]" in (*[\'\"]*) back=0;; (ftp://(|localhost)/(~|*([][?#*]|\(|\)))*) local left="${(qqM)${words[-1]}##ftp://(localhost|)}" local right="${${words[-1]}##ftp://(localhost|)}" right="${right/#\/~/~}" words[-1]="$left"'"${(f)^$(print -lr -- '"$right"')}"' ((back)) && back=3;; (http(|s)|ftp):*) words[-1]="${(qq)words[-1]}" ;; esac LBUFFER="${(j: :)words}" ((CURSOR-=back)) zle .self-insert } zle -N url-quote-magic for key in ' ' '?' '&'; do bindkey "$key" url-quote-magic; done ---- 8< ---- snip ---- 8< ---- The above could use some improvement in for multi-line buffers; check the value of BUFFERLINES and save and elide everything not on the current line before manipulating $words, then restore it to the beginning of LBUFFER at the end. I don't have time to fiddle with that just now. -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net