From: Bart Schaefer <schaefer@brasslantern.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: Surprising effect of fun() { local FPATH=...; autoload -X }, and a bug
Date: Fri, 30 Sep 2016 08:31:01 -0700 [thread overview]
Message-ID: <160930083101.ZM16318@torch.brasslantern.com> (raw)
In-Reply-To: <CAKc7PVAVg9ZeGcCtPVKa69cAkqX11tZde+xyZhHNfTTng7aGqw@mail.gmail.com>
On Sep 30, 8:03am, Sebastian Gniazdowski wrote:
} Subject: Re: Surprising effect of fun() { local FPATH=...; autoload -X },
}
} > Your autoload wrapper that sets up the "local FPATH" needs to store
} > the FPATH value for each module somewhere
}
} This would lead to aliases? The autoloaded function would have to have
} "autoload" calls translated into "zplg_autoload" calls.
[...]
} I could also make autoload wrapper continuously active in Zsh session
} but that doesn't look nice to me.
The wrapper would have to change so that it does the full monty only
when called in a known module context. (Which returns to the question
of whether that can be discovered at the right time.)
} Having fpath-extending loading support in place doesn't mean that
} clean-FPATH goal will not be reached.
It's your software, make the design decision that you think best!
} Btw. I've stumbled upon following code in execcmd / exec.c:3054:
}
} } else if (is_shfunc || type == WC_AUTOFN) {
} Shfunc shf;
} if (is_shfunc)
} shf = (Shfunc)hn;
} else {
} shf = loadautofn(state->prog->shf, 1, 0);
}
} Is this the place where autoload-marked functions are differentiated
} from manual-autoload-stub functions?
It's the place where already-defined functions (stub or otherwise) are
differentiated from autoloads that still need to be pulled in.
next prev parent reply other threads:[~2016-09-30 15:38 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-26 22:07 Sebastian Gniazdowski
2016-09-27 7:05 ` Daniel Shahaf
2016-09-27 7:54 ` Sebastian Gniazdowski
2016-09-29 7:10 ` Bart Schaefer
2016-09-29 9:42 ` Sebastian Gniazdowski
2016-09-29 10:05 ` Sebastian Gniazdowski
2016-09-29 13:58 ` Sebastian Gniazdowski
2016-09-29 21:50 ` Bart Schaefer
2016-09-30 6:03 ` Sebastian Gniazdowski
2016-09-30 15:31 ` Bart Schaefer [this message]
2016-09-30 17:41 ` Sebastian Gniazdowski
2016-09-30 17:53 ` Sebastian Gniazdowski
2016-09-30 20:13 ` Bart Schaefer
2016-09-30 6:49 ` Daniel Shahaf
2016-09-30 18:16 ` Bart Schaefer
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=160930083101.ZM16318@torch.brasslantern.com \
--to=schaefer@brasslantern.com \
--cc=zsh-workers@zsh.org \
/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).