From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15905 invoked from network); 7 May 2007 07:50:28 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.0 (2007-05-01) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=no version=3.2.0 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 7 May 2007 07:50:28 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 78595 invoked from network); 7 May 2007 07:50:22 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 7 May 2007 07:50:22 -0000 Received: (qmail 17077 invoked by alias); 7 May 2007 07:50:20 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 23400 Received: (qmail 17067 invoked from network); 7 May 2007 07:50:20 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 7 May 2007 07:50:20 -0000 Received: (qmail 78316 invoked from network); 7 May 2007 07:50:20 -0000 Received: from nz-out-0506.google.com (64.233.162.226) by a.mx.sunsite.dk with SMTP; 7 May 2007 07:50:17 -0000 Received: by nz-out-0506.google.com with SMTP id o1so1467502nzf for ; Mon, 07 May 2007 00:50:16 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=Qu25jJsGVaxdaB80eruTW5wwqBs3hrkaPBq7SoC9r+xD8XM0ZdSP9hOT5mdKX1HngO+gxvtugaXJrZ8PEEoJUI+bTRISMdh8XuSiliU0IBYHxHV8XnJPwMeHPPl2Xz5cQNaNT7bRNLc6uW4Eo5kCKzTr+exLveI4Jr+Y508E02M= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=ArhF8sa4jNgLs0lCZNSAMEeE2XeXg8UACpnUF6x8AMAJOQIJRPd0x654DmJ17gfqEfuCT/StwtOjR3JbLH3kGyvhHAy5wpurGRkTJd3qj/6+9mgNYPpAE+zGSV28r4gXDRnYaifV90gMvhvrWmrV6OxbumL9+IEdwwdxcFJ1ilw= Received: by 10.114.161.11 with SMTP id j11mr2051835wae.1178524215718; Mon, 07 May 2007 00:50:15 -0700 (PDT) Received: by 10.114.196.8 with HTTP; Mon, 7 May 2007 00:50:15 -0700 (PDT) Message-ID: Date: Mon, 7 May 2007 09:50:15 +0200 From: "Nikolai Weibull" Sender: nikolai.weibull@gmail.com To: "Bart Schaefer" Subject: Re: compadd -qS' ' should escape the space Cc: "Zsh hackers list" In-Reply-To: <070506224450.ZM9202@torch.brasslantern.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <070506224450.ZM9202@torch.brasslantern.com> X-Google-Sender-Auth: fdf388e3204f43a8 On 5/7/07, Bart Schaefer wrote: > I'm sort of surprised no one responded to this. (Or did they and gmail > has spam-filtered it for me again?) Nah, it's probably the fact that my question/suggestion wasn't very well-formulated. > On May 3, 6:11pm, Nikolai Weibull wrote: > } Subject: compadd -qS' ' should escape the space > } > } _describe -t color 'color' colors -qS' ' > } > } I'd expect the space used as a suffix to be escaped. > > Er, no. The suffix is supposed to be a separator between words; e.g., > in file completion, you want the space between the file names to be > treated as IFS by the shell, so that you get one file name per word > as the command arguments. > > You didn't provide enough context to know what you're really trying > to do and why you think the space should be escaped, so I have no > suggestions for what you should be doing instead. I'm trying to complete a set of three colors and attributes: compset -P '* ' case ($words[CURRENT]) in (?*' '?*' '*) if [[ $words[CURRENT] == *(bold|dim|ul|blink|reverse)* ]]; then __git_colors else __git_color_attributes fi ;; (*) if [[ $words[CURRENT] == *(bold|dim|ul|blink|reverse)* ]]; then __git_colors -qS' ' else _alternative \ 'colors:color:__git_colors -qS" "' \ 'attributes:attribute:__git_color_attributes -qS" "' fi ;; The idea is that when completing in the following context: % git config color.branch.local | (where '|' is the cursor) you'll be able to enter three space-separated values: % git config color.branch.local red\ | and now we'll still be able to complete the two other components. If I manually prefix the word before completing with a double quote it all works, but I was hoping that this could also work automatically. Feel free to ask for more context ;-). nikolai