Mercurial > emacs
annotate etc/ps-prin0.ps @ 34373:93a6ef17b7f3
(texinfo-chapter-level-regexp)
(texinfo-filter): Removed (moved to texinfo.el).
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Fri, 08 Dec 2000 16:35:04 +0000 |
parents | cdd489417ae4 |
children | b5a4db21c424 |
rev | line source |
---|---|
28155 | 1 % === BEGIN ps-print prologue 0 |
31252
cdd489417ae4
Changed comment version (6.0).
Gerd Moellmann <gerd@gnu.org>
parents:
29497
diff
changeset
|
2 % version: 6.0 |
28155 | 3 |
4 %%BeginProcSet: ErrorHandler | |
5 % Downloaded Error Break-page handler | |
6 % Adapted from: | |
7 % PostScript Language Program Design, | |
8 % Adobe Systems Incorporated. | |
9 % Appendix A, pages 217-219 | |
10 | |
11 /ps$brkpage where{pop} | |
12 { | |
13 /ps$brkpage 64 dict def | |
14 ps$brkpage begin | |
29497
0763a6ed0743
Insert a version number comment (5.2.2). Indentation fix.
Gerd Moellmann <gerd@gnu.org>
parents:
28764
diff
changeset
|
15 /tx 0 def/ty 0 def/toy 0 def/tox 0 def |
28155 | 16 /prnt{ |
29497
0763a6ed0743
Insert a version number comment (5.2.2). Indentation fix.
Gerd Moellmann <gerd@gnu.org>
parents:
28764
diff
changeset
|
17 dup type/stringtype ne{=string cvs}if |
28155 | 18 dup length 6 mul |
29497
0763a6ed0743
Insert a version number comment (5.2.2). Indentation fix.
Gerd Moellmann <gerd@gnu.org>
parents:
28764
diff
changeset
|
19 /tx exch def/ty 10 def |
0763a6ed0743
Insert a version number comment (5.2.2). Indentation fix.
Gerd Moellmann <gerd@gnu.org>
parents:
28764
diff
changeset
|
20 currentpoint/toy exch def/tox exch def |
28155 | 21 1 setgray newpath |
22 tox toy 2 sub moveto | |
23 0 ty rlineto tx 0 rlineto | |
24 0 ty neg rlineto | |
25 closepath fill | |
26 tox toy moveto 0 setgray show | |
27 }bind def | |
28 /nl{currentpoint exch pop lmargin exch moveto 0 -10 rmoveto}def | |
29 /=={/cp 0 def typeprint nl}def | |
30 /typeprint{dup type dup currentdict exch known{exec}{unknowntype}ifelse}readonly def | |
31 /lmargin 72 def | |
32 /rmargin 72 def | |
33 /tprint{ | |
29497
0763a6ed0743
Insert a version number comment (5.2.2). Indentation fix.
Gerd Moellmann <gerd@gnu.org>
parents:
28764
diff
changeset
|
34 dup length cp add rmargin gt{nl/cp 0 def}if |
0763a6ed0743
Insert a version number comment (5.2.2). Indentation fix.
Gerd Moellmann <gerd@gnu.org>
parents:
28764
diff
changeset
|
35 dup length cp add/cp exch def |
28155 | 36 prnt |
37 }readonly def | |
38 /cvsprint{=string cvs tprint( )tprint}readonly def | |
39 /unknowntype{exch pop cvlit(??)tprint cvsprint}readonly def | |
40 /integertype{cvsprint}readonly def | |
41 /realtype{cvsprint}readonly def | |
42 /booleantype{cvsprint}readonly def | |
43 /operatortype{(//)tprint cvsprint}readonly def | |
44 /marktype{pop(-mark-)tprint}readonly def | |
45 /dicttype{pop(-dictionary-)tprint}readonly def | |
46 /nulltype{pop(-null-)tprint}readonly def | |
47 /filetype{pop(-filestream-)tprint}readonly def | |
48 /savetype{pop(-savelevel-)tprint}readonly def | |
49 /fonttype{pop(-fontid-)tprint}readonly def | |
50 /nametype{dup xcheck not{(/)tprint}if cvsprint}readonly def | |
51 /stringtype{ | |
52 dup rcheck | |
53 {(\()tprint tprint(\))tprint} | |
54 {pop(-string-)tprint}ifelse}readonly def | |
55 /arraytype{ | |
56 dup rcheck | |
57 {dup xcheck | |
58 {({)tprint{typeprint}forall(})tprint} | |
59 {([)tprint{typeprint}forall(])tprint}ifelse} | |
60 {pop(-array-)tprint}ifelse}readonly def | |
61 /packedarraytype{ | |
62 dup rcheck | |
63 {dup xcheck | |
64 {({)tprint{typeprint}forall(})tprint} | |
65 {([)tprint{typeprint}forall(])tprint}ifelse} | |
66 {pop(-packedarray-)tprint}ifelse}readonly def | |
29497
0763a6ed0743
Insert a version number comment (5.2.2). Indentation fix.
Gerd Moellmann <gerd@gnu.org>
parents:
28764
diff
changeset
|
67 /courier/Courier findfont 10 scalefont def |
0763a6ed0743
Insert a version number comment (5.2.2). Indentation fix.
Gerd Moellmann <gerd@gnu.org>
parents:
28764
diff
changeset
|
68 /OLDhandleerror errordict/handleerror get def |
28155 | 69 end %ps$brkpage |
70 | |
71 /handleerror{ | |
72 systemdict begin $error begin ps$brkpage begin | |
73 newerror | |
74 {/newerror false store vmstatus pop pop 0 ne{grestoreall}if | |
75 initgraphics | |
76 ErrorMessage 1 and 0 ne{ % print on paper | |
77 courier setfont lmargin 720 moveto | |
78 (# ERROR: )prnt errorname prnt nl | |
29497
0763a6ed0743
Insert a version number comment (5.2.2). Indentation fix.
Gerd Moellmann <gerd@gnu.org>
parents:
28764
diff
changeset
|
79 (# OFFENDING COMMAND: )prnt/command load prnt |
0763a6ed0743
Insert a version number comment (5.2.2). Indentation fix.
Gerd Moellmann <gerd@gnu.org>
parents:
28764
diff
changeset
|
80 $error/ostack known |
0763a6ed0743
Insert a version number comment (5.2.2). Indentation fix.
Gerd Moellmann <gerd@gnu.org>
parents:
28764
diff
changeset
|
81 {nl nl(# STACK:)prnt nl nl $error/ostack get aload length{==}repeat}if |
0763a6ed0743
Insert a version number comment (5.2.2). Indentation fix.
Gerd Moellmann <gerd@gnu.org>
parents:
28764
diff
changeset
|
82 $error/errorinfo known |
0763a6ed0743
Insert a version number comment (5.2.2). Indentation fix.
Gerd Moellmann <gerd@gnu.org>
parents:
28764
diff
changeset
|
83 {nl nl(# ERRORINFO:)prnt nl nl $error/errorinfo get aload length{==}repeat}if |
0763a6ed0743
Insert a version number comment (5.2.2). Indentation fix.
Gerd Moellmann <gerd@gnu.org>
parents:
28764
diff
changeset
|
84 systemdict/showpage get exec}if |
28155 | 85 ErrorMessage 2 and 0 ne{ % send back to printing system |
86 (\%\%[ Error: )print errorname =print | |
87 (; OffendingCommand: )print/command load =print | |
29497
0763a6ed0743
Insert a version number comment (5.2.2). Indentation fix.
Gerd Moellmann <gerd@gnu.org>
parents:
28764
diff
changeset
|
88 $error/errorinfo known |
0763a6ed0743
Insert a version number comment (5.2.2). Indentation fix.
Gerd Moellmann <gerd@gnu.org>
parents:
28764
diff
changeset
|
89 {(; ErrorInfo:)print $error/errorinfo get aload length{( )=print =print}repeat}if |
28155 | 90 ( ]\%\%)= flush |
91 (\%\%[ Rest of job is ignored ]\%\%)= flush}if | |
92 /newerror true store}if | |
93 end end end | |
94 stop | |
95 } % handleerror | |
96 dup 0 systemdict put % replace name by actual dict object | |
97 dup 4 ps$brkpage put % replace name by dict object | |
98 bind readonly | |
99 | |
100 errordict 3 1 roll put % put proc in errordict as /handleerror | |
101 }ifelse | |
102 %%EndProcSet | |
103 | |
28764 | 104 |
105 % operators for language level 2 only | |
106 | |
107 (<<)cvn where % << operator | |
108 {pop/BMark(<<)cvn load def} | |
109 {/BMark{mark}bind def}ifelse | |
110 (>>)cvn where % >> operator | |
111 {pop/EMark(>>)cvn load def} | |
112 {/EMark{counttomark 2 idiv dup dict begin{def}repeat pop currentdict end}bind def}ifelse | |
113 /setpagedevice where % setpagedevice | |
114 {pop} | |
115 {/setpagedevice{pop}bind def}ifelse | |
116 /packedarray where % packedarray | |
117 {pop} | |
118 {/packedarray{array astore readonly}bind def}ifelse | |
119 | |
28155 | 120 |
28167
cb25a24ec3e1
Change /setduplexmode, /settumble, add /packedarray.
Gerd Moellmann <gerd@gnu.org>
parents:
28155
diff
changeset
|
121 % device dependent operators |
cb25a24ec3e1
Change /setduplexmode, /settumble, add /packedarray.
Gerd Moellmann <gerd@gnu.org>
parents:
28155
diff
changeset
|
122 |
28427
15c0a66a4a8b
Replace gs_languagelevel by languagelevel.
Gerd Moellmann <gerd@gnu.org>
parents:
28265
diff
changeset
|
123 /DefOp{ |
15c0a66a4a8b
Replace gs_languagelevel by languagelevel.
Gerd Moellmann <gerd@gnu.org>
parents:
28265
diff
changeset
|
124 dup where{pop pop pop} |
15c0a66a4a8b
Replace gs_languagelevel by languagelevel.
Gerd Moellmann <gerd@gnu.org>
parents:
28265
diff
changeset
|
125 {exch dup where{pop}{pop/pop}ifelse load def}ifelse}def |
28155 | 126 |
29497
0763a6ed0743
Insert a version number comment (5.2.2). Indentation fix.
Gerd Moellmann <gerd@gnu.org>
parents:
28764
diff
changeset
|
127 /duplexmode/setduplexmode DefOp |
0763a6ed0743
Insert a version number comment (5.2.2). Indentation fix.
Gerd Moellmann <gerd@gnu.org>
parents:
28764
diff
changeset
|
128 /tumble/settumble DefOp |
28155 | 129 |
130 % === END ps-print prologue 0 |