>From fb9649338de86dc73bd5415b68d3ceeb99884905 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 20 Apr 2018 12:44:48 -0700 Subject: [PATCH] doc: port better to mandoc * doc/grep.in.1: Check for groff and its macro packages independently, as groff can be used with non-groff macro packages. Use an-ext style macros rather than www.tmac style, as this should be more portable to mandoc. Problem reported by Laura Morales and Ingo Schwarze (Bug#31228). --- doc/grep.in.1 | 143 +++++++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 127 insertions(+), 16 deletions(-) diff --git a/doc/grep.in.1 b/doc/grep.in.1 index ecc8105..9393b37 100644 --- a/doc/grep.in.1 +++ b/doc/grep.in.1 @@ -9,28 +9,131 @@ .\" after you make a change that you decide is nontrivial. .\" It is no big deal to forget to update the date. . -.if !\n(.g \{\ -. if !\w|\*(lq| \{\ -. ds lq `` -. if \w'\(lq' .ds lq "\(lq +.TH GREP 1 \*(Dt "GNU grep @VERSION@" "User Commands" +. +.if !\w|\*(lq| \{\ +.\" groff an-old.tmac does not seem to be in use, so define lq and rq. +. ie \n(.g \{\ +. ds lq \(lq\" +. ds rq \(rq\" . \} -. if !\w|\*(rq| \{\ +. el \{\ +. ds lq `` . ds rq '' -. if \w'\(rq' .ds rq "\(rq . \} .\} . -.ie \n[.g] .mso www.tmac +.if !\w|\*(la| \{\ +.\" groff an-ext.tmac does not seem to be in use, so define the parts of +.\" it that are used below. For a copy of groff an-ext.tmac, please see: +.\" https://git.savannah.gnu.org/cgit/groff.git/plain/tmac/an-ext.tmac +.\" --- Start of lines taken from groff an-ext.tmac +. +.\" Check whether we are using grohtml. +.nr mH 0 +.if \n(.g \ +. if '\*(.T'html' \ +. nr mH 1 +. +. +.\" Map mono-width fonts to standard fonts for groff's TTY device. +.if n \{\ +. do ftr CR R +. do ftr CI I +. do ftr CB B +.\} +. +.\" groff has glyph entities for angle brackets. +.ie \n(.g \{\ +. ds la \(la\" +. ds ra \(ra\" +.\} .el \{\ -. de MTO -\\$2 \(laemail: \\$1 \(ra\\$3 +. ds la <\" +. ds ra >\" +. \" groff's man macros control hyphenation with this register. +. nr HY 1 +.\} +. +.\" Start URL. +.de UR +. ds m1 \\$1\" +. nh +. if \\n(mH \{\ +. \" Start diversion in a new environment. +. do ev URL-div +. do di URL-div +. \} .. -. de URL -\\$2 \(laURL: \\$1 \(ra\\$3 +. +. +.\" End URL. +.de UE +. ie \\n(mH \{\ +. br +. di +. ev +. +. \" Has there been one or more input lines for the link text? +. ie \\n(dn \{\ +. do HTML-NS "" +. \" Yes, strip off final newline of diversion and emit it. +. do chop URL-div +. do URL-div +\c +. do HTML-NS +. \} +. el \ +. do HTML-NS "\\*(m1" +\&\\$*\" +. \} +. el \ +\\*(la\\*(m1\\*(ra\\$*\" +. +. hy \\n(HY +.. +. +. +.\" Start email address. +.de MT +. ds m1 \\$1\" +. nh +. if \\n(mH \{\ +. \" Start diversion in a new environment. +. do ev URL-div +. do di URL-div +. \} .. +. +. +.\" End email address. +.de ME +. ie \\n(mH \{\ +. br +. di +. ev +. +. \" Has there been one or more input lines for the link text? +. ie \\n(dn \{\ +. do HTML-NS "" +. \" Yes, strip off final newline of diversion and emit it. +. do chop URL-div +. do URL-div +\c +. do HTML-NS +. \} +. el \ +. do HTML-NS "\\*(m1" +\&\\$*\" +. \} +. el \ +\\*(la\\*(m1\\*(ra\\$*\" +. +. hy \\n(HY +.. +.\" --- End of lines taken from groff an-ext.tmac .\} . -.TH GREP 1 \*(Dt "GNU grep @VERSION@" "User Commands" .hy 0 . .SH NAME @@ -1174,11 +1277,17 @@ not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. .SH BUGS .SS "Reporting Bugs" Email bug reports to -.MTO address@hidden "the bug-reporting address" . +.MT address@hidden +the bug-reporting address +.ME . An -.URL http://lists.gnu.org/mailman/listinfo/bug-grep "email archive" +.UR http://lists.gnu.org/mailman/listinfo/bug-grep +email archive +.UE and a -.URL http://debbugs.gnu.org/cgi/pkgreport.cgi?package=grep "bug tracker" +.UR http://debbugs.gnu.org/cgi/pkgreport.cgi?package=grep +bug tracker +.UE are available. .SS "Known Bugs" Large repetition counts in the @@ -1206,7 +1315,9 @@ glob(7), regex(7). grep(1p). .SS "Full Documentation" A -.URL http://www.gnu.org/software/grep/manual/ "complete manual" +.UR http://www.gnu.org/software/grep/manual/ +complete manual +.UE is available. If the .B info -- 2.14.3