zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@ibmth.df.unipi.it>
To: Zsh workers <zsh-workers@sunsite.auc.dk>
Subject: Re: Bug with _parameters and zmodload
Date: Wed, 01 Sep 1999 18:09:50 +0200	[thread overview]
Message-ID: <9909011609.AA21183@ibmth.df.unipi.it> (raw)
In-Reply-To: "Oliver Kiddle"'s message of "Wed, 01 Sep 1999 17:01:00 DFT." <37CD4DBC.C72B5E08@u.genie.co.uk>

Oliver Kiddle wrote:
> When I upgraded to 3.1.6-pws-2 (from 3.1.6-test-2 - I've been busy recently s
> o haven't upgraded for a while), I got a number of error messages of the foll
> owing form:
> 
> _parameters: mapfile: autoload failed [43]
> 
> I get it for each of parameters, functions, options, commands and mapfile the
>  first time I try to expand a variable after running zsh.

This should fix this part.  The modules were trying to unset any existing
parameters when they installed their own.  The existing parameters were the
autoloadable ones, and it tried to autoload the parameter to unset it, which
it was already in the middle of doing so it couldn't.  The simplest fix is
to retrieve the existing param struct without autoloading and unset that.

I haven't touched the completion functions.  Probably there's no harm in
_parameters loading the parameter module to use to check the parameters,
since if it's autoloadable that should mean it's available for use in this
sort of context, but that's different from the real problem.

--- Src/Modules/mapfile.c.us	Mon Jul 19 18:05:29 1999
+++ Src/Modules/mapfile.c	Wed Sep  1 17:50:22 1999
@@ -83,7 +83,8 @@
     Param pm;
     HashTable ht;
 
-    unsetparam(mapfile_nam);
+    if ((pm = (Param) gethashnode2(paramtab, mapfile_nam)))
+	unsetparam_pm(pm, 0, 1);
     mapfile_pm = NULL;
 
     if (!(pm = createparam(mapfile_nam, PM_SPECIAL|PM_REMOVABLE|PM_HASHED)))
--- Src/Modules/parameter.c.us	Wed Sep  1 17:58:34 1999
+++ Src/Modules/parameter.c	Wed Sep  1 18:03:03 1999
@@ -617,23 +617,28 @@
      * As an example for autoloaded parameters, this is probably a bad
      * example, because we the zsh core doesn't support creation of
      * special hashes, yet. */
+    Param pm;
 
-    unsetparam(PAR_NAM);
+    if ((pm = (Param) gethashnode2(paramtab, PAR_NAM)))
+	unsetparam_pm(pm, 0, 1);
     if (!(parpm = createspecialhash(PAR_NAM, getpmparameter,
 				    scanpmparameters)))
 	return 1;
     parpm->flags |= PM_READONLY;
-    unsetparam(CMD_NAM);
+    if ((pm = (Param) gethashnode2(paramtab, CMD_NAM)))
+	unsetparam_pm(pm, 0, 1);
     if (!(cmdpm = createspecialhash(CMD_NAM, getpmcommand,
 				    scanpmcommands)))
 	return 1;
     cmdpm->sets.hfn = setpmcommands;
-    unsetparam(FUN_NAM);
+    if ((pm = (Param) gethashnode2(paramtab, FUN_NAM)))
+	unsetparam_pm(pm, 0, 1);
     if (!(funpm = createspecialhash(FUN_NAM, getpmfunction,
 				    scanpmfunctions)))
 	return 1;
     funpm->sets.hfn = setpmfunctions;
-    unsetparam(OPT_NAM);
+    if ((pm = (Param) gethashnode2(paramtab, OPT_NAM)))
+	unsetparam_pm(pm, 0, 1);
     if (!(optpm = createspecialhash(OPT_NAM, getpmoption,
 				    scanpmoptions)))
 	return 1;

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


  reply	other threads:[~1999-09-01 16:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-09-01 16:01 Oliver Kiddle
1999-09-01 16:09 ` Peter Stephenson [this message]
1999-09-02  8:53   ` Peter Stephenson
1999-09-02  9:35 Sven Wischnowsky

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=9909011609.AA21183@ibmth.df.unipi.it \
    --to=pws@ibmth.df.unipi.it \
    --cc=zsh-workers@sunsite.auc.dk \
    /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).