2 ### check-man-pages - check man pages for errors
4 ## Copyright (C) 2022-2024 Free Software Foundation, Inc.
6 ## Author: Stefan Kangas <stefankangas@gmail.com>
8 ## This file is part of GNU Emacs.
10 ## GNU Emacs is free software: you can redistribute it and/or modify
11 ## it under the terms of the GNU General Public License as published by
12 ## the Free Software Foundation, either version 3 of the License, or
13 ## (at your option) any later version.
15 ## GNU Emacs is distributed in the hope that it will be useful,
16 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ## GNU General Public License for more details.
20 ## You should have received a copy of the GNU General Public License
21 ## along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
25 ## Check Emacs man pages for errors using `man'.
29 source "${0%/*}/emacs-shell-lib"
35 # ctags.1 just includes the man page etags.1, which AFAICT will
36 # default to the one installed on the system (!), instead of the
37 # one in the repository. So checking it is pointless, and we will
38 # in any case already check etags.1 separately.
39 if [ "$page" == "ctags.1" ]; then
43 LC_ALL
=C.UTF-8 MANROFFSEQ
='' MANWIDTH
=80 \
44 man
--warnings=all
,mac
-E UTF-8
-l -Tutf8 -Z "$page" >/dev
/null
2> "$log"
45 log_size
=$
(stat
--format=%s
"$log")
46 if [ "$log_size" -ne 0 ]; then
48 # Point to the correct file for *compilation* buffers.
50 |
sed 's/troff: man1\/\([^ ]\+\)\.1/troff: doc\/man\/\1.1/' \
51 |
sed "s/<standard input>/doc\/man\/$page/"