From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16160 invoked from network); 5 Jun 1998 08:58:50 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 5 Jun 1998 08:58:50 -0000 Received: (from list@localhost) by math.gatech.edu (8.8.5/8.8.5) id EAA17613; Fri, 5 Jun 1998 04:53:32 -0400 (EDT) Resent-Date: Fri, 5 Jun 1998 04:53:32 -0400 (EDT) From: "Bart Schaefer" Message-Id: <980605015415.ZM17368@candle.brasslantern.com> Date: Fri, 5 Jun 1998 01:54:15 -0700 In-Reply-To: <005901bd9057$b7a4fe80$21c9ca95@ao13.mow.sni.de> Comments: In reply to "Andrej Borsenkow" "emulate -R resets localoptions" (Jun 5, 11:58am) References: <005901bd9057$b7a4fe80$21c9ca95@ao13.mow.sni.de> X-Mailer: Z-Mail (5.0.0 30July97) To: "Andrej Borsenkow" , "ZSH workers mailing list" Subject: Re: emulate -R resets localoptions MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Resent-Message-ID: <"U07Ju1.0.5J4.B8xTr"@math> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/4052 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu On Jun 5, 11:58am, Andrej Borsenkow wrote: } Subject: emulate -R resets localoptions } } emulate -R seems to reset *all* options, in particular localoptions. I find } it confusing; it breaks my simple notion Yes, you're right; the whole point of -R is in fact to reset *all* the options, just like the doc says. The effect of this on localoptions is semi-documented, but probably ought to be stated explicitly in the doc somewhere. If you look at the sample functions that come with the distribution, you'll find that any of them that use emulate use it like this: emulate -R zsh setopt localoptions The reason I say it's semi-documented is: LOCAL_OPTIONS If this option is set at the point of return from a shell function, all the options (including this one) which were in force upon entry to the function are restored. Note "at the point of return." That means you have to be sure to set localoptions only after you're sure nothing else is going to change it. -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com