Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Shell startup, aliases vs. functions vs. autoloadable functions, and zcompile benefits
- X-seq: zsh-users 27406
- From: Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Cc: Zach Riggle <zachriggle@xxxxxxxxx>, Mikael Magnusson <mikachu@xxxxxxxxx>, Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: Shell startup, aliases vs. functions vs. autoloadable functions, and zcompile benefits
- Date: Tue, 30 Nov 2021 17:41:57 +0100
- Archived-at: <https://zsh.org/users/27406>
- In-reply-to: <CAH+w=7YtCddgqm5wWQR_40w6u8GVQN2DVYxLqvaAWVV-0ae3YA@mail.gmail.com>
- List-id: <zsh-users.zsh.org>
- References: <CAMP9c5=AkW8B0byaw9J-_rVJ0B19q9xx3wjz3MAgJr6uCF6vNQ@mail.gmail.com> <CAN=4vMpyybbN-DTT7eAXdxV_a=CtaEcaNTKEszQjgL8urTY_zg@mail.gmail.com> <CAH+w=7ZuG0z7m5_z8qCaGiCpDO0KRvXHWz3jkighvkaFcd6+LA@mail.gmail.com> <CAMP9c5=nQS_cw19fuKhKMJAAVPwEr5oCNUiBDBCWBiPC1KioWw@mail.gmail.com> <CAN=4vMoJZZZCbPK-5Ss=gE7iwieHZ4HFF=H9O0TzgMrGBPio6g@mail.gmail.com> <CAHYJk3TJFRKD3DjmR895BFKrJB649j6W=_u8_9fBY2ptprF2tQ@mail.gmail.com> <CAHYJk3RzKT1_WoyKf4FAZ=ffQ7bbiTzSgMP=3ZPbFPWMD2QpiA@mail.gmail.com> <CAN=4vMrtOSV=74aWCitE1uYTq8GwyQrrvm6+ALMpMGy7gEPTNQ@mail.gmail.com> <CAMP9c5kuUtuPO=JjefwEWU_gTxLs4vN7cvqxyZNMC3e6J+ESLA@mail.gmail.com> <CAN=4vMrsCFbtyJLPa0yj-7GyG8GycOkQ=8q4_YbqyRzVyXeXDg@mail.gmail.com> <CAMP9c5nU4icoNmj_md7SRPime31x0pyp5Ng1ZUpJk2aoY-F-JA@mail.gmail.com> <CAH+w=7YtCddgqm5wWQR_40w6u8GVQN2DVYxLqvaAWVV-0ae3YA@mail.gmail.com>
On Tue, Nov 30, 2021 at 5:38 PM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> On Tue, Nov 30, 2021 at 7:10 AM Zach Riggle <zachriggle@xxxxxxxxx> wrote:
> >
> > Fortunately, you can redefine "source" as a function and trap all calls and measure how long it takes to load each file.
>
> If you redefine "source" as a function, then any "typeset" commands in
> the sourced files take on the semantics of "local" and the parameters
> are created only in the context of the function wrapper. That may not
> have any significant effect on benchmarking, but for example settings
> from syntax-highlighting/init.zsh might not be visible to
> syntax-highlighting/external/zsh-syntax-highlighting.zsh (if that
> matters).
All decent plugins (including zsh-syntax-highlighting) can be sourced
from functions because that's how many plugins managers (including
prezto) source them.
Roman.
- References:
- Shell startup, aliases vs. functions vs. autoloadable functions, and zcompile benefits
- Re: Shell startup, aliases vs. functions vs. autoloadable functions, and zcompile benefits
- Re: Shell startup, aliases vs. functions vs. autoloadable functions, and zcompile benefits
- Re: Shell startup, aliases vs. functions vs. autoloadable functions, and zcompile benefits
- Re: Shell startup, aliases vs. functions vs. autoloadable functions, and zcompile benefits
- Re: Shell startup, aliases vs. functions vs. autoloadable functions, and zcompile benefits
- Re: Shell startup, aliases vs. functions vs. autoloadable functions, and zcompile benefits
- Re: Shell startup, aliases vs. functions vs. autoloadable functions, and zcompile benefits
- Re: Shell startup, aliases vs. functions vs. autoloadable functions, and zcompile benefits
- Re: Shell startup, aliases vs. functions vs. autoloadable functions, and zcompile benefits
- Re: Shell startup, aliases vs. functions vs. autoloadable functions, and zcompile benefits
- Re: Shell startup, aliases vs. functions vs. autoloadable functions, and zcompile benefits
Messages sorted by:
Reverse Date,
Date,
Thread,
Author