bug-groff
[Top][All Lists]
Advanced

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

[bug #61954] [man] customizable `PT` and `BT` macros are not flexible en


From: G. Branden Robinson
Subject: [bug #61954] [man] customizable `PT` and `BT` macros are not flexible enough
Date: Sat, 5 Mar 2022 14:27:11 -0500 (EST)

Update of bug #61954 (project groff):

                  Status:               Need Info => In Progress            

    _______________________________________________________

Follow-up Comment #4:

I found a much, much simpler way to deal with this.

All I had to give up was a little paranoia.  In practice, mdoc(7) is not going
to redefine `PT` or `BT`--they are outside its name space, and in any case we
can be _darned_ sure _groff_ mdoc won't do such a thing.

That leaves the threat of man/mdoc documents themselves stomping on these
macro names, but we were already helpless in the face of that.


diff --git a/tmac/an.tmac b/tmac/an.tmac
index 914629994..f14b3c7fc 100644
--- a/tmac/an.tmac
+++ b/tmac/an.tmac
@@ -25,8 +25,8 @@
 .\" <http://www.gnu.org/licenses/>.
 .
 .
-.\" Put local additions in the file man.local, loaded near the end of
-.\" this file.  If you need to add things to TH, use '.am1 TH'.
+.\" Put site additions in the file man.local, loaded near the end of
+.\" this file.  To add things to TH, use '.am1 TH'.
 .
 .if !\n(.g \
 .  ab groff man macros require groff extensions; aborting
@@ -378,6 +378,7 @@
 .\"
 .\" In continuous rendering mode, we need to extend the page length to
 .\" accommodate the vertical size of our header (plus any spacing).
+.if d PT .ig
 .de1 PT
 .  ie \\n[cR] .pl +1v
 .  el         .sp .5i
@@ -397,6 +398,7 @@
 .\"
 .\" In continuous rendering mode, we need to extend the page length to
 .\" accommodate the vertical size of our footer (plus any spacing).
+.if d BT .ig
 .de1 BT
 .  if \\n[cR] .pl +1v
 .  ie \\n[D] \{\
@@ -1111,8 +1113,8 @@
 .\" Load man macro extensions.
 .mso an-ext.tmac
 .
-.\" Load local modifications.
-.mso man.local
+.\" Load site modifications.
+.msoquiet man.local
 .
 .\" Set each rendering parameter only if its -[dr] option or man.local
 .\" did not.


So check this out.  Here's the input file.


$ cat EXPERIMENTS/not-a-man-page.man 
.\" an example for Alejandro Colomar
.ds PT \" empty
.ds BT \" empty
.TH junk 1
.SH Prologue
Snow,
tenderly caught by eddying breezes,
swirled and spun in to and out of bright,
lustrous shapes that gleamed against the emerald-blazoned black drape of
sky and sparkled there for a moment,
hanging,
before settling gently to the soft,
green-tufted plain with all the sickly sweetness of an overwritten
sentence.
.SH "Chapter 1"
Cheryl's mind turned like the vanes of a wind-powered turbine,
chopping
her sparrow-like thoughts into bloody pieces that fell onto a growing
pile of forgotten memories.
.SS "Some Unexpected Visitors"
As the sun dropped below the horizon,
the safari guide confirmed the approaching cape buffaloes were
herbivores,
which calmed everyone in the group,
except for Herb,
of course.


I'm attaching screenshots of the foregoing working just fine with -man and
-mandoc.  You can even render a real man page afterwards; all that's missing
are the headers and footers, as intended.

(file #52959, file #52960)
    _______________________________________________________

Additional Item Attachment:

File name: man-fixed-trap-redefs-1.png    Size:115 KB
   
<https://file.savannah.gnu.org/file/man-fixed-trap-redefs-1.png?file_id=52959>

File name: man-fixed-trap-redefs-2.png    Size:115 KB
   
<https://file.savannah.gnu.org/file/man-fixed-trap-redefs-2.png?file_id=52960>



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?61954>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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