groff
[Top][All Lists]
Advanced

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

Re: [Groff] troff syntax and useability


From: Werner LEMBERG
Subject: Re: [Groff] troff syntax and useability
Date: Tue, 27 Aug 2002 19:08:37 +0200 (CEST)

> troff syntax is horribly terse. The macros are better, but not that much 
> better, IMHO.

Try the mom macro package.

> Debugging is hellish.

Add -mtrace on groff's command line before the macro package you want
to debug.  I've attached the latest version which does some nice
indentation to show the nesting level.  This will work with groff 1.18
only.


    Werner
.\" trace.tmac
.\"
.\" Load this before a macro package that you want to trace.
.
.nr _C \n(.C
.cp 0
.
.do ds !!sp " \"
.
.eo
.
.rn de !!de
.
.
.!!de de
.  do ecs
.  ec
.  do !!de \$1
.    ie "\$1"\\$0" .do tm1 "\\*[!!sp]*** de trace enter: \\$0 \\$@
.    el .do tm1 "\*[!!sp]*** trace enter \$1: \\$0 \\$@
.    do as !!sp " \"
.    do nop \\*[!!\$1]\\
.    do substring !!sp 1
.    ie "\$1"\\$0" .do tm1 "\\*[!!sp]*** trace exit: \\$0 \\$@
.    el .do tm1 "\*[!!sp]*** trace exit \$1: \\$0 \\$@
\..
.
.  do ds !!d1 !!\$1
.  do ds !!d2 \$2
.
.  do ecr
.  do dei !!d1 !!d2
..
.
.rn am !!am
.
.!!am am
.  do ecs
.  ec
.  do !!am \$1
.    ie "\$1"\\$0" .do tm1 "\\*[!!sp]*** am trace enter: \\$0 \\$@
.    el .do tm1 "\*[!!sp]*** am trace enter \$1: \\$0 \\$@
.    as !!sp " \"
.    do nop \\*[!!\$1]\\
.    substring !!sp 1
.    ie "\$1"\\$0" .do tm1 "\\*[!!sp]*** trace exit: \\$0 \\$@
.    el .do tm1 "\*[!!sp]*** trace exit \$1: \\$0 \\$@
\..
.
.  do ds !!a1 !!\$1
.  do ds !!a2 \$2
.
.  do ecr
.  do ami !!a1 !!a2
..
.
.ec
.
.cp \n(_C
.
.\" EOF

reply via email to

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