Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Truncate $functions
- X-seq: zsh-users 21300
- From: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: Truncate $functions
- Date: Tue, 16 Feb 2016 09:05:36 +0100
- Cc: Zsh Users <zsh-users@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=rC/pXBlfImoyIRwQbUh+dRik/df/2rxqclcjkrs3OXE=; b=Y/dGTJG+8eXLNQVlMPMp5TwCGFHFzGuqhRTjyDA2vDa19LALQEBxJM0P7wWVOhH7uM 2kOlGRYGCFhjSkhlzafw4a+ttB7PO1SnG2+R/Y1MxG6yP/9iDLf9Qz5swOM9LPu1aElF HLmejojovowDF6xFdStf5su6kjwsG4JoYlWKJZ5NhzLIwVNxwy7l7c9WGP3+ytotGJ5H vp/CX65plhX00Fpw3w2ecuvrOgQqzLkzMDb9ZVmt7wx22A+gmgbHyJ+1FezD13+wuEgp 7k57QE1aYEBLskLX6hS2Mj5XTRnXOolxiw4aDaTBavQu0nGsTBmwB4wFaLH2ZcT5Y7ih AaDw==
- In-reply-to: <160215205153.ZM28963@torch.brasslantern.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>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CAKc7PVBFD0h6ovynoTCkBmR3Z+cfQv_bs2-AOfc_4sfDAwP7ow@mail.gmail.com> <160215091116.ZM27442@torch.brasslantern.com> <CAKc7PVAF9zYtWeyZJccet=-_Dbae3=WtkG-wLxjjX2Btt_VGdg@mail.gmail.com> <160215205153.ZM28963@torch.brasslantern.com>
On 16 February 2016 at 05:51, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Feb 15, 8:31pm, Sebastian Gniazdowski wrote:
> }
> } Thank you, this works really well.
>
> As an additional note -- functions that look like
>
> sample () {
> # undefined
> builtin autoload -X
> }
>
> should be restored as
>
> autoload sample
Indeed.. otherwise problems that the --reload-and-run function fixed
will appear. Or maybe not? Before, we were trying assignment to
functions or eval. Here it's plain script body. Wonder how I could
test for any problems quickly, will probably leave the issue for a
while
> except that you can't know which of the -U -k -z options was specified
> the first time the name was marked for autoload, so there's no way to
> get this entirely right.
Looking at define's -f output I have:
_a2ps () {
# undefined
builtin autoload -XUz
}
_a2utils () {
# undefined
builtin autoload -XUz
}
_aap () {
# undefined
builtin autoload -XUz
}
...
So it looks like I can have the options by parsing functions body?
> The other drawback to this scheme is that you can't save and restore
> the "sticky emulation" bits of any of the functions.
Slightly acceptable limitation, user will be told "don't change
emulate modes". Anyone doing emulate sh will break his session anyway
because of for example SHGLOB. That said, the snapshot could cover
emulate modes and restore them too..
Best regards,
Sebastian Gniazdowski
Messages sorted by:
Reverse Date,
Date,
Thread,
Author