From: Oliver Kiddle <opk@u.genie.co.uk>
To: Zsh workers <zsh-workers@sunsite.auc.dk>
Subject: Bug with _parameters and zmodload
Date: Wed, 01 Sep 1999 17:01:00 +0100 [thread overview]
Message-ID: <37CD4DBC.C72B5E08@u.genie.co.uk> (raw)
When I upgraded to 3.1.6-pws-2 (from 3.1.6-test-2 - I've been busy recently so haven't upgraded for a while), I got a number of error messages of the following 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. After this it all works and the mapfile and parameter modules are loaded. The problem is a result of my having used zmodload -ap for the parameters in these modules in my .zshrc. I put it there so that the modules would be autoloaded if I tried to use them.
_parameters correctly determines that the parameters modules is not loaded (with zmodload -e) so uses typeset + to generate the list of parameters. This is fine but note that the list of parameters includes mapfile, parameters, functions etc which are all 'undefined'. Then on line 43 (as in the error message), _parameters goes on to divide the parameters into directories and not directories. When it reaches the undefined parameters (mapfile etc), it attempts to autoload the modules. This it ofcourse should not do - it should probably assume that the parameters aren't directories. I've got no idea why it prints an error message about failing to load the module, especially as it clearly does load the module.
My first thought on a fix for this was to change line 43 to something like:
if [[ ${(Pt)i} = undefined* ]] || [[ -d ${(P)i} ]]; then
(and swap the then/else parts arround) but this will return association or whatever after loading the module. The alternative is to use typeset but I haven't done a patch because there is probably a cleaner solution. A quick-fix would be to remove undefined parameters from the list of parameters as generated by typeset +.
The separate problem of the bogus autoload failed error message seems to only occur with autoloaded parameters - zftp etc (with zmodload -a zftp) has no such problems.
Another unrelated problem I have found is that the completion matching control to complete partial directories doesn't work when variables are used:
I'd expect:
cd $code[ai]/R/drop.1.34<tab>
to complete to:
cd $code[ai]/Releases/drop.1.34.0.rel/
but it doesn't.
Oliver
next reply other threads:[~1999-09-01 16:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-09-01 16:01 Oliver Kiddle [this message]
1999-09-01 16:09 ` Peter Stephenson
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=37CD4DBC.C72B5E08@u.genie.co.uk \
--to=opk@u.genie.co.uk \
--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).