Subject: Re: groff update?
To: Thomas Klausner <wiz@netbsd.org>
From: Christian Limpach <chris@pin.lu>
List: tech-userlevel
Date: 02/18/2003 01:41:05
Quoting Thomas Klausner <wiz@netbsd.org>:
> mdoc hackers to improve .Nm are welcome, I can supply more details
> or a test file.
not an mdoc hacker, but with the patch below, an empty first argument to
the .Nm macro gets replaced by the command-name. AFAICT this "fixes" the
compatibility issue.
--- tmac/doc.tmac.orig Fri Jul 5 16:37:21 2002
+++ tmac/doc.tmac
@@ -906,8 +906,16 @@
.de Nm
. if !\n[doc-arg-limit] \{\
. ds doc-macro-name Nm
-. ie \n[.$] \
+. ie \n[.$] \{\
. doc-parse-args \$@
+. nr doc-arg-ptr +1
+. if "\*[doc-arg\n[doc-arg-ptr]]"" \
+. ie "\*[doc-command-name]"" \
+. tm Usage: .Nm name ... (#\n[.c])
+. el \
+. ds doc-arg\n[doc-arg-ptr] \*[doc-command-name]
+. nr doc-arg-ptr -1
+. \}
. el \{\
. ie "\*[doc-command-name]"" \
. tm Usage: .Nm name ... (#\n[.c])
--
Christian Limpach <chris@pin.lu>