From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from euclid.skiles.gatech.edu (list@euclid.skiles.gatech.edu [130.207.146.50]) by melb.werple.net.au (8.7.5/8.7.3/2) with ESMTP id AAA18115 for ; Sat, 20 Jul 1996 00:31:54 +1000 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id KAA19761; Fri, 19 Jul 1996 10:27:06 -0400 (EDT) Resent-Date: Fri, 19 Jul 1996 10:27:06 -0400 (EDT) From: Zefram Message-Id: <11149.199607191426@stone.dcs.warwick.ac.uk> Subject: Re: more dependencies on emulation To: zsh-workers@math.gatech.edu (Z Shell workers mailing list) Date: Fri, 19 Jul 1996 15:26:10 +0100 (BST) In-Reply-To: <960718194451.ZM784@candle.brasslantern.com> from "Bart Schaefer" at Jul 18, 96 07:44:51 pm X-Loop: zefram@dcs.warwick.ac.uk X-Stardate: [-31]7833.00 X-US-Congress: Moronic fuckers MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Resent-Message-ID: <"5fX5w.0.dq4.vivxn"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/1714 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu >Actually, the only options that make this difficult are those that (1) >affect non-interactive behavior and (2) are not tied to an emulation. >As long as the "emulate" command sets/unsets all the appropriately- >tagged options, you can always do: > > zshfoo() { > setopt localoptions > emulate zsh > # Now do stuff using default zsh settings > } > >Note, though, that for this to work "emulate" should never turn OFF >localoptions -- I note that it turns it ON for ksh, so right now it >probably also turns it off sometimes. This one's easy. Execute emulate BEFORE setting localoptions. The setting of localoptions at the *end* of the function is what determines which options are restored. I hadn't considered that use of emulation before. Do you think maybe the emulation mode should be restored by localoptions in the way options are? Even after my patches, the emulation does have some direct effect -- the single-letter option names. I don't think that should be changed. -zefram