Re: [PATCH] Change the spelling of "wordregex".
- From
Boyd Stephen Smith Jr. <bss@iguanasuicide.net>
- Date
- Jan 21, 2009, 15:33 UTC
- Message-ID
- <200901210934.03196.bss@iguanasuicide.net>
- In-Reply-To
- <alpine.DEB.1.00.0901210925430.7929@racer>
On Wednesday 21 January 2009, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote about 'Re: [PATCH] Change the spelling of "wordregex".':
Show 20 quoted lines
>On Tue, 20 Jan 2009, Boyd Stephen Smith Jr. wrote:
>> diff --git a/userdiff.c b/userdiff.c
>> index 2b55509..d556da9 100644
>> --- a/userdiff.c
>> +++ b/userdiff.c
>> @@ -6,8 +6,8 @@ static struct userdiff_driver *drivers;
>> static int ndrivers;
>> static int drivers_alloc;
>>
>> -#define PATTERNS(name, pattern, wordregex) \
>> - { name, NULL, -1, { pattern, REG_EXTENDED }, wordregex }
>> +#define PATTERNS(name, pattern, word_regex) \
>> + { name, NULL, -1, { pattern, REG_EXTENDED }, word_regex }
>> static struct userdiff_driver builtin_drivers[] = {
>> PATTERNS("html", "^[ \t]*(<[Hh][1-6][ \t].*>.*)$",
>> "[^<>= \t]+|[^[:space:]]|[\x80-\xff]+"),
>
>In general, it is an awesomly good idea to imitate code that is already
>there. That literally guarantees consistency (which is Good, as you
>know).Agreed that consistency is good. However, using "wordregex" isn't consistent. The rest of the time it is used as an identifier in the code, it's spelled "word_regex" or "word_regexp", even before my patch. (Declarations in: userdiff.h, builtin-grep.c, 3x diff.c, and grep.h)
In particular, the macro is used to initialize "struct userdiff_driver"s and the relevant member of that struct uses "word_regex" before my patch.
-- Boyd Stephen Smith Jr. ,= ,-_-. =. bss@iguanasuicide.net ((_/)o o(\_)) ICQ: 514984 YM/AIM: DaTwinkDaddy `-'(. .)`-' http://iguanasuicide.net/ \_/