Re: [PATCH] --color-words: Make the word characters configurable
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- May 4, 2008, 09:18 UTC
- Message-ID
- <alpine.DEB.1.00.0805041010000.30431@racer>
- In-Reply-To
- <20080503144337.GA7987@mithlond.arda.local>
Hi,
On Sat, 3 May 2008, Teemu Likonen wrote:
Show 14 quoted lines
> Johannes Schindelin wrote (2008-05-03 15:03 +0100): > > > Now, you can specify which characters are to be interpreted as word > > characters with "--color-words=A-Za-z", or by setting the config > > variable diff.wordCharacters. > > > > Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> > > --- > > > > I would have preferred an approach like this. > > Unfortunately this does not work at all with other than Ascii > characters. It makes --color-words completely unusable for anything > other than Ascii text. Sorry.
Sorry, but the original way was also only meant for ASCII. The fact that isspace() happens to work with UTF-8 does _not_ mean that it was any more useful with non-ASCII: think UTF-16.
So no, I do not buy into your ASCII argument at all.
Show 7 quoted lines
> Ping Yin's version has also the problem that UTF-8 multibyte characters > U+0080..U+10FFFF don't work in diff.nonwordchars. Fortunately the most > important word delimiters are in U+0000..U+007F (=Ascii) area so Ping's > version is perfectly usable with Unicode text. > > (Even the old --color-words behaviour with only SPACE as non-word char > was perfectly usable with Unicode text.)
See above.
> I, too, would like to see Ping's patch series merged in.
I have no problems with the intention. But I have problems with the design. It is no less ASCII-bound than what I proposed, it wants you to specify what does _not_ make a word character (making every newbie, and me, too, going "Huh?").
And I also commented on the artificial limitations by design: I think it is a big mistake to limit the user's options when it would be easy not to, just because the designer could not think of useful applications.
Ciao, Dscho