groff
[Top][All Lists]
Advanced

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

[Groff] using macros when changing .cc and .ec


From: Ian! D. Allen [NCFreeNet]
Subject: [Groff] using macros when changing .cc and .ec
Date: Wed, 11 Dec 2002 18:42:20 -0500

(New subscriber - I only read the back few months of postings; if this
question below is in a FAQ somewhere, please point me to it!)

How can one write a macro package whose page trap macros still work
when the user redefines .cc and/or .ec for some text?

I did my Masters thesis at UofWaterloo in 1985, and as part of my
thesis-avoidance behaviour I reworked the -ms macros and added some
features and warnings to the "ditroff" (device-independent troff) source.
Something we had (perhaps ditroff had it; perhaps we added it) was
the escape "\.", which was an un-redefinable version of the control
character (usually ".") that always worked no matter what the current
control character was.  If you defined a macro using "\." inside, you
could redefine the control character and call the macro and it would
still work.  I reworked my version of the -ms macros to use this for
all the page-trap macros, so one could redefine the control character
and everything still worked just fine even across page boundaries.
(Usually the page trap macro saved the current control character and then
switched to using the default dot.  When the trap was done, I restored
the control character to the saved version.)

I looked into the groff -ms macros and am sad to see that they just
don't work across page traps unless the control character is a dot.
I presume groff/troff doesn't have a "permanent" control character
feature, nor any way of saving the current control character?
("man 7 groff" is silent on the issue.)

Has anyone looked into the issue of making trap macros that "always" work?

-- 
-IAN!  Ian! D. Allen   Ottawa, Ontario, Canada   address@hidden
       Home Page on the Ottawa FreeNet: http://www.ncf.ca/~aa610/
       College professor via: http://www.idallen.com/teaching/
       Board Member, TeleCommunities CANADA  http://www.tc.ca/

reply via email to

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