groff-commit
[Top][All Lists]
Advanced

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

[groff] 02/14: [man]: Warn on bad MT/ME/UR/UE nesting.


From: G. Branden Robinson
Subject: [groff] 02/14: [man]: Warn on bad MT/ME/UR/UE nesting.
Date: Mon, 29 Jan 2024 21:13:47 -0500 (EST)

gbranden pushed a commit to branch master
in repository groff.

commit 22441f426907ce6b354ec25b984c8e31a7b26bd8
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sun Jan 28 23:45:22 2024 -0600

    [man]: Warn on bad MT/ME/UR/UE nesting.
    
    * tmac/an.tmac (MT, ME, UR, UE): Throw warnings on bad nesting.
---
 ChangeLog    |  4 ++++
 tmac/an.tmac | 20 ++++++++++++++++++--
 2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index cfaac71cc..5a1f64de6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2024-01-28  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       * tmac/an.tmac (MT, ME, UR, UE): Throw warnings on bad nesting.
+
 2024-01-28  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        * tmac/an.tmac (an*begin-hyperlink): Repair damage I introduced
diff --git a/tmac/an.tmac b/tmac/an.tmac
index 3fb4ff0ba..6b86fd632 100644
--- a/tmac/an.tmac
+++ b/tmac/an.tmac
@@ -1193,8 +1193,12 @@ contains unsupported escape sequence
 .\" a diversion; it becomes the link text for the hyperlinked address.
 .\" .MT nobody@example.com
 .de1 MT
+.  if d an*prefix \{\
+.    an-warn cannot nest .\\$0 inside .MT or .UR
+.    return
+.  \}
 .  if !(\\n[.$] = 1) \
-.    an-style-warn .\\$0 expects 1 argument, got \\n[.$]
+.    an-warn .\\$0 expects 1 argument, got \\n[.$]
 .  ds an*prefix mailto:
 .  an*begin-hyperlink \\$1
 ..
@@ -1203,6 +1207,10 @@ contains unsupported escape sequence
 .\" punctuation (or, rarely, other text) after link text.
 .\" .ME [trailing-text]
 .de1 ME
+.  if !d an*prefix \{\
+.    an-warn .\\$0 requires a preceding .MT
+.    return
+.  \}
 .  an*end-hyperlink \\$1
 .  rm an*prefix
 ..
@@ -1211,8 +1219,12 @@ contains unsupported escape sequence
 .\" a diversion; it becomes the link text for the hyperlinked address.
 .\" .UR nobody@example.com
 .de1 UR
+.  if d an*prefix \{\
+.    an-warn cannot nest .\\$0 inside .MT or .UR
+.    return
+.  \}
 .  if !(\\n[.$] = 1) \
-.    an-style-warn .\\$0 expects 1 argument, got \\n[.$]
+.    an-warn .\\$0 expects 1 argument, got \\n[.$]
 .  ds an*prefix \" empty
 .  an*begin-hyperlink \\$1
 ..
@@ -1221,6 +1233,10 @@ contains unsupported escape sequence
 .\" punctuation (or, rarely, other text) after link text.
 .\" .UE [trailing-text]
 .de1 UE
+.  if !d an*prefix \{\
+.    an-warn .\\$0 requires a preceding .UR
+.    return
+.  \}
 .  an*end-hyperlink \\$1
 .  rm an*prefix
 ..



reply via email to

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