Mercurial > emacs
annotate etc/ps-prin0.ps @ 49919:249621b2dae5
Merge changes from CPerl-5.0.
(toplevel): Require man.
(condition-case): Don't autoload tmm-prompt (it's in loaddefs.el).
(cperl-electric-backspace-untabify): New var.
(cperl-electric-backspace): Use it.
(cperl-vc-header-alist): Extract numeric version from the Id.
(cperl-build-manpage): New fun.
(cperl-menu): Use it. Add toggle-autohelp.
(cperl-mode) <defun-prompt_regexp>: Understand prototypes.
(cperl-electric-brace): Use `cperl-after-block-p' for detection.
(cperl-electric-keyword): Make $if (etc: "$@%&*") non-electric.
'(' after keyword would insert a doubled paren.
(cperl-calculate-indent): Update syntaxification before checks.
Fix wrong indent of blocks starting with POD.
(cperl-find-pods-heres): If no end of HERE-doc found, mark to the end
of buffer. This enables recognition of end of HERE-doc "as one types".
Require "\n" after trailing tag of HERE-doc.
\( made non-quoting outside of string/comment (gdj-contributed).
Likewise for \$. Remove `here-doc-group' text property at start
(makes this property reliable).
Text property `first-format-line' ==> t.
Do not recognize $opt_s and $opt::s as s///.
(cperl-after-block-p): Optional arg pre-block to check for a pre-block
Recognize `continue' blocks too.
(cperl-after-expr-p): Update syntaxification before checks. Work after
here-docs, formats, and PODs too (affects many electric constructs).
(cperl-fix-line-spacing): Allow "_" in $vars of foreach etc.
(cperl-perldoc): Use case-sensitive search.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Sun, 23 Feb 2003 02:19:02 +0000 |
parents | e5675426ff4c |
children | 23a17af379b1 |
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 |
36223 | 4 % Copyright (C) 2000, 2001 Free Software Foundation, Inc. |
5 % | |
6 % This file is part of GNU Emacs. | |
7 % | |
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 2, or (at your option) | |
11 % any later version. | |
12 % | |
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. | |
17 % | |
18 % You should have received a copy of the GNU General Public License | |
19 % along with GNU Emacs; see the file COPYING. If not, write to the | |
20 % Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
21 % Boston, MA 02111-1307, USA. | |
22 | |
46014 | 23 % As a special exception, the copyright holders of this module give |
24 % you permission to include the module in a Postscript file generated | |
25 % by Emacs or other free software together with the result of | |
26 % converting text to be printed, regardless of the license terms of | |
27 % that text, and to use under terms of your choice the page images | |
28 % resulting from formatting said combination. If you modify this | |
29 % module, you may extend this exception to your version of the module | |
30 % but you are not obligated to do so. If you do not wish to do so, | |
31 % delete this exception statement from your version. | |
32 | |
33 | |
28155 | 34 %%BeginProcSet: ErrorHandler |
35 % Downloaded Error Break-page handler | |
36 % Adapted from: | |
37 % PostScript Language Program Design, | |
38 % Adobe Systems Incorporated. | |
39 % Appendix A, pages 217-219 | |
40 | |
41 /ps$brkpage where{pop} | |
42 { | |
43 /ps$brkpage 64 dict def | |
44 ps$brkpage begin | |
29497
0763a6ed0743
Insert a version number comment (5.2.2). Indentation fix.
Gerd Moellmann <gerd@gnu.org>
parents:
28764
diff
changeset
|
45 /tx 0 def/ty 0 def/toy 0 def/tox 0 def |
28155 | 46 /prnt{ |
29497
0763a6ed0743
Insert a version number comment (5.2.2). Indentation fix.
Gerd Moellmann <gerd@gnu.org>
parents:
28764
diff
changeset
|
47 dup type/stringtype ne{=string cvs}if |
28155 | 48 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
|
49 /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
|
50 currentpoint/toy exch def/tox exch def |
28155 | 51 1 setgray newpath |
52 tox toy 2 sub moveto | |
53 0 ty rlineto tx 0 rlineto | |
54 0 ty neg rlineto | |
55 closepath fill | |
56 tox toy moveto 0 setgray show | |
57 }bind def | |
58 /nl{currentpoint exch pop lmargin exch moveto 0 -10 rmoveto}def | |
59 /=={/cp 0 def typeprint nl}def | |
60 /typeprint{dup type dup currentdict exch known{exec}{unknowntype}ifelse}readonly def | |
61 /lmargin 72 def | |
62 /rmargin 72 def | |
63 /tprint{ | |
29497
0763a6ed0743
Insert a version number comment (5.2.2). Indentation fix.
Gerd Moellmann <gerd@gnu.org>
parents:
28764
diff
changeset
|
64 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
|
65 dup length cp add/cp exch def |
28155 | 66 prnt |
67 }readonly def | |
68 /cvsprint{=string cvs tprint( )tprint}readonly def | |
69 /unknowntype{exch pop cvlit(??)tprint cvsprint}readonly def | |
70 /integertype{cvsprint}readonly def | |
71 /realtype{cvsprint}readonly def | |
72 /booleantype{cvsprint}readonly def | |
73 /operatortype{(//)tprint cvsprint}readonly def | |
74 /marktype{pop(-mark-)tprint}readonly def | |
75 /dicttype{pop(-dictionary-)tprint}readonly def | |
76 /nulltype{pop(-null-)tprint}readonly def | |
77 /filetype{pop(-filestream-)tprint}readonly def | |
78 /savetype{pop(-savelevel-)tprint}readonly def | |
79 /fonttype{pop(-fontid-)tprint}readonly def | |
80 /nametype{dup xcheck not{(/)tprint}if cvsprint}readonly def | |
81 /stringtype{ | |
82 dup rcheck | |
83 {(\()tprint tprint(\))tprint} | |
84 {pop(-string-)tprint}ifelse}readonly def | |
85 /arraytype{ | |
86 dup rcheck | |
87 {dup xcheck | |
88 {({)tprint{typeprint}forall(})tprint} | |
89 {([)tprint{typeprint}forall(])tprint}ifelse} | |
90 {pop(-array-)tprint}ifelse}readonly def | |
91 /packedarraytype{ | |
92 dup rcheck | |
93 {dup xcheck | |
94 {({)tprint{typeprint}forall(})tprint} | |
95 {([)tprint{typeprint}forall(])tprint}ifelse} | |
96 {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
|
97 /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
|
98 /OLDhandleerror errordict/handleerror get def |
28155 | 99 end %ps$brkpage |
100 | |
101 /handleerror{ | |
102 systemdict begin $error begin ps$brkpage begin | |
103 newerror | |
104 {/newerror false store vmstatus pop pop 0 ne{grestoreall}if | |
105 initgraphics | |
106 ErrorMessage 1 and 0 ne{ % print on paper | |
107 courier setfont lmargin 720 moveto | |
108 (# 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
|
109 (# 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
|
110 $error/ostack known |
0763a6ed0743
Insert a version number comment (5.2.2). Indentation fix.
Gerd Moellmann <gerd@gnu.org>
parents:
28764
diff
changeset
|
111 {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
|
112 $error/errorinfo known |
0763a6ed0743
Insert a version number comment (5.2.2). Indentation fix.
Gerd Moellmann <gerd@gnu.org>
parents:
28764
diff
changeset
|
113 {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
|
114 systemdict/showpage get exec}if |
28155 | 115 ErrorMessage 2 and 0 ne{ % send back to printing system |
116 (\%\%[ Error: )print errorname =print | |
117 (; 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
|
118 $error/errorinfo known |
0763a6ed0743
Insert a version number comment (5.2.2). Indentation fix.
Gerd Moellmann <gerd@gnu.org>
parents:
28764
diff
changeset
|
119 {(; ErrorInfo:)print $error/errorinfo get aload length{( )=print =print}repeat}if |
28155 | 120 ( ]\%\%)= flush |
121 (\%\%[ Rest of job is ignored ]\%\%)= flush}if | |
122 /newerror true store}if | |
123 end end end | |
124 stop | |
125 } % handleerror | |
126 dup 0 systemdict put % replace name by actual dict object | |
127 dup 4 ps$brkpage put % replace name by dict object | |
128 bind readonly | |
129 | |
130 errordict 3 1 roll put % put proc in errordict as /handleerror | |
131 }ifelse | |
132 %%EndProcSet | |
133 | |
28764 | 134 |
135 % operators for language level 2 only | |
136 | |
137 (<<)cvn where % << operator | |
138 {pop/BMark(<<)cvn load def} | |
139 {/BMark{mark}bind def}ifelse | |
140 (>>)cvn where % >> operator | |
141 {pop/EMark(>>)cvn load def} | |
142 {/EMark{counttomark 2 idiv dup dict begin{def}repeat pop currentdict end}bind def}ifelse | |
143 /setpagedevice where % setpagedevice | |
144 {pop} | |
145 {/setpagedevice{pop}bind def}ifelse | |
146 /packedarray where % packedarray | |
147 {pop} | |
148 {/packedarray{array astore readonly}bind def}ifelse | |
149 | |
28155 | 150 |
28167
cb25a24ec3e1
Change /setduplexmode, /settumble, add /packedarray.
Gerd Moellmann <gerd@gnu.org>
parents:
28155
diff
changeset
|
151 % device dependent operators |
cb25a24ec3e1
Change /setduplexmode, /settumble, add /packedarray.
Gerd Moellmann <gerd@gnu.org>
parents:
28155
diff
changeset
|
152 |
28427
15c0a66a4a8b
Replace gs_languagelevel by languagelevel.
Gerd Moellmann <gerd@gnu.org>
parents:
28265
diff
changeset
|
153 /DefOp{ |
15c0a66a4a8b
Replace gs_languagelevel by languagelevel.
Gerd Moellmann <gerd@gnu.org>
parents:
28265
diff
changeset
|
154 dup where{pop pop pop} |
15c0a66a4a8b
Replace gs_languagelevel by languagelevel.
Gerd Moellmann <gerd@gnu.org>
parents:
28265
diff
changeset
|
155 {exch dup where{pop}{pop/pop}ifelse load def}ifelse}def |
28155 | 156 |
29497
0763a6ed0743
Insert a version number comment (5.2.2). Indentation fix.
Gerd Moellmann <gerd@gnu.org>
parents:
28764
diff
changeset
|
157 /duplexmode/setduplexmode DefOp |
0763a6ed0743
Insert a version number comment (5.2.2). Indentation fix.
Gerd Moellmann <gerd@gnu.org>
parents:
28764
diff
changeset
|
158 /tumble/settumble DefOp |
28155 | 159 |
160 % === END ps-print prologue 0 |