From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1564 invoked from network); 17 Jan 2006 14:08:14 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.0 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 17 Jan 2006 14:08:14 -0000 Received: (qmail 6539 invoked from network); 17 Jan 2006 14:08:07 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 17 Jan 2006 14:08:07 -0000 Received: (qmail 9621 invoked by alias); 17 Jan 2006 14:07:56 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9835 Received: (qmail 9609 invoked from network); 17 Jan 2006 14:07:55 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 17 Jan 2006 14:07:55 -0000 Received: (qmail 5316 invoked from network); 17 Jan 2006 14:07:55 -0000 Received: from ykdmp01.yokohama.riken.go.jp (HELO ykdmp01.yokohama.riken.jp) (134.160.82.30) by a.mx.sunsite.dk with SMTP; 17 Jan 2006 14:07:53 -0000 Received: (qmail 81811 invoked by uid 98); 17 Jan 2006 14:07:51 -0000 Received: from 134.160.84.23 by ykdmp01.yokohama.riken.jp (envelope-from , uid 82) with qmail-scanner-1.25 (sophie: 3.04/2.31/3.98. spamassassin: 3.1.0. Clear:RC:1(134.160.84.23):. Processed in 0.075442 secs); 17 Jan 2006 14:07:51 -0000 Received: from unknown (HELO jota.gsc.riken.go.jp) (134.160.84.23) by ykdmp01.yokohama.riken.go.jp with SMTP; 17 Jan 2006 14:07:51 -0000 Received: from [10.64.65.5] (ipm04.gsc.riken.go.jp [134.160.83.74]) by jota.gsc.riken.go.jp (Postfix) with ESMTP id 8B05734854DF; Tue, 17 Jan 2006 23:07:50 +0900 (JST) In-Reply-To: References: <864C70C0-1C89-4FD2-8730-10242DCAA417@jota.gsc.riken.go.jp> Mime-Version: 1.0 (Apple Message framework v746.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Cc: zsh-users@sunsite.dk Content-Transfer-Encoding: 7bit From: Wataru Kagawa Subject: Re: zstyle & variables Date: Tue, 17 Jan 2006 23:07:50 +0900 To: Peter Stephenson X-Mailer: Apple Mail (2.746.2) Hi Peter, Thanks so much. Wataru Kagawa On 2006/01/17, at 22:57, Peter Stephenson wrote: > Wataru Kagawa wrote: >> Hi all. >> I have the following completion set in my zsh environment setup file. >> >> zstyle ':completion:*' users $USERS >> >> I also have a custom function to alter the contents of $USERS . >> After running this function to change the contents of $USERS, I need >> to execute the line above in the command line to make the change take >> effect. I would like my custom function to do this for me, but I am >> having trouble figuring it out. I tried adding, 'zstyle >> ':completion:*' users $USERS' to the bottom of my custom function, >> but that did not work for me. > > The easiest way to do this (I'm assuming USERS is an array) is to > define > the style initially as: > > zstyle -e ':completion:*' users 'reply=($USERS)' > > This means that $USERS is examined every time the style is > checked. So > when you modify the array it takes effect immediately. > > -- > Peter Stephenson Software Engineer > CSR PLC, Churchill House, Cambridge Business Park, Cowley Road > Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 > 692070 > > > To access the latest news from CSR copy this link into a web > browser: http://www.csr.com/email_sig.html