DragonFly BSD
DragonFly submit List (threaded) for 2004-02
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Dx macro for groff


From: Aaron Malone <aaron@xxxxxxxxx>
Date: Mon, 16 Feb 2004 13:11:10 -0600

Per Matt's recommendation on the docs list, here is a patch to restore
the .Fx macro to "FreeBSD", and add a .Dx macro for "DragonFly".  (Just
changing the .Fx macro to dfly breaks 'history' sections.)  I'll be
going through the man pages to find obvious places where we need to
change .Fx to .Dx now.

-- 
Aaron Malone
aaron@xxxxxxxxx
Index: gnu/usr.bin/groff/tmac/doc-common
===================================================================
RCS file: /home/dcvs/src/gnu/usr.bin/groff/tmac/doc-common,v
retrieving revision 1.1
diff -u -b -B -r1.1 doc-common
--- gnu/usr.bin/groff/tmac/doc-common	3 Feb 2004 08:37:33 -0000	1.1
+++ gnu/usr.bin/groff/tmac/doc-common	16 Feb 2004 19:03:26 -0000
@@ -80,6 +80,7 @@
 .nr Dq 12n
 .nr Ds 6n\" many manpages still use this as a -width value
 .nr Dv 12n
+.nr Dx 1
 .nr Ec 3
 .nr Ef 8n\" ?
 .nr Ek 8n\" ?
@@ -453,6 +454,14 @@
 .      el \
 .        tm mdoc warning: .Os: Unknown BSD version `\$2' (#\n[.c])
 .  \}\}
+.  el \{ .ie "\$1"FreeBSD" \{\
+.    ds doc-operating-system FreeBSD
+.    if \A\$2 \{\
+.      ie d doc-operating-system-FreeBSD-\$2 \
+.        as doc-operating-system \~\*[doc-operating-system-FreeBSD-\$2]
+.      el \
+.        tm mdoc warning: .Os: Unknown FreeBSD version `\$2' (#\n[.c])
+.  \}\}
 .  el \{ .ie "\$1"DragonFly" \{\
 .    ds doc-operating-system DragonFly
 .    if \A\$2 \{\
Index: gnu/usr.bin/groff/tmac/doc-syms
===================================================================
RCS file: /home/dcvs/src/gnu/usr.bin/groff/tmac/doc-syms,v
retrieving revision 1.1
diff -u -b -B -r1.1 doc-syms
--- gnu/usr.bin/groff/tmac/doc-syms	3 Feb 2004 08:37:33 -0000	1.1
+++ gnu/usr.bin/groff/tmac/doc-syms	16 Feb 2004 19:03:26 -0000
@@ -262,7 +262,7 @@
 .
 .
 .\" NS Fx user macro
-.\" NS   print DragonFly
+.\" NS   print FreeBSD
 .\" NS
 .\" NS modifies:
 .\" NS   doc-arg-ptr
@@ -284,7 +284,7 @@
 .  ds doc-str-Fx \f[\n[doc-curr-font]]\s[\n[doc-curr-size]u]
 .
 .  \" default value if no argument
-.  ds doc-str-Fx1 \*[doc-Tn-font-size]\%DragonFly\*[doc-str-Fx]
+.  ds doc-str-Fx1 \*[doc-Tn-font-size]\%FreeBSD\*[doc-str-Fx]
 .
 .  if !\n[doc-arg-limit] \
 .    if \n[.$] \{\
@@ -296,10 +296,10 @@
 .    nr doc-arg-ptr +1
 .    ie (\n[doc-type\n[doc-arg-ptr]] == 2) \{\
 .      ie \A\*[doc-arg\n[doc-arg-ptr]] \{\
-.        ie d doc-operating-system-DragonFly-\*[doc-arg\n[doc-arg-ptr]] \
-.          as doc-str-Fx1 \~\*[doc-operating-system-DragonFly-\*[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 \{\
-.          tmc mdoc warning: .Fx: Unknown DragonFly version
+.          tmc mdoc warning: .Fx: Unknown FreeBSD version
 .          tm1 " `\*[doc-arg\n[doc-arg-ptr]]' (#\n[.c])
 .          as doc-str-Fx1 \~\*[doc-arg\n[doc-arg-ptr]]
 .      \}\}
@@ -325,6 +325,70 @@
 ..
 .
 .
+.\" NS Dx user macro
+.\" NS   print DragonFly
+.\" NS
+.\" NS modifies:
+.\" NS   doc-arg-ptr
+.\" NS   doc-curr-font
+.\" NS   doc-curr-size
+.\" NS   doc-macro-name
+.\" NS
+.\" NS local variable:
+.\" NS   doc-str-Dx
+.\" NS   doc-str-Dx1
+.\" NS
+.\" NS width register `Dx' defined in doc-common
+.
+.\" we use the doc-operating-system-DragonFly-* strings defined in doc-common
+.
+.de Dx
+.  nr doc-curr-font \n[.f]
+.  nr doc-curr-size \n[.ps]
+.  ds doc-str-Dx \f[\n[doc-curr-font]]\s[\n[doc-curr-size]u]
+.
+.  \" default value if no argument
+.  ds doc-str-Dx1 \*[doc-Tn-font-size]\%DragonFly\*[doc-str-Dx]
+.
+.  if !\n[doc-arg-limit] \
+.    if \n[.$] \{\
+.      ds doc-macro-name Dx
+.      doc-parse-args \$@
+.    \}
+.
+.  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 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 \{\
+.          tmc mdoc warning: .Dx: Unknown DragonFly version
+.          tm1 " `\*[doc-arg\n[doc-arg-ptr]]' (#\n[.c])
+.          as doc-str-Dx1 \~\*[doc-arg\n[doc-arg-ptr]]
+.      \}\}
+.      el \
+.        as doc-str-Dx1 \~\*[doc-arg\n[doc-arg-ptr]]
+.    \}
+.    el \
+.      nr doc-arg-ptr -1
+.  \}
+.
+.  \" replace current argument with result
+.  ds doc-arg\n[doc-arg-ptr] "\*[doc-str-Dx1]
+.  nr doc-type\n[doc-arg-ptr] 2
+.  ds doc-space\n[doc-arg-ptr] "\*[doc-space]
+.
+.  \" recompute space vector for remaining arguments
+.  nr doc-num-args (\n[doc-arg-limit] - \n[doc-arg-ptr])
+.  nr doc-arg-limit \n[doc-arg-ptr]
+.  if \n[doc-num-args] \
+.    doc-parse-space-vector
+.
+.  doc-print-recursive
+..
+.
+.
 .\" NS Nx user macro
 .\" NS   print NetBSD
 .\" NS


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