bug-gnulib
[Top][All Lists]
Advanced

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

Re: new syntax-check rule for @acronym?


From: Jim Meyering
Subject: Re: new syntax-check rule for @acronym?
Date: Thu, 15 Apr 2010 12:46:31 +0200

Simon Josefsson wrote:
> Jim Meyering <address@hidden> writes:
>
>> Simon Josefsson wrote:
>>> Eric Blake <address@hidden> writes:
>> ...
>>>  # Don't use Texinfo @acronym{} as it is not a good idea.
>>>  sc_texinfo_acronym:
>>> -   @grep -nE '@acronym{'                                           \
>>> -       $$($(VC_LIST_EXCEPT) | grep -E '\.texi$$') &&               \
>>> +   @if $(VC_LIST_EXCEPT) | grep -lE '\.texi$$' >/dev/null; then    \
>>
>> Hi Simon,
>>
>> I suggest you also check for .txi and .texinfo suffixes,
>> which probably means factoring out the regexps above and below.
>> Hmm... in fact, you could even make the regexp overridable:
>>
>>   texinfo_suffix_re_ =? '\.(texi(nfo)?|txi)$$'
>
> Good idea!  However I can't make this work, any ideas why the following
> doesn't work?
>
> # Don't use Texinfo @acronym{} as it is not a good idea.
> texinfo_suffix_re_ =? '\.(texi(nfo)?|txi)$$'
> sc_texinfo_acronym:
>       @prohibit='@acronym{'                                           \
>       in_vc_files=$(texinfo_suffix_re_)                               \
>       halt='found use of Texinfo @acronym{}'                          \
>         $(_sc_search_regexp)
>
> Results in:
>
> /bin/sh: \.(texi(nfo)?|txi)$: command not found
> maint.mk: Should specify either prohibit or require
> make: *** [sc_texinfo_acronym] Error 1
>
> There are other places where maint.mk uses a variable with a string
> in_vc_files so I'm not sure what the problem is.

Hi Simon,

I didn't see it right away either ;-)

  s/=?/?=/

Please use the following:

# Don't use Texinfo @acronym{} as it is not a good idea.
texinfo_suffix_re_ ?= \\.(txi|texi(nfo)?)$$
sc_texinfo_acronym:
        @prohibit='@acronym\{'                                          \
        in_vc_files='$(texinfo_suffix_re_)'                             \
        halt='found use of Texinfo @acronym{}'                          \
          $(_sc_search_regexp)

Note how I omitted the single quotes in the definition of
the default (rather, put them in the body).  That results in
better syntax highlighting, and that's why the others are that way, too.
Also, please put the simpler "txi" before the alternatives,
and backslash-escape the "{" in "prohibit".
True, grep -E accepts it, but at least git grep -E rejects such a
regular expression:

    $ git grep -E 'foo{'
    fatal: command line, 'foo{': Unmatched \{
    [Exit 128]

Thanks for following up.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]