Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Bug report: `setopt noaliases` not respected in `local` statement without assignment.
- X-seq: zsh-workers 45648
- From: Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>
- To: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- Subject: Re: Bug report: `setopt noaliases` not respected in `local` statement without assignment.
- Date: Sun, 29 Mar 2020 12:24:26 +0200
- Cc: Marlon Richert <marlon.richert@xxxxxxxxx>, Zsh hackers list <zsh-workers@xxxxxxx>
- In-reply-to: <20200326223449.0a090ae6@tarpaulin.shahaf.local2>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CAHLkEDu76YfBKX+47pT58VAMHd=Ep7JDq8K+3jYBYCAx+W5GKA@mail.gmail.com> <CAN=4vMq_EAtuj-K9P9FpmGADX_ER5msF5aFL6MtKhcT6O+dXxQ@mail.gmail.com> <CAHLkEDurch52306wHG4q6QWt-VXxMmtJSWhBE0s-JU=wTf-VdA@mail.gmail.com> <CAN=4vMqxxC62wQD0eKCqd8kmOq09RxSAf0t+E7eThku9ngFO1A@mail.gmail.com> <20200326223449.0a090ae6@tarpaulin.shahaf.local2>
On Thu, Mar 26, 2020 at 11:34 PM Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
>
> There are a few other options to worry about, e.g., KSH_ARRAYS,
> IGNORE_CLOES_BRACES.
Good point.
I also should've mentioned that `emulate zsh -o no_aliases -c "..."`
shouldn't be used if some of the functions you define must run with
user-defined options. E.g., if you want to respect user's
dot_glob/no_dot_glob (fzf does) or
interactive_comments/no_interactive_comments (f-sy-h does), then this
approach is out.
Here's another option that doesn't require one to create a new file:
() { 'emulate' '-L' 'zsh' '-o' 'no_aliases' && 'eval' "$(<<\END
# original file content goes here
END
)"; }
Downsides:
- one fork (increases loading time)
- breaks syntax highlighting in code editors
- zcompile won't be effective at speeding up loading time
- some aliases can still break this; for example: alias -g '()'=nope
Roman.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author