zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: pws-N: emulate -L makes traps local
@ 1999-06-23  7:57 Peter Stephenson
  0 siblings, 0 replies; only message in thread
From: Peter Stephenson @ 1999-06-23  7:57 UTC (permalink / raw)
  To: Zsh hackers list

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 <pws@ibmth.df.unipi.it>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1999-06-23  8:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-06-23  7:57 PATCH: pws-N: emulate -L makes traps local Peter Stephenson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).