summaryrefslogtreecommitdiff
path: root/tmac/trace.tmac
diff options
context:
space:
mode:
Diffstat (limited to 'tmac/trace.tmac')
-rw-r--r--tmac/trace.tmac29
1 files changed, 29 insertions, 0 deletions
diff --git a/tmac/trace.tmac b/tmac/trace.tmac
new file mode 100644
index 00000000..143f9540
--- /dev/null
+++ b/tmac/trace.tmac
@@ -0,0 +1,29 @@
+.\" trace.tmac
+.\"
+.\" Load this before a macro package that you want to trace.
+.
+.eo
+.
+.rn de !!de
+.
+.!!de de
+. ecs
+. ec
+. !!de \$1
+. ie "\$1"\\$0" .tm *** trace enter: \\$0 \\$@
+. el .tm *** trace enter \$1: \\$0 \\$@
+. nop \\*[!!\$1]\\
+. ie "\$1"\\$0" .tm *** trace exit: \\$0 \\$@
+. el .tm *** trace exit \$1: \\$0 \\$@
+\..
+.
+. ds !!d1 !!\$1
+. ds !!d2 \$2
+.
+. ecr
+. dei !!d1 !!d2
+..
+.
+.ec
+.
+.\" EOF