From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22235 invoked from network); 17 Jan 2006 13:57:40 -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 13:57:40 -0000 Received: (qmail 96922 invoked from network); 17 Jan 2006 13:57:33 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 17 Jan 2006 13:57:33 -0000 Received: (qmail 7198 invoked by alias); 17 Jan 2006 13:57:25 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9834 Received: (qmail 7189 invoked from network); 17 Jan 2006 13:57:24 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 17 Jan 2006 13:57:24 -0000 Received: (qmail 95871 invoked from network); 17 Jan 2006 13:57:24 -0000 Received: from cluster-d.mailcontrol.com (HELO rly01d.srv.mailcontrol.com) (217.69.20.190) by a.mx.sunsite.dk with SMTP; 17 Jan 2006 13:57:22 -0000 Received: from exchange03.csr.com (uuk202166.uk.customer.alter.net [62.189.241.194] (may be forged)) by rly01d.srv.mailcontrol.com (MailControl) with ESMTP id k0HDvF3I003382 for ; Tue, 17 Jan 2006 13:57:21 GMT Received: from csr.com ([10.103.143.38]) by exchange03.csr.com with Microsoft SMTPSVC(5.0.2195.6713); Tue, 17 Jan 2006 13:57:19 +0000 To: zsh-users@sunsite.dk Subject: Re: zstyle & variables In-reply-to: <864C70C0-1C89-4FD2-8730-10242DCAA417@jota.gsc.riken.go.jp> References: <864C70C0-1C89-4FD2-8730-10242DCAA417@jota.gsc.riken.go.jp> Comments: In-reply-to Wataru Kagawa message dated "Tue, 17 Jan 2006 22:14:17 +0900." Date: Tue, 17 Jan 2006 13:57:05 +0000 From: Peter Stephenson Message-ID: X-OriginalArrivalTime: 17 Jan 2006 13:57:19.0225 (UTC) FILETIME=[EE6E9E90:01C61B6D] Content-Type: text/plain MIME-Version: 1.0 X-Scanned-By: MailControl A-05-40-01 (www.mailcontrol.com) on 10.68.0.111 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