groff-commit
[Top][All Lists]
Advanced

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

[groff] 24/51: [mdoc] (doc-footer): Correct indentation.


From: G. Branden Robinson
Subject: [groff] 24/51: [mdoc] (doc-footer): Correct indentation.
Date: Sun, 11 Sep 2022 08:15:52 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit 646bc58604895877e764b8f654e2d5a868145d8d
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Tue Sep 6 20:33:46 2022 -0500

    [mdoc] (doc-footer): Correct indentation.
    
    * tmac/mdoc/doc-common (doc-footer): Correct indentation.
---
 ChangeLog             | 15 +++++++++++++
 tmac/doc.tmac         | 26 +++++++++++------------
 tmac/mdoc/doc-common  | 58 +++++++++++++++++++++++++--------------------------
 tmac/mdoc/doc-ditroff |  8 +++----
 tmac/mdoc/doc-nroff   |  4 ++--
 tmac/mdoc/doc-syms    | 10 ++++-----
 6 files changed, 68 insertions(+), 53 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 76d45a894..c11b859d3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2022-09-06  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       [mdoc]: Fix code style nit: stop using Control+G as an escape
+       sequence argument delimiter.  This is not necessary in groff and
+       hasn't been for at least thirty years.  See the node/section
+       "Implementation Differences" of our Texinfo manual.  Our mdoc
+       implementation does not operate in compatibility mode, so using
+       control characters like this obfuscates input to no advantage.
+
+       * tmac/doc.tmac:
+       * tmac/mdoc/doc-common:
+       * tmac/mdoc/doc-ditroff:
+       * tmac/mdoc/doc-nroff:
+       * tmac/mdoc/doc-syms: Do it.
+
 2022-09-06  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        * tmac/mdoc/doc-common (doc-footer): Pull more footer concerns
diff --git a/tmac/doc.tmac b/tmac/doc.tmac
index d46a2c0d4..0f7e5187a 100644
--- a/tmac/doc.tmac
+++ b/tmac/doc.tmac
@@ -1499,7 +1499,7 @@
 .      \" logically
 .      nr doc-reg-des \n[doc-arg-limit]
 .      while (\n[doc-reg-des] >= \n[doc-arg-ptr]) \{\
-.        if !\A\*[doc-arg\n[doc-reg-des]] \
+.        if !\A'\*[doc-arg\n[doc-reg-des]]' \
 .          break
 .        if !d doc-after-\*[doc-arg\n[doc-reg-des]] \
 .          break
@@ -2381,7 +2381,7 @@
 .de doc-get-arg-type
 .  nr doc-arg-type 2
 .
-.  if ((\n[doc-width] < 4) & \A\$1) \{\
+.  if ((\n[doc-width] < 4) & \A'\$1') \{\
 .    ie (\n[doc-width] == 1) \{\
 .      if r doc-punct\$1 \
 .        nr doc-arg-type \n[doc-punct\$1]
@@ -2410,7 +2410,7 @@
 .  nr doc-arg-type 2
 .  length doc-width "\*[doc-arg\$1]
 .
-.  if ((\n[doc-width] < 4) & \A\*[doc-arg\$1]) \{\
+.  if ((\n[doc-width] < 4) & \A'\*[doc-arg\$1]') \{\
 .    ie (\n[doc-width] == 1) \{\
 .      if r doc-punct\*[doc-arg\$1] \
 .        nr doc-arg-type \n[doc-punct\*[doc-arg\$1]]
@@ -2936,7 +2936,7 @@
 .      nr doc-reg-ddBa 2
 .
 .      nr doc-reg-ddBa1 0
-.      if \B(\$2) \{\
+.      if \B'(\$2)' \{\
 .        \" disable warnings related to scaling indicators (32)
 .        nr doc-reg-ddBa2 \n[.warn]
 .        warn (\n[.warn] - (\n[.warn] / 32 % 2 * 32))
@@ -2947,7 +2947,7 @@
 .        \" the scaling indicator)
 .        ds doc-str-ddBa "\$2
 .        substring doc-str-ddBa 0 -2
-.        if \B(\*[doc-str-ddBa]) \{\
+.        if \B'(\*[doc-str-ddBa])' \{\
 .          nr doc-reg-ddBa3 (;(\$2))
 .          nr doc-reg-ddBa4 (\*[doc-str-ddBa])
 .          if (\n[doc-reg-ddBa3] == \n[doc-reg-ddBa4]) \
@@ -3268,7 +3268,7 @@
 .    nr doc-arg-ptr +1
 .    ds doc-str-dBla "\*[doc-arg\n[doc-arg-ptr]]
 .    substring doc-str-dBla 0 0
-.    ie .\*[doc-str-dBla] \{\
+.    ie '.'\*[doc-str-dBla]' \{\
 .      ds doc-str-dBla "\*[doc-arg\n[doc-arg-ptr]]
 .      substring doc-str-dBla 1
 .      doc-first-parameter \*[doc-str-dBla]
@@ -3304,7 +3304,7 @@
 .    el \{\
 .      \" test whether argument is a valid numeric expression
 .      nr doc-reg-dBla1 0
-.      if \B(\*[doc-str-dBla]) \{\
+.      if \B'(\*[doc-str-dBla])' \{\
 .        \" disable warnings related to scaling indicators (32)
 .        nr doc-reg-dBla2 \n[.warn]
 .        warn (\n[.warn] - (\n[.warn] / 32 % 2 * 32))
@@ -3315,7 +3315,7 @@
 .        \" the scaling indicator)
 .        ds doc-str-dBla1 "\*[doc-str-dBla]
 .        substring doc-str-dBla1 0 -2
-.        if \B(\*[doc-str-dBla1]) \{\
+.        if \B'(\*[doc-str-dBla1])' \{\
 .          nr doc-reg-dBla3 (;(\*[doc-str-dBla]))
 .          nr doc-reg-dBla4 (\*[doc-str-dBla1])
 .          if (\n[doc-reg-dBla3] == \n[doc-reg-dBla4]) \
@@ -3351,13 +3351,13 @@
 .    el \{\
 .      ds doc-str-dBla "\*[doc-arg\n[doc-arg-ptr]]
 .      nr doc-reg-dBla1 0
-.      if \B(\*[doc-str-dBla]) \{\
+.      if \B'(\*[doc-str-dBla])' \{\
 .        nr doc-reg-dBla2 \n[.warn]
 .        warn (\n[.warn] - (\n[.warn] / 32 % 2 * 32))
 .
 .        ds doc-str-dBla1 "\*[doc-str-dBla]
 .        substring doc-str-dBla1 0 -2
-.        if \B(\*[doc-str-dBla1]) \{\
+.        if \B'(\*[doc-str-dBla1])' \{\
 .          nr doc-reg-dBla3 (;(\*[doc-str-dBla]))
 .          nr doc-reg-dBla4 (\*[doc-str-dBla1])
 .          if (\n[doc-reg-dBla3] == \n[doc-reg-dBla4]) \
@@ -3394,7 +3394,7 @@
 .      nr doc-num-columns +1
 .      ds doc-str-dBla \*[doc-arg\n[doc-arg-ptr]]
 .      substring doc-str-dBla 0 0
-.      ie .\*[doc-str-dBla] \{\
+.      ie '.'\*[doc-str-dBla]' \{\
 .        ds doc-str-dBla "\*[doc-arg\n[doc-arg-ptr]]
 .        substring doc-str-dBla 1
 .        doc-first-parameter \*[doc-str-dBla]
@@ -4462,8 +4462,8 @@
 .  \}\}
 .
 .  while (\n[doc-reg-dsct] <= \$1) \{\
-.    as doc-str-dsct " +\w\*[doc-arg\n[doc-reg-dsct]]\*[doc-str-dsct1]u
-.    nr doc-column-indent-width 
+\w\*[doc-arg\n[doc-reg-dsct]]\*[doc-str-dsct1]u
+.    as doc-str-dsct " +\w'\*[doc-arg\n[doc-reg-dsct]]\*[doc-str-dsct1]'u
+.    nr doc-column-indent-width 
+\w'\*[doc-arg\n[doc-reg-dsct]]\*[doc-str-dsct1]'u
 .    nr doc-reg-dsct +1
 .  \}
 .
diff --git a/tmac/mdoc/doc-common b/tmac/mdoc/doc-common
index 7785c5ada..de230d34b 100644
--- a/tmac/mdoc/doc-common
+++ b/tmac/mdoc/doc-common
@@ -348,17 +348,17 @@
 .
 .  if !"\$2"" \{\
 .    ds doc-section \$2
-.    ie \B\$2 \{\
+.    ie \B'\$2' \{\
 .      if ((\$2 >= 1) & (\$2 <= 9)) \{\
 .        ie \n[doc-volume-operating-system-ateol] \{\
 .          ds doc-volume "\*[doc-volume-ds-\$2] \*[doc-volume-operating-system]
-.          if \A\$3 \{\
+.          if \A'\$3' \{\
 .            if d doc-volume-as-\$3 \
 .              as doc-volume "/\*[doc-volume-as-\$3]
 .        \}\}
 .        el \{\
 .          ds doc-volume "\*[doc-volume-operating-system]
-.          if \A\$3 \{\
+.          if \A'\$3' \{\
 .            if d doc-volume-as-\$3 \
 .              as doc-volume "/\*[doc-volume-as-\$3]
 .          \}
@@ -372,7 +372,7 @@
 .      el .if "\$2"paper" \
 .        ds doc-volume UNTITLED
 .      \}\}
-.      if \A\$3 \{\
+.      if \A'\$3' \{\
 .        if d doc-volume-ds-\$3 \
 .          ds doc-volume "\*[doc-volume-ds-\$3]
 .  \}\}\}
@@ -819,14 +819,14 @@
 .    ds doc-operating-system "\*[doc-default-operating-system]
 .  el \{ .ie "\$1"ATT" \{\
 .    ds doc-operating-system AT&T
-.    if \A\$2 \{\
+.    if \A'\$2' \{\
 .      ie d doc-operating-system-ATT-\$2 \
 .        as doc-operating-system " \*[doc-operating-system-ATT-\$2]
 .      el \
 .        as doc-operating-system " UNIX
 .  \}\}
 .  el \{ .ie "\$1"BSD" \{\
-.    if \A\$2 \{\
+.    if \A'\$2' \{\
 .      ie d doc-operating-system-BSD-\$2 \
 .        ds doc-operating-system "\*[doc-operating-system-BSD-\$2]
 .      el \
@@ -834,7 +834,7 @@
 .  \}\}
 .  el \{ .ie "\$1"FreeBSD" \{\
 .    ds doc-operating-system FreeBSD
-.    if \A\$2 \{\
+.    if \A'\$2' \{\
 .      ie d doc-operating-system-FreeBSD-\$2 \
 .        as doc-operating-system \~\*[doc-operating-system-FreeBSD-\$2]
 .      el \
@@ -842,7 +842,7 @@
 .  \}\}
 .  el \{ .ie "\$1"DragonFly" \{\
 .    ds doc-operating-system DragonFly
-.    if \A\$2 \{\
+.    if \A'\$2' \{\
 .      ie d doc-operating-system-DragonFly-\$2 \
 .        as doc-operating-system \~\*[doc-operating-system-DragonFly-\$2]
 .      el \
@@ -850,7 +850,7 @@
 .  \}\}
 .  el \{ .ie "\$1"NetBSD" \{\
 .    ds doc-operating-system NetBSD
-.    if \A\$2 \{\
+.    if \A'\$2' \{\
 .      ie d doc-operating-system-NetBSD-\$2 \
 .        as doc-operating-system \~\*[doc-operating-system-NetBSD-\$2]
 .      el \
@@ -858,7 +858,7 @@
 .  \}\}
 .  el \{ .ie "\$1"OpenBSD" \{\
 .    ds doc-operating-system OpenBSD
-.    if \A\$2 \{\
+.    if \A'\$2' \{\
 .      ie d doc-operating-system-OpenBSD-\$2 \
 .        as doc-operating-system \~\*[doc-operating-system-OpenBSD-\$2]
 .      el \
@@ -866,7 +866,7 @@
 .  \}\}
 .  el \{ .ie "\$1"Darwin" \{\
 .    ds doc-operating-system Darwin
-.    if \A\$2 \{\
+.    if \A'\$2' \{\
 .      ie d doc-operating-system-Darwin-\$2 \
 .        as doc-operating-system \~\*[doc-operating-system-Darwin-\$2]
 .      el \
@@ -952,7 +952,7 @@
 .    rr doc-hs-len-prev
 .    as doc-header-string "\|.\|.\|.
 .  \}
-.  tl 
\*[doc-caption-font]\*[doc-header-string]\f[]\*[doc-caption-font2]\*[doc-volume]\f[]\*[doc-caption-font]\*[doc-header-string]\f[]
+.  tl 
'\*[doc-caption-font]\*[doc-header-string]\f[]'\*[doc-caption-font2]\*[doc-volume]\f[]'\*[doc-caption-font]\*[doc-header-string]\f[]'
 .  ie !\n[cR] \
 .    sp \n[doc-header-space]u
 .  el \{\
@@ -970,23 +970,23 @@
 .
 .eo
 .de doc-footer
-.    ev doc-caption-enviroment
-.    doc-setup-page-layout
-.    sp \n[doc-footer-space]u
-.    ie \n[D] \{\
-.      ie e \
-.        tl 
%\*[doc-caption-font2]\*[doc-date-string]\f[]\*[doc-caption-font]\*[doc-operating-system]\f[]
-.      el \
-.        tl 
\*[doc-caption-font]\*[doc-operating-system]\f[]\*[doc-caption-font2]\*[doc-date-string]\f[]%
-.    \}
-.    el \{\
-.      ie \n[cR] \
-.      tl 
\*[doc-caption-font]\*[doc-operating-system]\f[]\*[doc-caption-font2]\*[doc-date-string]\f[]\*[doc-header-string]
-.      el \
-.      tl 
\*[doc-caption-font]\*[doc-operating-system]\f[]\*[doc-caption-font2]\*[doc-date-string]\f[]%
-.    \}
-.    if !\n[cR] .bp
-.    ev
+.  ev doc-caption-enviroment
+.  doc-setup-page-layout
+.  sp \n[doc-footer-space]u
+.  ie \n[D] \{\
+.    ie e \
+.      tl 
'%'\*[doc-caption-font2]\*[doc-date-string]\f[]'\*[doc-caption-font]\*[doc-operating-system]\f[]'
+.    el \
+.      tl 
'\*[doc-caption-font]\*[doc-operating-system]\f[]'\*[doc-caption-font2]\*[doc-date-string]\f[]'%'
+.  \}
+.  el \{\
+.    ie \n[cR] \
+.      tl 
'\*[doc-caption-font]\*[doc-operating-system]\f[]'\*[doc-caption-font2]\*[doc-date-string]\f[]'\*[doc-header-string]'
+.    el \
+.      tl 
'\*[doc-caption-font]\*[doc-operating-system]\f[]'\*[doc-caption-font2]\*[doc-date-string]\f[]'%'
+.  \}
+.  if !\n[cR] .bp
+.  ev
 ..
 .ec
 .
diff --git a/tmac/mdoc/doc-ditroff b/tmac/mdoc/doc-ditroff
index c51ba030f..2c4d13c67 100644
--- a/tmac/mdoc/doc-ditroff
+++ b/tmac/mdoc/doc-ditroff
@@ -103,11 +103,11 @@
 .tr *\[**]
 .
 .\" miscellaneous
-.nr doc-subheader-indent (\w\f[C],u * 5u)
+.nr doc-subheader-indent (\w'\f[C],'u * 5u)
 .nr doc-paragraph-space .5v
 .
 .nr doc-digit-width \w'\0'u
-.nr doc-fixed-width \w\f[C]0
+.nr doc-fixed-width \w'\f[C]0'
 .
 .
 .\" NS doc-header-space global register
@@ -218,7 +218,7 @@
 .
 .eo
 .de doc-get-width
-.  nr doc-width \w\f[C]\$1
+.  nr doc-width \w'\f[C]\$1'
 .  ie (\n[doc-width] >= \n[doc-fixed-width]) \{\
 .    ie (\n[doc-width] % \n[doc-fixed-width]) \
 .      nr doc-width ((\n[doc-width] / \n[doc-fixed-width]) + 1)
@@ -244,7 +244,7 @@
 .
 .eo
 .de doc-get-arg-width
-.  nr doc-width \w\f[C]\*[doc-arg\$1]
+.  nr doc-width \w'\f[C]\*[doc-arg\$1]'
 .  ie (\n[doc-width] >= \n[doc-fixed-width]) \{\
 .    ie (\n[doc-width] % \n[doc-fixed-width]) \
 .      nr doc-width ((\n[doc-width] / \n[doc-fixed-width]) + 1)
diff --git a/tmac/mdoc/doc-nroff b/tmac/mdoc/doc-nroff
index 0136d67df..a9dc1456b 100644
--- a/tmac/mdoc/doc-nroff
+++ b/tmac/mdoc/doc-nroff
@@ -222,7 +222,7 @@
 .
 .eo
 .de doc-get-width
-.  nr doc-width \w\$1
+.  nr doc-width \w'\$1'
 .  ie (\n[doc-width] >= \n[doc-fixed-width]) \{\
 .    ie (\n[doc-width] % \n[doc-fixed-width]) \
 .      nr doc-width ((\n[doc-width] / \n[doc-fixed-width]) + 1)
@@ -244,7 +244,7 @@
 .
 .eo
 .de doc-get-arg-width
-.  nr doc-width \w\*[doc-arg\$1]
+.  nr doc-width \w'\*[doc-arg\$1]'
 .  ie (\n[doc-width] >= \n[doc-fixed-width]) \{\
 .    ie (\n[doc-width] % \n[doc-fixed-width]) \
 .      nr doc-width ((\n[doc-width] / \n[doc-fixed-width]) + 1)
diff --git a/tmac/mdoc/doc-syms b/tmac/mdoc/doc-syms
index 8c7d05ecd..f68673569 100644
--- a/tmac/mdoc/doc-syms
+++ b/tmac/mdoc/doc-syms
@@ -231,7 +231,7 @@
 .  if (\n[doc-arg-limit] > \n[doc-arg-ptr]) \{\
 .    nr doc-arg-ptr +1
 .    ie (\n[doc-type\n[doc-arg-ptr]] == 2) \{\
-.      ie \A\*[doc-arg\n[doc-arg-ptr]] \{\
+.      ie \A'\*[doc-arg\n[doc-arg-ptr]]' \{\
 .        ie d doc-str-At-\*[doc-arg\n[doc-arg-ptr]] \
 .          ds doc-str-At1 "\*[doc-str-At-\*[doc-arg\n[doc-arg-ptr]]]
 .        el \{\
@@ -296,7 +296,7 @@
 .  if (\n[doc-arg-limit] > \n[doc-arg-ptr]) \{\
 .    nr doc-arg-ptr +1
 .    ie (\n[doc-type\n[doc-arg-ptr]] == 2) \{\
-.      ie \A\*[doc-arg\n[doc-arg-ptr]] \{\
+.      ie \A'\*[doc-arg\n[doc-arg-ptr]]' \{\
 .        ie d doc-operating-system-DragonFly-\*[doc-arg\n[doc-arg-ptr]] \
 .          as doc-str-Dx1 
\~\*[doc-operating-system-DragonFly-\*[doc-arg\n[doc-arg-ptr]]]
 .        el \{\
@@ -361,7 +361,7 @@
 .  if (\n[doc-arg-limit] > \n[doc-arg-ptr]) \{\
 .    nr doc-arg-ptr +1
 .    ie (\n[doc-type\n[doc-arg-ptr]] == 2) \{\
-.      ie \A\*[doc-arg\n[doc-arg-ptr]] \{\
+.      ie \A'\*[doc-arg\n[doc-arg-ptr]]' \{\
 .        ie d doc-operating-system-FreeBSD-\*[doc-arg\n[doc-arg-ptr]] \
 .          as doc-str-Fx1 
\~\*[doc-operating-system-FreeBSD-\*[doc-arg\n[doc-arg-ptr]]]
 .        el \{\
@@ -427,7 +427,7 @@
 .  if (\n[doc-arg-limit] > \n[doc-arg-ptr]) \{\
 .    nr doc-arg-ptr +1
 .    ie (\n[doc-type\n[doc-arg-ptr]] == 2) \{\
-.      ie \A\*[doc-arg\n[doc-arg-ptr]] \{\
+.      ie \A'\*[doc-arg\n[doc-arg-ptr]]' \{\
 .        ie d doc-operating-system-NetBSD-\*[doc-arg\n[doc-arg-ptr]] \
 .          as doc-str-Nx1 
\~\*[doc-operating-system-NetBSD-\*[doc-arg\n[doc-arg-ptr]]]
 .        el \{\
@@ -731,7 +731,7 @@
 .    ds doc-str-St \f[\n[doc-curr-font]]
 .
 .    ds doc-str-St1
-.    ie \A\*[doc-arg\n[doc-arg-ptr]] \{\
+.    ie \A'\*[doc-arg\n[doc-arg-ptr]]' \{\
 .      ie d doc-str-St-\*[doc-arg\n[doc-arg-ptr]] \
 .        ds doc-str-St1 "\*[doc-str-St-\*[doc-arg\n[doc-arg-ptr]]]
 .      el \{\



reply via email to

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