From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9382 invoked from network); 23 Jun 1999 08:26:05 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 23 Jun 1999 08:26:05 -0000 Received: (qmail 26307 invoked by alias); 23 Jun 1999 08:25:51 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 6801 Received: (qmail 26299 invoked from network); 23 Jun 1999 08:25:46 -0000 Message-Id: <9906230757.AA21041@ibmth.df.unipi.it> To: zsh-workers@sunsite.auc.dk (Zsh hackers list) Subject: PATCH: pws-N: emulate -L makes traps local Date: Wed, 23 Jun 1999 09:57:04 +0200 From: Peter Stephenson The other message still sitting around in limbo sent this patch which makes emulate -L turn on local traps, too, as well as setting the options directly, since dosetopt() is overkill if you know what the option is. --- Doc/Zsh/builtins.yo.lt3 Mon Jun 21 09:28:19 1999 +++ Doc/Zsh/builtins.yo Tue Jun 22 17:38:17 1999 @@ -224,10 +224,11 @@ mode, except for certain options describing the interactive environment; otherwise, only those options likely to cause portability problems in scripts and functions are altered. If the tt(-L) option -is given, the option tt(LOCAL_OPTIONS) will be set as well, causing -the effect of the tt(emulate) command to be local to the immediately -surrounding shell function, if any; normally this is turned off in all -emulation modes except tt(ksh). +is given, the options tt(LOCAL_OPTIONS) and tt(LOCAL_TRAPS) will be set as +well, causing the effects of the tt(emulate) command and any tt(setopt) and +tt(trap) commands to be local to the immediately surrounding shell +function, if any; normally these options are turned off in all emulation +modes except tt(ksh). ) findex(enable) cindex(enabling commands) --- Src/builtin.c.lt3 Sun Jun 20 14:36:17 1999 +++ Src/builtin.c Tue Jun 22 17:36:18 1999 @@ -3074,7 +3074,7 @@ { emulate(*argv, ops['R']); if (ops['L']) - dosetopt(LOCALOPTIONS, 1, 0); + opts[LOCALOPTIONS] = opts[LOCALTRAPS] = 1; return 0; } -- Peter Stephenson Tel: +39 050 844536 WWW: http://www.ifh.de/~pws/ Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy