summaryrefslogtreecommitdiff
path: root/tmac/an-old.tmac
diff options
context:
space:
mode:
authorwlemb <wlemb>2001-05-06 23:29:20 +0000
committerwlemb <wlemb>2001-05-06 23:29:20 +0000
commit2cb0df330838a0f76209415679eae40517857968 (patch)
tree51957b3659d56e6b5868cb2ac44edc20155d54ff /tmac/an-old.tmac
parent3fcb4709050e965ef5b6c9b9df63909f6192fc25 (diff)
downloadgroff-2cb0df330838a0f76209415679eae40517857968.tar.gz
Added two new requests `de1' and `am1' which are similar to `de' and
`am' with the difference that compatibility mode is saved on entry, switched off during macro execution, and restored on exit. * src/roff/troff/input.h: Added two new special characters (COMPATIBLE_SAVE, COMPATIBLE_RESTORE). * src/roff/troff/input.cc (input_iterator): Added two member functions `save_compatible_flag' and `get_compatible_flag'. (input_stack): Ditto. (string_iterator): Ditto. Also add private member `saved_compatible_flag'. (token::next): Use COMPATIBLE_SAVE and COMPATIBLE_RESTORE. (calling_mode): New enumeration. (do_define_macro): Use it. Insert COMPATIBLE_SAVE and COMPATIBLE_RESTORE at the beginning and end of macro, respectively. (define_macro, define_indirect_macro, append_macro, ignore): Use `calling_mode'. (define_nocomp_macro, append_nocomp_macro): New functions. (init_input_requests): Updated. (do_request): Rename local variable `saved_compatible_flag' to `old_compatible_flag'. * NEWS, src/roff/troff/troff.man, man/groff.man: Document it. * tmac/an-old.tmac: Use `de1' instead of `de' request for all public and trap-invoked macros. As a consequence, the man macros work in compatibility mode also. * Makefile.in: Use $(mandir).
Diffstat (limited to 'tmac/an-old.tmac')
-rw-r--r--tmac/an-old.tmac54
1 files changed, 26 insertions, 28 deletions
diff --git a/tmac/an-old.tmac b/tmac/an-old.tmac
index caa1fa4e..75c1ff16 100644
--- a/tmac/an-old.tmac
+++ b/tmac/an-old.tmac
@@ -62,9 +62,7 @@
..
.
.\" .TH title section extra1 extra2 extra3
-.de TH
-. cp 0
-.
+.de1 TH
. if \\n[an-html] \{\
. HTML-TAG ".tl"
\\$1
@@ -135,16 +133,16 @@
. \}
..
.
-.de DT
+.de1 DT
. ta T .5i \" This sets tabs every .5 inches
..
.
-.de PD
+.de1 PD
. ie \\n[.$] .nr PD (v;\\$1)
. el .nr PD (.4v >? \n[.V])
..
.
-.de an-header
+.de1 an-header
. an-init
. ev 1
. ps \\n[PS]u
@@ -164,13 +162,13 @@
. ns
..
.
-.de an-footer
+.de1 an-footer
' bp
..
.
.af an-page-letter a
.
-.de an-p-footer
+.de1 an-p-footer
. ev 1
. ps \\n[PS]u
. vs \\n[VS]u
@@ -202,7 +200,7 @@
. ev
..
.
-.de an-end
+.de1 an-end
. nr % 1
. pl +3v
. fl
@@ -213,7 +211,7 @@
.
.if \n[cR] .em an-end
.
-.de SH
+.de1 SH
. sp \\n[PD]u
. nr an-level 1
. set-an-margin
@@ -231,7 +229,7 @@
. if \\n[.$] \&\\$*
..
.
-.de SS
+.de1 SS
. sp \\n[PD]u
. nr an-level 1
. set-an-margin
@@ -248,32 +246,32 @@
. if \\n[.$] \&\\$*
..
.
-.de B
+.de1 B
. it 1 an-trap
. ft B
. if \\n[.$] \&\\$*
..
.
-.de I
+.de1 I
. it 1 an-trap
. ft I
. if \\n[.$] \&\\$*
..
.
-.de SM
+.de1 SM
. it 1 an-trap
. ps -1
. if \\n[.$] \&\\$*
..
.
-.de SB
+.de1 SB
. it 1 an-trap
. ps -1
. ft B
. if \\n[.$] \&\\$*
..
.
-.de TP
+.de1 TP
. sp \\n[PD]u
. if \\n[.$] .nr an-prevailing-indent (n;\\$1)
. it 1 an-trap
@@ -286,7 +284,7 @@
. nr an-div? 1
..
.
-.de an-trap
+.de1 an-trap
. ft R
. ps \\n[PS]u
. vs \\n[VS]u
@@ -322,7 +320,7 @@
. \}
..
.
-.de LP
+.de1 LP
. br
. sp \\n[PD]u
. ps \\n[PS]u
@@ -335,7 +333,7 @@
.als PP LP
.als P LP
.
-.de IP
+.de1 IP
. ie !\\n[.$] \{\
. ps \\n[PS]u
. vs \\n[VS]u
@@ -351,7 +349,7 @@
. \}
..
.
-.de HP
+.de1 HP
. ps \\n[PS]u
. vs \\n[VS]u
. ft R
@@ -364,7 +362,7 @@
.
.ds an-empty \" this is referenced to avoid looping on eg .RB ( \\ )
.
-.de RI
+.de1 RI
. if \\n[.$] \{\
. ds an-result \&\\$1
. shift
@@ -377,7 +375,7 @@
. \}
..
.
-.de IR
+.de1 IR
. if \\n[.$] \{\
. ds an-result \&\f[I]\\$1\f[R]
. shift
@@ -390,7 +388,7 @@
. \}
..
.
-.de IB
+.de1 IB
. if \\n[.$] \{\
. ds an-result \&\f[I]\\$1
. shift
@@ -404,7 +402,7 @@
. \}
..
.
-.de BI
+.de1 BI
. if \\n[.$] \{\
. ds an-result \&\f[B]\\$1
. shift
@@ -418,7 +416,7 @@
. \}
..
.
-.de RB
+.de1 RB
. ds an-result \&
. while (\\n[.$] >= 2) \{\
. as an-result \f[R]\\$1\f[B]\\$2\\*[an-empty]
@@ -429,7 +427,7 @@
. ft R
..
.
-.de BR
+.de1 BR
. ds an-result \&
. while (\\n[.$] >= 2) \{\
. as an-result \f[B]\\$1\f[R]\\$2\\*[an-empty]
@@ -440,7 +438,7 @@
. ft R
..
.
-.de RS
+.de1 RS
. br
. nr an-saved-margin\\n[an-level] \\n[an-margin]
. nr an-saved-prevailing-indent\\n[an-level] \\n[an-prevailing-indent]
@@ -451,7 +449,7 @@
. nr an-level +1
..
.
-.de RE
+.de1 RE
. br
. ie \\n[.$] .nr an-level ((;\\$1) <? \\n[an-level])
. el .nr an-level -1