Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: separating functions, fpath, and autoload
- X-seq: zsh-users 23573
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: Pier Paolo Grassi <pierpaolog@xxxxxxxxx>, TJ Luoma <luomat@xxxxxxxxx>
- Subject: Re: separating functions, fpath, and autoload
- Date: Mon, 13 Aug 2018 14:31:44 +0000
- Cc: "Zsh-Users List" <zsh-users@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=7EErZA KrkcT4ijg3rME+vv4aEkaBIYHtH7/uZYvDbfU=; b=gykL1dVMJwV+FNI3+A9KnK RkEljnq74vD0wjPOvAj6PCihLp87jlyoO4RBljRRj1a3MlZiG0TYN/CIWWNkw3O0 SDd5MbO8fZqVfAGBGVQWNHZM4DgdnxB6TImrj0IDnOO+jtQYfkWrwqSF/v8I36eS dU20736EOoX+1lX2+ODzpxw2WCivZxYwFNIFyVy88glyFbxxPax0x7IyajhEQuGy spZkLw75EHxyIaxv/JhMIy1O9b9jzEiSJ3gpWMrYh1D0twpS7ZUEOteNuPtXA5lU GZdY953uX9VUAeZ2tgZRhUrYUn4EqSKXjJIvDXS1TQso0JVfvHHGfB04NXXv2gvg ==
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=7EErZA KrkcT4ijg3rME+vv4aEkaBIYHtH7/uZYvDbfU=; b=k8I3gtF75T7agQu/zoMNz4 AS/sLu8C916bRD0t2SkEYdnHoDPTSGL4ckfr8t2LpvBK68grggkdURkGpw15HiYZ UO4fvRY0eNn/7SF2QXeU2I9X9n0DdNfxMQ9m/J+IS/qE4Yv5EiYzBoB05TiE5yWf aYsLUqsyfu97tOIRMDqx6uu0Wt880SmHoQFVo8popLuOUN1fw6nk9niMap/Qrss3 9ifJkQEwiQI3mtJ3UIxlih6yPvNG+tHGEU3SDjcTzk0FefmSHsQ5XoUtsgn+Sy/+ AUZ/PvlvAR1j7yAVUekD6MQa8LgONpeLn4+eFc0/C6k8MEe9kkHhFHPeu4ooFTbA ==
- In-reply-to: <CAP+y1xB4jzy-8HVEjSU0aX0kpcyAn98TAcm3UGBL0fDUi1+pCw@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CADjGqHu5KYqFWdawfBu6PR5pGyZN_iZSXx690edLO+FtpKfM1A@mail.gmail.com> <CAP+y1xB4jzy-8HVEjSU0aX0kpcyAn98TAcm3UGBL0fDUi1+pCw@mail.gmail.com>
In more words:
'autoload foo' marks 'foo' as the name of a function that will be
instantiated upon the first call to it. After calling foo, you'll
see the actual definition of foo: 'autoload foo; foo; which foo'.
You can pass +X to 'autoload' to load the function immediately
(before it's called).
More below.
Pier Paolo Grassi wrote on Mon, 13 Aug 2018 15:56 +0200:
> that should be correct, the autoload will be executed when you first invoke
> msg, have you tried invoking it?
> Il giorno lun 13 ago 2018 alle 15:50 TJ Luoma <luomat@xxxxxxxxx> ha scritto:
> > if [ -d "$ZDOTDIR/functions" ]
> > then
> > fpath=($ZDOTDIR/functions $fpath)
Another way:
fpath=( $ZDOTDIR/functions(N) $fpath )
or even
fpath[1,0]=( $ZDOTDIR/functions(N) )
then you don't need an if.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author