blob: 292e88b9438dedf0095898f8073425d783faa025 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
$NetBSD: patch-ae,v 1.1 2003/07/01 10:12:55 wiz Exp $
--- tmac/troffrc.orig Tue Apr 8 19:26:42 2003
+++ tmac/troffrc
@@ -43,4 +43,59 @@ troffrc!X100 troffrc!X100-12 troffrc!lj4
.\" Handle paper formats
.do mso papersize.tmac
.
+.if n \{\
+. nr _C \n(.C
+. cp 0
+.
+. \" The following code sets a top-of-page trap to disable grotty's TTY
+. \" mode. Since neither \X nor .output can be used before the first
+. \" page has started, we must use a trap. To make it work with troff's
+. \" -o option, we wait until the first printed page.
+.
+. de sgr@dummy
+. .
+.
+. rn wh wh@old
+.
+. \" The stand-alone version. If no other trap is set, we can safely
+. \" insert the truncated vertical space caused by the trap (if any).
+. \" Otherwise we assume that the document's main macro package takes
+. \" care of that. As soon as the trap has been executed, it is removed.
+. de1 no@sgr
+. if \\n[.P] \{\
+. if (\\n[.t] == \\n[.p]) \{\
+. rn wh@old wh
+. rm no@sgr
+. wh 0
+. sp \\n[.trunc]
+. nop \X'tty: sgr 0'
+. sp -1
+. \}\}
+. .
+.
+. wh@old 0 no@sgr
+.
+. \" The piggyback version to be appended to macros planted with the
+. \" modified `wh' request.
+. de1 no@sgr1
+. if \\n[.P] \{\
+. rn wh@old wh
+. ds no@sgr1
+. nop \X'tty: sgr 0'
+. sp -1
+. \}
+. .
+.
+. \" We redefine the `wh' request so that `no@sgr1' is appended to
+. \" the trap macro.
+. de1 wh
+. am1 \\$2 sgr@dummy
+. no@sgr1
+. sgr@dummy
+. wh@old \\$1 \\$2
+. .
+.
+. cp \n[_C]
+.\}
+.
.\" Don't let blank lines creep in here.
|