From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5812 invoked from network); 7 May 1999 17:50:44 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 7 May 1999 17:50:44 -0000 Received: (qmail 16290 invoked by alias); 7 May 1999 17:50:11 -0000 Mailing-List: contact zsh-users-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 2324 Received: (qmail 16096 invoked from network); 7 May 1999 17:45:54 -0000 Date: Fri, 7 May 1999 10:44:46 -0700 From: "Philip J. Hollenback" To: zsh-users@sunsite.auc.dk Subject: compctl question Message-ID: <19990507104446.A13127@sco.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.3i I'm using zsh 3.1.5, and I'm trying to develop a completion for mutt. Here's what I currently have: mutt: if -f, -i, -a, or -H is given, complete files, # and if -f+ (or -f=, or -f +) is given, complete folders in # ~/mail. Also complete options after -. # Note that '-f =' can't be completed because '=' is grabbed by the # shell. It needs to be protected with a '\', but I don't know how to # make the completion do that. # Don't complete users because I never mail anyone on my own system. compctl -x 's[+] c[-1,-f],s[-f+],s[-f=]' -W ~/mail -f \ - 's[-[fiaH]],C[-1,-[fiaH]]' -f \ - 's[-]' -k '(a b c e f F H i m n p R s v x y z Z h)' \ -- mutt I like to open mailboxes in my mail directory thusly: # mutt -f =mailbox That doesn't work, Apparently because the shell does something with words that start with '='. I can't complete on =mailbox either, for the same reason. Now, this does work: # mutt -f=mailbox as does this: # mutt -f \=mailbox However, I am accustomed to typing the command as # mutt -f =mailbox So here are my questions: 1. How do you get around the fact that the shell grabs the '='? Can you turn that off for this one command? 2. Is there a way to write a completion that rewrites the what is already on the command line? For instance, if I typed in this: # mutt -f =mailb could the shell expand it to # mutt -f \=mailbox or # mutt -f=mailbox by changing what had already been typed? I have perused the manual carefully, and have been unable to develop an answer. Thanks, Phil. -- Phil Hollenback Engineering Services The Santa Cruz Operation 831-427-7358