zsh-workers
 help / color / mirror / code / Atom feed
From: Zefram <zefram@dcs.warwick.ac.uk>
To: zsh-workers@math.gatech.edu
Subject: zmodload -a -i
Date: Thu, 20 Mar 1997 16:24:50 GMT	[thread overview]
Message-ID: <290.199703201624@stone.dcs.warwick.ac.uk> (raw)

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


                 reply	other threads:[~1997-03-20 16:39 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=290.199703201624@stone.dcs.warwick.ac.uk \
    --to=zefram@dcs.warwick.ac.uk \
    --cc=zsh-workers@math.gatech.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).