[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] maint.mk: catch "see @xref{}"
From: |
Jim Meyering |
Subject: |
Re: [PATCH] maint.mk: catch "see @xref{}" |
Date: |
Mon, 16 Apr 2012 20:22:23 +0200 |
Akim Demaille wrote:
> Le 16 avr. 2012 à 19:19, Jim Meyering a écrit :
>
>> Good one.
>> I prefer to use " +" rather than " *",
>
> You are right, I started for grep, not grep -E.
>
>> and suppose someone might say "See also ...", too,
>> so added the (also +)? term.
>>
>> Do you think it's worth worrying about "Also see @xref...", too?
>
> which includes "see @xref" :)
>
>>
>>
>> diff --git a/top/maint.mk b/top/maint.mk
>> index 2228a37..700dd1c 100644
>> --- a/top/maint.mk
>> +++ b/top/maint.mk
>> @@ -838,6 +838,13 @@ sc_texinfo_acronym:
>> halt='found use of Texinfo @acronym{}' \
>> $(_sc_search_regexp)
>>
>> +# Avoid double "see" when contributed by @xref.
>> +sc_texinfo_see_xref:
>> + @prohibit='[Ss]ee +(also +)address@hidden'
>> \
>> + in_vc_files='$(texinfo_suffix_re_)' \
>> + halt='found use of "See @xref{}"' \
>> + $(_sc_search_regexp)
>
> That's good with me. I would be happy to be able to catch broken
> lines though. It would be nice to be able to escape from the constraint
Hey!
We can/should use perl, and there's even an existing framework for this.
Change the default prohibit_undesirable_word_seq_RE_ to e.g.,
- /\bcan\s+not\b/gims
+ /\b(can\s+not\b|(see(\s+also)?|also\s+see)address@hidden)/gims
> of grep per-line. In Texinfo "\n\n" is a better separator imho. How
> about using Perl instead of Grep?
Nice! That new rule exposes problems in coreutils.texi:
doc/coreutils.texi:4913:see @xref{
doc/coreutils.texi:5051:see @xref{
doc/coreutils.texi:16003:Also see @xref{
doc/coreutils.texi:16112:see @xref{
maint.mk: undesirable word sequence
So how about this, instead?
>From 734965bbccf994b40f844c933d8f7fe4213b4ef6 Mon Sep 17 00:00:00 2001
From: Akim Demaille <address@hidden>
Date: Mon, 16 Apr 2012 20:21:51 +0200
Subject: [PATCH] maint.mk: catch "see @xref{}" and similar
* top/maint.mk (prohibit_undesirable_word_seq_RE_): Also
prohibit "See also @xref{", "Also see @pxref{", and similar.
---
ChangeLog | 7 +++++++
top/maint.mk | 5 ++++-
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index c08ba76..479c360 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2012-04-16 Akim Demaille <address@hidden>
+ and Jim Meyering <address@hidden>
+
+ maint.mk: catch "see @xref{}" and similar
+ * top/maint.mk (prohibit_undesirable_word_seq_RE_): Also
+ prohibit "See also @xref{", "Also see @pxref{", and similar.
+
2012-04-16 Jim Meyering <address@hidden>
bootstrap: really use gnulib's po/Makefile.in.in
diff --git a/top/maint.mk b/top/maint.mk
index 2228a37..706d8fe 100644
--- a/top/maint.mk
+++ b/top/maint.mk
@@ -932,8 +932,11 @@ sc_prohibit_doubled_word:
# A regular expression matching undesirable combinations of words like
# "can not"; this matches them even when the two words appear on different
# lines, but not when there is an intervening delimiter like "#" or "*".
+# Similarly undesirable, "See @xref{...}" expands to "See *Note ...".
+# In general, remove a preceding "see". I.e., if you use "Also see @xref{",
+# change that to "Also @xref{".
prohibit_undesirable_word_seq_RE_ ?= \
- /\bcan\s+not\b/gims
+ /\b(can\s+not\b|(see(\s+also)?|also\s+see)address@hidden)/gims
prohibit_undesirable_word_seq_ = \
-e 'while ($(prohibit_undesirable_word_seq_RE_))' \
$(perl_filename_lineno_text_)
--
1.7.10.169.g146fe
- [PATCH] maint.mk: catch "see @xref{}", Akim Demaille, 2012/04/16
- Re: [PATCH] maint.mk: catch "see @xref{}", Jim Meyering, 2012/04/16
- Re: [PATCH] maint.mk: catch "see @xref{}", Akim Demaille, 2012/04/16
- Re: [PATCH] maint.mk: catch "see @xref{}",
Jim Meyering <=
- Re: [PATCH] maint.mk: catch "see @xref{}", Eric Blake, 2012/04/16
- Re: [PATCH] maint.mk: catch "see @xref{}", Jim Meyering, 2012/04/16
- Re: [PATCH] maint.mk: catch "see @xref{}", Jim Meyering, 2012/04/16
- Re: [PATCH] maint.mk: catch "see @xref{}", Jim Meyering, 2012/04/16
- Re: [PATCH] maint.mk: catch "see @xref{}", Akim Demaille, 2012/04/17
- Re: [PATCH] maint.mk: catch "see @xref{}", Jim Meyering, 2012/04/17
- Re: [PATCH] maint.mk: catch "see @xref{}", Karl Berry, 2012/04/16