Re: [RFC/PATCH] completion: avoid "words" as variable name for zsh portability

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Apr 27, 2011 at 12:11 PM, Jonathan Nieder <jrnieder@xxxxxxxxx> wrote:
> Felipe Contreras wrote:
>> On Wed, Apr 27, 2011 at 9:40 AM, Jonathan Nieder <jrnieder@xxxxxxxxx> wrote:
>
>>> Sorry, I got carried away (I am happy to see someone has made some
>>> headway in investigating this old bug). ÂHow about this?
>>
>> What's wrong with my patch?
>
> As mentioned at
> http://thread.gmane.org/gmane.comp.version-control.git/172142/focus=172157
> it breaks the tab completion in the common case that the user uses
> the standard bash completion library (usually provided at
> /etc/bash_completion) and git uses its _get_comp_words_by_ref
> function. ÂYou can test like so:
>
> Â Â Â Â% bash
> Â Â Â Â$ . /etc/bash_completion
> Â Â Â Â$ . contrib/completion/git-completion.bash
> Â Â Â Â$ git fetch origin <TAB>

Where does that 'bash_completion' file comes from? I don't have it on
my system. Do we really need to use _get_comp_words_by_ref from there?
Can't we have our own _get_comp_words_by_ref?

> I also made a small cosmetic change which is less important (sorry, I
> should have mentioned it before): the patch I sent spells out
> comp_words instead of writing cwords to avoid a false analogy between
> the array of all completion words (cwords) and the current word index
> (cword).

I don't see how cword can be confused with cwords. Besides, I prefer
uniformity, so if you use comp_words, cword should be cur_word, or
word_index, or something like that.

>>> There is still a "for unknown reasons" in the above explanation.
>>
>> I'm asking zsh guys:
>> http://www.zsh.org/mla/workers/2011/msg00515.html
>
> 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'.

-- 
Felipe Contreras
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]