1#!/bin/sh
2
3# Copyright 2016-2023 Free Software Foundation, Inc.
4# This script is free software; the Free Software Foundation
5# gives unlimited permission to copy and/or distribute it,
6# with or without modifications, as long as this notice is preserved.
7
8# This program is distributed in the hope that it will be useful,
9# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11# PARTICULAR PURPOSE.
12
13o=$(grep -E '([A-Z]|resp)\)?[.!?]( |$)' mpfr.texi | grep -Ev '^(\* .*::|@c )')
14[ -z "$o" ] && exit
15
16# Note: The default Texinfo rules are heuristics allowing one to get
17# typography correct by default in most cases, but it is also easy to
18# leave errors if one does not check the generated info file. Thus it
19# is better to make typography explicit concerning punctuation marks.
20# The above test checks lines ending with a capital letter possibly
21# followed by a closing parenthesis, followed by one of the concerned
22# punctuation marks; menu items and comments are ignored.
23
24cat <<EOF
25[check-typography] Warning! Possibly incorrect typography.
26Make it explicit to avoid ambiguities:
27  * Punctuation not ending a sentence: use @: after the punctuation
28    (Texinfo manual: Section 12.3.2 "Not Ending a Sentence").
29  * Punctuation ending a sentence: use @ before the punctuation
30    (Texinfo manual: Section 12.3.3 "Ending a Sentence").
31Affected lines in mpfr.texi:
32$o
33[check-typography] End of the warning message.
34EOF
35
36exit 1
37