groff-commit
[Top][All Lists]
Advanced

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

[groff] 13/14: [mdoc]: Improve support for `Mt` macro.


From: G. Branden Robinson
Subject: [groff] 13/14: [mdoc]: Improve support for `Mt` macro.
Date: Sun, 28 Jan 2024 19:55:05 -0500 (EST)

gbranden pushed a commit to branch master
in repository groff.

commit 736100ba3473df7e89ad50b58bbaebec618f0219
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sun Jan 28 17:03:46 2024 -0600

    [mdoc]: Improve support for `Mt` macro.
    
    * tmac/doc.tmac (Mt): Give macro a real implementation instead of
      wrapping `Pa`.  Among other benefits, this means that it recognizes a
      `doc-Mt-font` string for styling of the argument, instead of using the
      styling applied to `Pa`.
    
    * tmac/mdoc/doc-ditroff (doc-Mt-font):
    * tmac/mdoc/doc-nroff (doc-Mt-font): Define new strings.  Set email
      addresses in italics by default.
    
    * NEWS: Report change in font styling.
---
 ChangeLog             | 13 +++++++++++++
 NEWS                  |  5 +++++
 tmac/doc.tmac         | 27 ++++++++++++++++++++++++++-
 tmac/mdoc/doc-ditroff |  1 +
 tmac/mdoc/doc-nroff   |  1 +
 5 files changed, 46 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 8ebc8ac0a..5adedaf3d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2024-01-28  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       * tmac/doc.tmac (Mt): Give macro a real implementation instead
+       of wrapping `Pa`.  Among other benefits, this means that it
+       recognizes a `doc-Mt-font` string for styling of the argument,
+       instead of using the styling applied to `Pa`.
+
+       * tmac/mdoc/doc-ditroff (doc-Mt-font):
+       * tmac/mdoc/doc-nroff (doc-Mt-font): Define new strings.  Set
+       email addresses in italics by default.
+
+       * NEWS: Report change in font styling.
+
 2024-01-28  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        * tmac/an.tmac:
diff --git a/NEWS b/NEWS
index 70bb5408e..d6283af70 100644
--- a/NEWS
+++ b/NEWS
@@ -143,6 +143,11 @@ o The an (man) and doc (mdoc) macro packages now use 
slightly different
   rendering disabled (by default, it is enabled), the page footer now
   sets 1 line higher than before.
 
+o The doc (mdoc) macro package's `Mt` macro now sets its argument in
+  roman, not italics (or whatever the string `doc-Pa-font` was
+  configured to use).  A new string, `doc-Mt-font`, for use in
+  "mdoc.local" files and similar, supports configuration of this face.
+
 o The new macro file "koi8-r.tmac" supports the KOI8-R character
   encoding, which supports the new Russian locale for groff.
 
diff --git a/tmac/doc.tmac b/tmac/doc.tmac
index 4c500ff4f..e36a587ea 100644
--- a/tmac/doc.tmac
+++ b/tmac/doc.tmac
@@ -6808,6 +6808,15 @@
 .
 .\" NS Mt user macro
 .\" NS   mailto (for conversion to HTML)
+.\" NS
+.\" NS modifies:
+.\" NS   doc-arg-ptr
+.\" NS   doc-curr-font
+.\" NS   doc-macro-name
+.\" NS
+.\" NS local variables:
+.\" NS   doc-lasttext-Mt
+.\" NS   doc-target-Mt
 .
 .eo
 .de Mt
@@ -6829,7 +6838,23 @@
 .    return
 .  \}
 .
-.  Pa \$@
+.  \" The argument is the email address.
+.  nr doc-arg-ptr +1
+.  ds doc-target-Mt "\*[doc-arg\n[doc-arg-ptr]]
+.  nr doc-arg-ptr +1
+.
+.  \" Format the link target.
+.  nr doc-curr-font \n[.f]
+.  nop \*[doc-Mt-font]\*[doc-target-Mt]\c
+.  nop \f[\n[doc-curr-font]]\c
+.
+.  \" Format trailing arguments, like punctuation, if any.
+.  ie (\n[doc-arg-ptr] <= \n[doc-arg-count]) \
+.    doc-print-recursive
+.  el \{\
+.    nop \&
+.    doc-reset-args
+.  \}
 ..
 .ec
 .
diff --git a/tmac/mdoc/doc-ditroff b/tmac/mdoc/doc-ditroff
index bca5754be..30297fc53 100644
--- a/tmac/mdoc/doc-ditroff
+++ b/tmac/mdoc/doc-ditroff
@@ -68,6 +68,7 @@
 .ds doc-Li-font \f[CR]
 .ds doc-Lk-font \f[R]\"
 .ds doc-Me-font \f[B]
+.ds doc-Mt-font \f[R]
 .ds doc-Nm-font \f[CB]
 .ds doc-No-font \f[R]
 .ds doc-Pa-font \f[I]
diff --git a/tmac/mdoc/doc-nroff b/tmac/mdoc/doc-nroff
index c0562f669..2e0872225 100644
--- a/tmac/mdoc/doc-nroff
+++ b/tmac/mdoc/doc-nroff
@@ -60,6 +60,7 @@
 .ds doc-Li-font \f[B]
 .ds doc-Lk-font \f[R]\"
 .ds doc-Me-font \f[B]
+.ds doc-Mt-font \f[R]
 .ds doc-Nm-font \f[B]
 .ds doc-No-font \f[R]
 .ds doc-Pa-font \f[I]



reply via email to

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