zsh-syntax-highlighting icon indicating copy to clipboard operation
zsh-syntax-highlighting copied to clipboard

Question: have the driver sourced in zsh emulation?

Open danielshahaf opened this issue 4 years ago • 5 comments

In INSTALL.md, shall we change source ./zsh-syntax-highlighting/zsh-syntax-highlighting.zsh to emulate zsh -c "source ./zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"?

Compare the documentation of autoload: https://github.com/zsh-users/zsh/blob/fd627a504fd2a84833b7edcf92dd1595fcf11df9/Doc/Zsh/builtins.yo#L217-L224

In particular, I think this might have negated #622.

danielshahaf avatar Mar 13 '20 06:03 danielshahaf

The test harness' callsite should be updated too — either to use this construct, or to test invocation with unusual options (e.g., KSH_ARRAYS) in effect.

danielshahaf avatar Mar 13 '20 13:03 danielshahaf

How can we set "sticky" emulation for all our functions?

danielshahaf avatar Mar 13 '20 14:03 danielshahaf

In INSTALL.md, shall we change source ./zsh-syntax-highlighting/zsh-syntax-highlighting.zsh to emulate zsh -c "source ./zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"?

Actually, it might be easier to add a layer of indirection:

% git rename zsh-syntax-highlighting.zsh driver.zsh
% print -r -- $'0=${(%):-%N}; emulate zsh -c \'source "${0:h}/driver.zsh" "$@"\'' > zsh-syntax-highlighting.zsh
% git add $_

This way, we won't spend the next 10 years telling people to add the emulate to their dotfiles…

We'd still need to check whether emulate zsh -c 'source $foo' DTRTs for us, though.

(The ${(%):-%N} is taken from zsh-syntax-highlighting.zsh:39.)

danielshahaf avatar Mar 14 '20 17:03 danielshahaf

Triage: Deferring until after redrawhook is merged to prevent annoying merge conflicts upon that merge.

danielshahaf avatar May 22 '20 04:05 danielshahaf

Triage: Deferring until after redrawhook is merged to prevent annoying merge conflicts upon that merge.

Triage: Unblocked; milestoning 0.8.0, but will defer it if that release is ready before this is merged.

danielshahaf avatar Aug 09 '20 11:08 danielshahaf