groff-commit
[Top][All Lists]
Advanced

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

[groff] 16/17: [man pages]: Use good style in page-local macros.


From: G. Branden Robinson
Subject: [groff] 16/17: [man pages]: Use good style in page-local macros.
Date: Fri, 13 Nov 2020 21:58:45 -0500 (EST)

gbranden pushed a commit to branch master
in repository groff.

commit 5d2d67ad53af3aa960c0a29a40928e54bc248507
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sat Nov 14 13:22:36 2020 +1100

    [man pages]: Use good style in page-local macros.
    
    * contrib/hdtbl/groff_hdtbl.7.man (XAA):
    * man/groff.7.man (request, esc, register): Stop calling two-font macros
      with only one argument; instead, check the number of arguments
      supplied and call appopriate macro.
    
    Page-local macros are discouraged for portability reasons; the ones seen
    here are technical debt.
---
 contrib/hdtbl/groff_hdtbl.7.man |  5 ++++-
 man/groff.7.man                 | 15 ++++++++++++---
 2 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/contrib/hdtbl/groff_hdtbl.7.man b/contrib/hdtbl/groff_hdtbl.7.man
index 15a9b28..7626241 100644
--- a/contrib/hdtbl/groff_hdtbl.7.man
+++ b/contrib/hdtbl/groff_hdtbl.7.man
@@ -129,7 +129,10 @@ groff_hdtbl \- Heidelberger table macros for GNU roff
 .
 .de XAA
 .  TQ
-.  CRI \\$@
+.  ie (\\n[.$] < 2) \
+.    CR \\$@
+.  el \
+.    CRI \\$@
 ..
 .
 .
diff --git a/man/groff.7.man b/man/groff.7.man
index 2d07649..700c286 100644
--- a/man/groff.7.man
+++ b/man/groff.7.man
@@ -76,7 +76,10 @@ groff \- GNU roff language reference
 .
 .\" reference of a request
 .de request
-.  BR \\$*
+.  ie (\\n[.$] < 2) \
+.    B \\$*
+.  el \
+.    BR \\$*
 ..
 .
 .\" ========= numerical elements =========
@@ -158,7 +161,10 @@ groff \- GNU roff language reference
 .\" Result  : prints \name, where 'name' is in B, 'punct' in R
 .\"
 .de esc
-.  BR "\e\\$1" \\$2
+.  ie (\\n[.$] < 2) \
+.    B "\e\\$1"
+.  el \
+.    BR "\e\\$1" \\$2
 ..
 .\" ====================================================================
 .\" .escarg name arg [punct]
@@ -208,7 +214,10 @@ groff \- GNU roff language reference
 .\" reference of a register, without decoration
 .de register
 .  Text register
-.  BR \\$*
+.  ie (\\n[.$] < 2) \
+.    B \\$*
+.  el \
+.    BR \\$*
 ..
 .
 .\" end of macro definitions



reply via email to

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