Re: [RFC/PATCH] completion: avoid "words" as variable name for zsh portability
- From
Felipe Contreras <felipe.contreras@gmail.com>
- Date
- Apr 27, 2011, 10:09 UTC
- Message-ID
- <BANLkTikN7iMa_z7wRN8pUS07SMatpyoDPQ@mail.gmail.com>
- In-Reply-To
- <BANLkTi=3T2B=Gtyk7V_3DB3V+GkbXAaqPw@mail.gmail.com>
On Wed, Apr 27, 2011 at 12:49 PM, Felipe Contreras <felipe.contreras@gmail.com> wrote:
Show 8 quoted lines
> On Wed, Apr 27, 2011 at 12:11 PM, Jonathan Nieder <jrnieder@gmail.com> wrote: >> Thanks. It looks like to get the semantics I expect from "local" >> in zsh, one needs to use "typeset -h" (which bash does not support, >> unfortunately). Probably it is best to steer clear of zsh's special >> variables anyway. > > Hmm, interesting, maybe we should try to find a way to replace those > 'local' with 'typeset -h'.
This seems to do it:
--- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -75,6 +75,10 @@ if [[ -n ${ZSH_VERSION-} ]]; then autoload -U +X bashcompinit && bashcompinit + + # 'words' has special meaning in zsh, and only typeset -h seems to + # override that + alias local="typeset -h" fi case "$COMP_WORDBREAKS" in
-- Felipe Contreras