1 % === BEGIN ps-print prologue 0
4 % Copyright (C) 2000-2012 Free Software Foundation, Inc.
6 % This file is part of GNU Emacs.
8 % GNU Emacs is free software: you can redistribute it and/or modify
9 % it under the terms of the GNU General Public License as published by
10 % the Free Software Foundation, either version 3 of the License, or
11 % (at your option) any later version.
13 % GNU Emacs is distributed in the hope that it will be useful,
14 % but WITHOUT ANY WARRANTY; without even the implied warranty of
15 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 % GNU General Public License for more details.
18 % You should have received a copy of the GNU General Public License
19 % along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
21 % As a special exception, the copyright holders of this module give
22 % you permission to include the module in a Postscript file generated
23 % by Emacs or other free software together with the result of
24 % converting text to be printed, regardless of the license terms of
25 % that text, and to use under terms of your choice the page images
26 % resulting from formatting said combination. If you modify this
27 % module, you may extend this exception to your version of the module
28 % but you are not obligated to do so. If you do not wish to do so,
29 % delete this exception statement from your version.
32 %%BeginProcSet: ErrorHandler
33 % Downloaded Error Break-page handler
35 % PostScript Language Program Design,
36 % Adobe Systems Incorporated.
37 % Appendix A, pages 217-219
39 /ps$brkpage where
{pop}
41 /ps$brkpage
64 dict def
43 /tx
0 def
/ty
0 def
/toy
0 def
/tox
0 def
45 dup type
/stringtype ne
{=string cvs
}if
47 /tx
exch def
/ty
10 def
48 currentpoint
/toy
exch def
/tox
exch def
51 0 ty rlineto tx
0 rlineto
54 tox toy moveto
0 setgray show
56 /nl
{currentpoint
exch pop lmargin
exch moveto
0 -10 rmoveto
}def
57 /=={/cp
0 def typeprint nl
}def
58 /typeprint
{dup type
dup currentdict
exch known
{exec}{unknowntype
}ifelse}readonly def
62 dup length cp add rmargin gt
{nl
/cp
0 def
}if
63 dup length cp add
/cp
exch def
66 /cvsprint
{=string cvs tprint
( )tprint
}readonly def
67 /unknowntype
{exch pop cvlit
(??
)tprint cvsprint
}readonly def
68 /integertype
{cvsprint
}readonly def
69 /realtype
{cvsprint
}readonly def
70 /booleantype
{cvsprint
}readonly def
71 /operatortype
{(//)tprint cvsprint
}readonly def
72 /marktype
{pop(-mark-)tprint
}readonly def
73 /dicttype
{pop(-dictionary
-)tprint
}readonly def
74 /nulltype
{pop(-null
-)tprint
}readonly def
75 /filetype
{pop(-filestream
-)tprint
}readonly def
76 /savetype
{pop(-savelevel
-)tprint
}readonly def
77 /fonttype
{pop(-fontid
-)tprint
}readonly def
78 /nametype
{dup xcheck not
{(/)tprint
}if cvsprint
}readonly def
81 {(\
()tprint tprint
(\
))tprint
}
82 {pop(-string
-)tprint
}ifelse}readonly def
86 {({)tprint
{typeprint
}forall
(})tprint
}
87 {([)tprint
{typeprint
}forall
(])tprint
}ifelse}
88 {pop(-array
-)tprint
}ifelse}readonly def
92 {({)tprint
{typeprint
}forall
(})tprint
}
93 {([)tprint
{typeprint
}forall
(])tprint
}ifelse}
94 {pop(-packedarray
-)tprint
}ifelse}readonly def
95 /courier
/Courier findfont
10 scalefont def
96 /OLDhandleerror errordict
/handleerror get def
100 systemdict begin $error begin ps$brkpage begin
102 {/newerror
false store vmstatus
pop pop 0 ne
{grestoreall
}if
104 ErrorMessage
1 and
0 ne
{ % print on paper
105 courier setfont lmargin
720 moveto
106 (# ERROR
: )prnt errorname prnt nl
107 (# OFFENDING COMMAND
: )prnt
/command load prnt
109 {nl nl
(# STACK
:)prnt nl nl $error
/ostack get aload length
{==}repeat}if
110 $error
/errorinfo known
111 {nl nl
(# ERRORINFO
:)prnt nl nl $error
/errorinfo get aload length
{==}repeat}if
112 systemdict
/showpage get
exec}if
113 ErrorMessage
2 and
0 ne
{ % send back to printing system
114 (\
%\%[ Error: )print errorname =print
115 (; OffendingCommand
: )print
/command load
=print
116 $error
/errorinfo known
117 {(; ErrorInfo
:)print $error
/errorinfo get aload length
{( )=print
=print
}repeat}if
119 (\
%\%[ Rest of job is ignored ]\%\%)= flush}if
120 /newerror
true store
}if
124 dup 0 systemdict put
% replace name by actual dict object
125 dup 4 ps$brkpage put
% replace name by dict object
128 errordict
3 1 roll put
% put proc in errordict as /handleerror
133 % operators for language level 2 only
135 (<<)cvn where
% << operator
136 {pop/BMark
(<<)cvn load def
}
137 {/BMark
{mark}bind def
}ifelse
138 (>>)cvn where
% >> operator
139 {pop/EMark
(>>)cvn load def
}
140 {/EMark
{counttomark 2 idiv dup dict begin
{def
}repeat pop currentdict end
}bind def
}ifelse
141 /setpagedevice where
% setpagedevice
143 {/setpagedevice
{pop}bind def
}ifelse
144 /packedarray where
% packedarray
146 {/packedarray
{array astore readonly
}bind def
}ifelse
149 % device dependent operators
152 dup where
{pop pop pop}
153 {exch dup where
{pop}{pop/pop}ifelse load def
}ifelse}def
155 /duplexmode
/setduplexmode DefOp
156 /tumble
/settumble DefOp
158 % === END ps-print prologue 0