zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: globalexport option
@ 2000-04-16 18:28 Peter Stephenson
  2000-04-17 20:32 ` Etc/MACHINES [was Re: PATCH: globalexport option] Clint Adams
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Stephenson @ 2000-04-16 18:28 UTC (permalink / raw)
  To: Zsh hackers list

This implements the option that differentiates between the old kludge for
turning on -g with typeset -x and the more natural code which doesn't.

There's also a patch for Etc/MACHINES to note that OpenBSD works.

Index: Doc/Zsh/builtins.yo
===================================================================
RCS file: /cvsroot/zsh/zsh/Doc/Zsh/builtins.yo,v
retrieving revision 1.3
diff -u -r1.3 builtins.yo
--- Doc/Zsh/builtins.yo	2000/04/13 14:22:47	1.3
+++ Doc/Zsh/builtins.yo	2000/04/16 18:26:52
@@ -1160,9 +1160,10 @@
 )
 item(tt(-x))(
 Mark for automatic export to the environment of subsequently
-executed commands.  Currently this implies the option tt(-g), unless tt(+g)
-is also explicitly given, in other words the parameter is not made local to
-the enclosing function.  This is for compatibility with other shells.
+executed commands.  If the option tt(GLOBAL_EXPORT) is set, this implies
+the option tt(-g), unless tt(+g) is also explicitly given; in other words
+the parameter is not made local to the enclosing function.  This is for
+compatibility with previous versions of zsh.
 )
 enditem()
 )
Index: Doc/Zsh/options.yo
===================================================================
RCS file: /cvsroot/zsh/zsh/Doc/Zsh/options.yo,v
retrieving revision 1.1.1.30
diff -u -r1.1.1.30 options.yo
--- Doc/Zsh/options.yo	2000/02/09 18:58:23	1.1.1.30
+++ Doc/Zsh/options.yo	2000/04/16 18:26:55
@@ -381,6 +381,24 @@
 Perform filename generation (globbing).
 (See noderef(Filename Generation).)
 )
+pindex(GLOBAL_EXPORT)
+cindex(environment, and local parameters)
+item(tt(GLOBAL_EXPORT) (tt<Z>))(
+If this option is set, passing the tt(-x) flag to the builtins tt(declare),
+tt(float), tt(integer), tt(readonly) and tt(typeset) (but not tt(local))
+will also set the tt(-g) flag;  hence parameters exported to
+the environment will not be made local to the enclosing function, unless
+they were already or the flag tt(+g) is given explicitly.  If the option is
+unset, exported parameters will be made local in just the same way as any
+other parameter.
+
+This option is set by default for backward compatibility; it is not
+recommended that its behaviour be relied upon.  Note that the builtin
+tt(export) always sets both the tt(-x) and tt(-g) flags, and hence its
+effect extends beyond the scope of the enclosing function; this is the
+most portable way to achieve this behaviour.
+)
+cindex(exporting, and local parameters)
 pindex(GLOBAL_RCS)
 cindex(startup files, global, inhibiting)
 cindex(files, global startup, inhibiting)
Index: Etc/MACHINES
===================================================================
RCS file: /cvsroot/zsh/zsh/Etc/MACHINES,v
retrieving revision 1.1.1.11
diff -u -r1.1.1.11 MACHINES
--- Etc/MACHINES	2000/03/25 00:21:56	1.1.1.11
+++ Etc/MACHINES	2000/04/16 18:26:55
@@ -98,6 +98,9 @@
 	Should build `out-of-the-box', but the zsh malloc routines are
 	not recommended.
 
+OpenBSD: OpenBSD 2.6
+	Should build `out-of-the-box'.
+
 SIEMENS: Reliant UNIX
        Builds `out-of-the-box'. Dynamic loading is supported. 
        Large Files and 64-bit integers are supported as of version 5.44
Index: Src/builtin.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/builtin.c,v
retrieving revision 1.7
diff -u -r1.7 builtin.c
--- Src/builtin.c	2000/04/13 14:22:47	1.7
+++ Src/builtin.c	2000/04/16 18:27:10
@@ -1850,7 +1850,8 @@
 	return 0;
     }
 
-    if ((!ops['g'] && !ops['x']) || ops['g'] == 2 || *name == 'l')
+    if ((!ops['g'] && !ops['x']) || ops['g'] == 2 || *name == 'l' ||
+	!isset(GLOBALEXPORT))
 	on |= PM_LOCAL;
 
     if (on & PM_TIED) {
Index: Src/options.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/options.c,v
retrieving revision 1.1.1.21
diff -u -r1.1.1.21 options.c
--- Src/options.c	2000/02/09 01:15:29	1.1.1.21
+++ Src/options.c	2000/04/16 18:27:14
@@ -112,6 +112,7 @@
 {NULL, "flowcontrol",	      OPT_ALL,			 FLOWCONTROL},
 {NULL, "functionargzero",     OPT_EMULATE|OPT_NONBOURNE, FUNCTIONARGZERO},
 {NULL, "glob",		      OPT_EMULATE|OPT_ALL,	 GLOBOPT},
+{NULL, "globalexport",        OPT_EMULATE|OPT_ZSH,	 GLOBALEXPORT},
 {NULL, "globalrcs",           OPT_ALL,			 GLOBALRCS},
 {NULL, "globassign",	      OPT_EMULATE|OPT_CSH,	 GLOBASSIGN},
 {NULL, "globcomplete",	      0,			 GLOBCOMPLETE},
Index: Src/zsh.h
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/zsh.h,v
retrieving revision 1.6
diff -u -r1.6 zsh.h
--- Src/zsh.h	2000/04/14 11:49:32	1.6
+++ Src/zsh.h	2000/04/16 18:27:20
@@ -1344,6 +1344,7 @@
     EXTENDEDHISTORY,
     FLOWCONTROL,
     FUNCTIONARGZERO,
+    GLOBALEXPORT,
     GLOBALRCS,
     GLOBOPT,
     GLOBASSIGN,

-- 
Peter Stephenson <pws@pwstephenson.fsnet.co.uk>
Work: pws@CambridgeSiliconRadio.com
Web: http://www.pwstephenson.fsnet.co.uk


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Etc/MACHINES [was Re: PATCH: globalexport option]
  2000-04-16 18:28 PATCH: globalexport option Peter Stephenson
@ 2000-04-17 20:32 ` Clint Adams
  2000-04-18 15:25   ` Clint Adams
  0 siblings, 1 reply; 3+ messages in thread
From: Clint Adams @ 2000-04-17 20:32 UTC (permalink / raw)
  To: Peter Stephenson; +Cc: Zsh hackers list

> There's also a patch for Etc/MACHINES to note that OpenBSD works.

Linux: Linux (i[345]86,various Pentia,AMD K6/2)

We have working .debs for i386, alpha, m68k, sparc, and arm right now.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Etc/MACHINES [was Re: PATCH: globalexport option]
  2000-04-17 20:32 ` Etc/MACHINES [was Re: PATCH: globalexport option] Clint Adams
@ 2000-04-18 15:25   ` Clint Adams
  0 siblings, 0 replies; 3+ messages in thread
From: Clint Adams @ 2000-04-18 15:25 UTC (permalink / raw)
  To: Peter Stephenson; +Cc: Zsh hackers list

> We have working .debs for i386, alpha, m68k, sparc, and arm right now.

Furthermore, I have received word that zsh compiles cleanly on the
Hurd for i386, although there was some complaint about artificially
limiting PATH_MAX.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2000-04-18 15:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-04-16 18:28 PATCH: globalexport option Peter Stephenson
2000-04-17 20:32 ` Etc/MACHINES [was Re: PATCH: globalexport option] Clint Adams
2000-04-18 15:25   ` Clint Adams

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).