From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11261 invoked from network); 1 Sep 1999 16:44:06 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 1 Sep 1999 16:44:06 -0000 Received: (qmail 18833 invoked by alias); 1 Sep 1999 16:43:53 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7616 Received: (qmail 18819 invoked from network); 1 Sep 1999 16:43:53 -0000 Message-Id: <9909011609.AA21183@ibmth.df.unipi.it> To: Zsh workers Subject: Re: Bug with _parameters and zmodload In-Reply-To: "Oliver Kiddle"'s message of "Wed, 01 Sep 1999 17:01:00 DFT." <37CD4DBC.C72B5E08@u.genie.co.uk> Date: Wed, 01 Sep 1999 18:09:50 +0200 From: Peter Stephenson 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 Tel: +39 050 844536 WWW: http://www.ifh.de/~pws/ Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy