Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

zmodload -a -i



-----BEGIN PGP SIGNED MESSAGE-----

This patch extends the use of zmodload's -i option, so that it has the
obvious (and useful) effect when combined with -a.

 -zefram

 *** Doc/Zsh/builtins.yo	1997/03/18 23:56:35	1.8
 --- Doc/Zsh/builtins.yo	1997/03/20 02:19:03
 ***************
 *** 1279,1290 ****
   xitem(tt(zmodload) [ tt(-iL) ] [ var(name) ... ])
   xitem(tt(zmodload) tt(-u) [ tt(-i) ] var(name) ...)
   xitem(tt(zmodload) tt(-d) [ tt(-L) ] [ var(name) [ var(dep) ... ] ])
 ! xitem(tt(zmodload) tt(-a) [ tt(-L) ] [ var(name) [ var(builtin) ... ] ])
 ! item(tt(zmodload) tt(-au) var(builtin) ...)(
 ! Load (or, with tt(-u), unload) a binary module.
 ! When loading a module, the module must be in a file named either
   `var(name)tt(.dlext())' or `var(name)'.
 - 
   If the module to be loaded is already loaded and the tt(-i)
   option is given, the duplicate module is ignored.  Otherwise
   tt(zmodload) prints an error message.
 --- 1279,1288 ----
   xitem(tt(zmodload) [ tt(-iL) ] [ var(name) ... ])
   xitem(tt(zmodload) tt(-u) [ tt(-i) ] var(name) ...)
   xitem(tt(zmodload) tt(-d) [ tt(-L) ] [ var(name) [ var(dep) ... ] ])
 ! xitem(tt(zmodload) tt(-a) [ tt(-iL) ] [ var(name) [ var(builtin) ... ] ])
 ! item(tt(zmodload) tt(-au) [ tt(-i) ] var(builtin) ...)(
 ! Load a binary module.  The module must be in a file named either
   `var(name)tt(.dlext())' or `var(name)'.
   If the module to be loaded is already loaded and the tt(-i)
   option is given, the duplicate module is ignored.  Otherwise
   tt(zmodload) prints an error message.
 ***************
 *** 1295,1301 ****
   This behaviour can be modified by the tt(PATH_DIRS) option.
   cindex(PATH_DIRS, use of)
   
 ! When unloading a module, the same var(name)
   must be given that was given when the module was loaded, but it is not
   necessary for the module to exist in the filesystem.
   The tt(-i) option suppresses the error if the module is already
 --- 1293,1299 ----
   This behaviour can be modified by the tt(PATH_DIRS) option.
   cindex(PATH_DIRS, use of)
   
 ! With tt(-u), tt(zmodload) unloads modules.  The same var(name)
   must be given that was given when the module was loaded, but it is not
   necessary for the module to exist in the filesystem.
   The tt(-i) option suppresses the error if the module is already
 ***************
 *** 1321,1333 ****
   specified var(builtin)s.  When any of those builtins is called, the module
   specified in the first argument is loaded.  If only one argument is given,
   one builtin is defined, with the same name as the module.
 ! With no arguments, all
   autoloaded builtins are listed, with the module name (if different)
   shown in parentheses after the builtin name.  The tt(-L) option changes
 ! this format to a list of tt(zmodload -a) commands.  If tt(-a) is used
   together with the tt(-u) option it removes builtins defined with
   tt(zmodload -a).  This is only possible if the builtin is not yet
 ! loaded.
   )
   )\
   enditem()
 --- 1319,1337 ----
   specified var(builtin)s.  When any of those builtins is called, the module
   specified in the first argument is loaded.  If only one argument is given,
   one builtin is defined, with the same name as the module.
 ! tt(-i) suppresses the error if the builtin is already defined or
 ! autoloaded, regardless of which module it came from.
 ! 
 ! With tt(-a) and no arguments, all
   autoloaded builtins are listed, with the module name (if different)
   shown in parentheses after the builtin name.  The tt(-L) option changes
 ! this format to a list of tt(zmodload -a) commands.
 ! 
 ! If tt(-a) is used
   together with the tt(-u) option it removes builtins defined with
   tt(zmodload -a).  This is only possible if the builtin is not yet
 ! loaded.  tt(-i) suppresses the error if the builtin is already
 ! removed (or never existed).
   )
   )\
   enditem()
 *** Src/module.c	1997/03/17 13:06:12	1.23
 --- Src/module.c	1997/03/20 02:08:23
 ***************
 *** 500,507 ****
   		Builtin bn = (Builtin) builtintab->getnode2(builtintab, *args);
   
   		if (!bn) {
 ! 		    zwarnnam(nam, "%s: no such builtin", *args, 0);
 ! 		    ret++;
   		} else if (bn->handlerfunc || (bn->flags & BINF_PREFIX)) {
   		    zwarnnam(nam, "%s: builtin is already defined", *args, 0);
   		    ret++;
 --- 500,509 ----
   		Builtin bn = (Builtin) builtintab->getnode2(builtintab, *args);
   
   		if (!bn) {
 ! 		    if(!ops['i']) {
 ! 			zwarnnam(nam, "%s: no such builtin", *args, 0);
 ! 			ret++;
 ! 		    }
   		} else if (bn->handlerfunc || (bn->flags & BINF_PREFIX)) {
   		    zwarnnam(nam, "%s: builtin is already defined", *args, 0);
   		    ret++;
 ***************
 *** 516,522 ****
   	    if (strchr(bnam, '/')) {
   		zwarnnam(nam, "%s: `/' is illegal in a builtin", bnam, 0);
   		ret = 1;
 ! 	    } else if (add_autobin(bnam, modnam)) {
   		zwarnnam(nam, "failed to add builtin %s", bnam, 0);
   		ret = 1;
   	    }
 --- 518,524 ----
   	    if (strchr(bnam, '/')) {
   		zwarnnam(nam, "%s: `/' is illegal in a builtin", bnam, 0);
   		ret = 1;
 ! 	    } else if (add_autobin(bnam, modnam) && !ops['i']) {
   		zwarnnam(nam, "failed to add builtin %s", bnam, 0);
   		ret = 1;
   	    }

-----BEGIN PGP SIGNATURE-----
Version: 2.6.3ia
Charset: ascii

iQCVAwUBMzCfvnD/+HJTpU/hAQHAaAP/dX4xmPmkz3vnF5GpTBnUfafa5pAYKPPA
dR312kzfE2XNiKJuucw0kzjMYdYb4/5ZxSDzfMwjc2RJUpixh+4XYm1lj0uu2+oF
G6SiP66/dP4vIBmBdrGaCO8GMl7dzXZ2TAUGNaOYCS0wYv3N8Kfnfw76vkYjp+IW
vmbwwcEY2+Y=
=neJ9
-----END PGP SIGNATURE-----



Messages sorted by: Reverse Date, Date, Thread, Author