* PATCH: pws-whatever: emulate -L sets localtraps
@ 1999-06-22 15:47 Peter Stephenson
0 siblings, 0 replies; only message in thread
From: Peter Stephenson @ 1999-06-22 15:47 UTC (permalink / raw)
To: Zsh hackers list
Seems natural to me that emulate -L should extend the localisation
behaviour to traps as well as options. This also gives an automatic upgrade
if you move from 3.0.6 to 3.1.6 or 4 or whatever.
Also, dosetopt() is overkill for setting the options; it's really intended
for a generic option number where you need to test for side effects.
--- 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-22 15:47 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-06-22 15:47 PATCH: pws-whatever: emulate -L sets localtraps 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).