Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Bug report: `setopt noaliases` not respected in `local` statement without assignment.

Roman Perepelitsa wrote on Sun, 29 Mar 2020 21:03 +00:00:
> On Sun, Mar 29, 2020 at 10:47 PM Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
> > z-sy-h handles this by saving ${options} to an associative array before
> > resetting the options so it can execute:
> Right. This is done in function _zsh_highlight in
> zsh-syntax-highlighting.zsh. My point is that you cannot rename
> zsh-syntax-highlighting.zsh to zsh-syntax-highlighting-impl.zsh and
> replace the original zsh-syntax-highlighting.zsh with `emulate zsh -o
> no_aliases -c 'source zsh-syntax-highlighting-impl.zsh'` because
> you'll no longer be able to access user options from _zsh_highlight.
> Sticky emulation mode is cool but in this case it provides too much
> insulation.

Yeah, the code I quoted needs to run before options are changed —
i.e., in the outer script, before the 'emulate' call.  That's precisely
why that code's written in a KSH_ARRAYS-compatible way.  (It wasn't
at first, but people opened bug reports…)

Messages sorted by: Reverse Date, Date, Thread, Author