Mercurial > emacs
annotate lisp/printing.el @ 85558:0c74024f724c
*** empty log message ***
author | Juanma Barranquero <lekktu@gmail.com> |
---|---|
date | Mon, 22 Oct 2007 22:19:09 +0000 |
parents | 84efd7d3c35e |
children | 6b689f2a0bdc |
rev | line source |
---|---|
49646 | 1 ;;; printing.el --- printing utilities |
2 | |
68651
3bd95f4f2941
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
66951
diff
changeset
|
3 ;; Copyright (C) 2000, 2001, 2003, 2004, 2005, |
75347 | 4 ;; 2006, 2007 Free Software Foundation, Inc. |
49646 | 5 |
56390
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
6 ;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br> |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
7 ;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br> |
49646 | 8 ;; Keywords: wp, print, PostScript |
82253
e100ad942371
Evaluate require only during compilation
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
82140
diff
changeset
|
9 ;; Version: 6.9.1 |
73027
575850f5bd53
Adjust X-URL
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
68651
diff
changeset
|
10 ;; X-URL: http://www.emacswiki.org/cgi-bin/wiki/ViniciusJoseLatorre |
49646 | 11 |
82253
e100ad942371
Evaluate require only during compilation
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
82140
diff
changeset
|
12 (defconst pr-version "6.9.1" |
e100ad942371
Evaluate require only during compilation
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
82140
diff
changeset
|
13 "printing.el, v 6.9.1 <2007/08/02 vinicius> |
49646 | 14 |
15 Please send all bug fixes and enhancements to | |
56390
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
16 Vinicius Jose Latorre <viniciusjl@ig.com.br> |
49646 | 17 ") |
18 | |
19 ;; This file is part of GNU Emacs. | |
20 | |
21 ;; GNU Emacs is free software; you can redistribute it and/or modify it under | |
22 ;; the terms of the GNU General Public License as published by the Free | |
78236
9355f9b7bbff
Switch license to GPLv3 or later.
Glenn Morris <rgm@gnu.org>
parents:
77718
diff
changeset
|
23 ;; Software Foundation; either version 3, or (at your option) any later |
49646 | 24 ;; version. |
25 | |
26 ;; GNU Emacs is distributed in the hope that it will be useful, but WITHOUT ANY | |
27 ;; WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | |
28 ;; FOR A PARTICULAR PURPOSE. See the GNU General Public License for more | |
29 ;; details. | |
30 | |
31 ;; You should have received a copy of the GNU General Public License along with | |
32 ;; GNU Emacs; see the file COPYING. If not, write to the Free Software | |
64091 | 33 ;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
49646 | 34 |
35 ;;; Commentary: | |
36 | |
37 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
38 ;; | |
39 ;; Introduction | |
40 ;; ------------ | |
41 ;; | |
56493 | 42 ;; With `printing' you can preview or print a PostScript file. You can also |
43 ;; print a text file using PostScript, and preview or print buffers that use | |
44 ;; certain special modes like mh-folder-mode, rmail-summary-mode, | |
45 ;; gnus-summary-mode, etc. This package also includes a PostScript/text | |
46 ;; printer database. | |
47 ;; | |
48 ;; There are two user interfaces: | |
56390
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
49 ;; |
56405
10b68aa88abe
Doc fix. Change name of some funs.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
56390
diff
changeset
|
50 ;; * Menu interface: |
56493 | 51 ;; The `printing' menu replaces the usual print options in the menu bar. |
56390
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
52 ;; This is the default user interface. |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
53 ;; |
56405
10b68aa88abe
Doc fix. Change name of some funs.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
56390
diff
changeset
|
54 ;; * Buffer interface: |
56493 | 55 ;; You can use a buffer interface instead of menus. It looks like a |
56 ;; customization buffer. Basically, it has the same options found in the | |
57 ;; menu and some extra options, all this on a buffer. | |
58 ;; | |
59 ;; `printing' is prepared to run on GNU, Unix and NT systems. | |
60 ;; On GNU or Unix system, `printing' depends on gs and gv utilities. | |
61 ;; On NT system, `printing' depends on gstools (gswin32.exe and gsview32.exe). | |
62 ;; To obtain ghostscript, ghostview and GSview see the URL | |
63 ;; `http://www.gnu.org/software/ghostscript/ghostscript.html'. | |
64 ;; | |
65 ;; `printing' depends on ps-print package to generate PostScript files, to | |
66 ;; spool and to despool PostScript buffer. So, `printing' provides an | |
67 ;; interface to ps-print package and it also provides some extra stuff. | |
68 ;; | |
69 ;; To download the latest ps-print package see | |
75712
f24fee7e36d4
Fix ps-print links
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
75347
diff
changeset
|
70 ;; `http://www.emacswiki.org/cgi-bin/wiki/PsPrintPackage'. |
56493 | 71 ;; Please, see README file for ps-print installation instructions. |
49646 | 72 ;; |
73 ;; `printing' was inspired on: | |
74 ;; | |
75 ;; print-nt.el Frederic Corne <frederic.corne@erli.fr> | |
76 ;; Special printing functions for Windows NT | |
77 ;; | |
78 ;; mh-e-init.el Tom Vogels <tov@ece.cmu.edu> | |
79 ;; PS-print for mail messages | |
80 ;; | |
81 ;; win32-ps-print.el Matthew O. Persico <mpersico@erols.com> | |
82 ;; PostScript printing with ghostscript | |
83 ;; | |
84 ;; ps-print-interface.el Volker Franz <volker.franz@tuebingen.mpg.de> | |
85 ;; Graphical front end for ps-print and previewing | |
86 ;; | |
87 ;; | |
56405
10b68aa88abe
Doc fix. Change name of some funs.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
56390
diff
changeset
|
88 ;; Log Messages |
10b68aa88abe
Doc fix. Change name of some funs.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
56390
diff
changeset
|
89 ;; ------------ |
10b68aa88abe
Doc fix. Change name of some funs.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
56390
diff
changeset
|
90 ;; |
10b68aa88abe
Doc fix. Change name of some funs.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
56390
diff
changeset
|
91 ;; The buffer *Printing Command Output* is where the `printing' log messages |
10b68aa88abe
Doc fix. Change name of some funs.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
56390
diff
changeset
|
92 ;; are inserted. All program called by `printing' has a log entry in the |
10b68aa88abe
Doc fix. Change name of some funs.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
56390
diff
changeset
|
93 ;; buffer *Printing Command Output*. A log entry has the following form: |
10b68aa88abe
Doc fix. Change name of some funs.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
56390
diff
changeset
|
94 ;; |
10b68aa88abe
Doc fix. Change name of some funs.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
56390
diff
changeset
|
95 ;; PROGRAM (ARG...) |
10b68aa88abe
Doc fix. Change name of some funs.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
56390
diff
changeset
|
96 ;; MESSAGE |
10b68aa88abe
Doc fix. Change name of some funs.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
56390
diff
changeset
|
97 ;; Exit status: CODE |
10b68aa88abe
Doc fix. Change name of some funs.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
56390
diff
changeset
|
98 ;; |
10b68aa88abe
Doc fix. Change name of some funs.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
56390
diff
changeset
|
99 ;; Where |
10b68aa88abe
Doc fix. Change name of some funs.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
56390
diff
changeset
|
100 ;; PROGRAM is the program activated by `printing', |
10b68aa88abe
Doc fix. Change name of some funs.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
56390
diff
changeset
|
101 ;; ARG is an argument passed to PROGRAM (it can have more than one argument), |
10b68aa88abe
Doc fix. Change name of some funs.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
56390
diff
changeset
|
102 ;; MESSAGE is an error message returned by PROGRAM (it can have no message, if |
10b68aa88abe
Doc fix. Change name of some funs.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
56390
diff
changeset
|
103 ;; PROGRAM is successful), |
10b68aa88abe
Doc fix. Change name of some funs.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
56390
diff
changeset
|
104 ;; and CODE is a numeric exit status or a signal description string. |
10b68aa88abe
Doc fix. Change name of some funs.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
56390
diff
changeset
|
105 ;; |
10b68aa88abe
Doc fix. Change name of some funs.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
56390
diff
changeset
|
106 ;; For example, after previewing a PostScript file, *Printing Command Output* |
10b68aa88abe
Doc fix. Change name of some funs.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
56390
diff
changeset
|
107 ;; will have the following entry: |
10b68aa88abe
Doc fix. Change name of some funs.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
56390
diff
changeset
|
108 ;; |
10b68aa88abe
Doc fix. Change name of some funs.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
56390
diff
changeset
|
109 ;; /usr/X11R6/bin/gv ("/home/user/example/file.ps") |
10b68aa88abe
Doc fix. Change name of some funs.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
56390
diff
changeset
|
110 ;; Exit status: 0 |
10b68aa88abe
Doc fix. Change name of some funs.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
56390
diff
changeset
|
111 ;; |
10b68aa88abe
Doc fix. Change name of some funs.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
56390
diff
changeset
|
112 ;; In the example above, the previewing was successful. If during previewing, |
10b68aa88abe
Doc fix. Change name of some funs.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
56390
diff
changeset
|
113 ;; you quit gv execution (by typing C-g during Emacs session), the log entry |
10b68aa88abe
Doc fix. Change name of some funs.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
56390
diff
changeset
|
114 ;; would be: |
10b68aa88abe
Doc fix. Change name of some funs.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
56390
diff
changeset
|
115 ;; |
10b68aa88abe
Doc fix. Change name of some funs.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
56390
diff
changeset
|
116 ;; /usr/X11R6/bin/gv ("/home/user/example/file.ps") |
10b68aa88abe
Doc fix. Change name of some funs.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
56390
diff
changeset
|
117 ;; Exit status: Quit |
10b68aa88abe
Doc fix. Change name of some funs.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
56390
diff
changeset
|
118 ;; |
10b68aa88abe
Doc fix. Change name of some funs.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
56390
diff
changeset
|
119 ;; So, if something goes wrong, a good place to take a look is the buffer |
10b68aa88abe
Doc fix. Change name of some funs.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
56390
diff
changeset
|
120 ;; *Printing Command Output*. Don't forget to see also the buffer *Messages*, |
10b68aa88abe
Doc fix. Change name of some funs.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
56390
diff
changeset
|
121 ;; it can help. |
10b68aa88abe
Doc fix. Change name of some funs.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
56390
diff
changeset
|
122 ;; |
10b68aa88abe
Doc fix. Change name of some funs.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
56390
diff
changeset
|
123 ;; |
49646 | 124 ;; Novices (First Users) |
125 ;; --------------------- | |
126 ;; | |
57241
e53d659f0afd
Check if file exists before deleting it.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
57187
diff
changeset
|
127 ;; First of all, see printing documentation only to get an idea of what |
e53d659f0afd
Check if file exists before deleting it.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
57187
diff
changeset
|
128 ;; `printing' is capable. |
49646 | 129 ;; |
130 ;; Then try to set the variables: `pr-ps-name', `pr-ps-printer-alist', | |
131 ;; `pr-txt-name', `pr-txt-printer-alist' and `pr-path-alist'. These variables | |
132 ;; are the main variables for printing processing. | |
133 ;; | |
57241
e53d659f0afd
Check if file exists before deleting it.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
57187
diff
changeset
|
134 ;; Now, please, see these variables documentation deeper. You can do this by |
e53d659f0afd
Check if file exists before deleting it.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
57187
diff
changeset
|
135 ;; typing C-h v pr-ps-name RET (for example) if you already loaded printing |
e53d659f0afd
Check if file exists before deleting it.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
57187
diff
changeset
|
136 ;; package, or by browsing printing.el source file. |
49646 | 137 ;; |
138 ;; If the documentation isn't clear or if you find a way to improve the | |
139 ;; documentation, please, send an email to maintainer. All printing users | |
140 ;; will thank you. | |
141 ;; | |
142 ;; One way to set variables is by calling `pr-customize', customize all | |
143 ;; variables and save the customization by future sessions (see Options | |
144 ;; section). Other way is by coding your settings on Emacs init file (that is, | |
63328
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
145 ;; ~/.emacs file), see below for a first setting template that it should be |
49646 | 146 ;; inserted on your ~/.emacs file (or c:/_emacs, if you're using Windows 9x/NT |
147 ;; or MS-DOS): | |
148 ;; | |
149 ;; * Example of setting for Windows system: | |
150 ;; | |
151 ;; (require 'printing) ; load printing package | |
152 ;; (setq pr-path-alist | |
153 ;; '((windows "c:/applications/executables" PATH ghostview mpage) | |
154 ;; (ghostview "c:/gs/gsview-dir") | |
155 ;; (mpage "c:/mpage-dir") | |
156 ;; )) | |
157 ;; (setq pr-txt-name 'prt_06a) | |
158 ;; (setq pr-txt-printer-alist | |
159 ;; '((prt_06a "print" nil "/D:\\\\printers\\prt_06a") | |
160 ;; (prt_07c nil nil "/D:\\\\printers\\prt_07c") | |
161 ;; (PRN "" nil "PRN") | |
162 ;; (standard "redpr.exe" nil "") | |
163 ;; )) | |
164 ;; (setq pr-ps-name 'lps_06b) | |
165 ;; (setq pr-ps-printer-alist | |
166 ;; '((lps_06a "print" nil "/D:" "\\\\printers\\lps_06a") | |
167 ;; (lps_06b "print" nil nil "\\\\printers\\lps_06b") | |
168 ;; (lps_07c "print" nil "" "/D:\\\\printers\\lps_07c") | |
169 ;; (lps_08c nil nil nil "\\\\printers\\lps_08c") | |
170 ;; (LPT1 "" nil "" "LPT1:") | |
171 ;; (PRN "" nil "" "PRN") | |
172 ;; (standard "redpr.exe" nil "" "") | |
173 ;; )) | |
174 ;; (pr-update-menus t) ; update now printer and utility menus | |
175 ;; | |
176 ;; * Example of setting for GNU or Unix system: | |
177 ;; | |
178 ;; (require 'printing) ; load printing package | |
179 ;; (setq pr-path-alist | |
180 ;; '((unix "." "~/bin" ghostview mpage PATH) | |
181 ;; (ghostview "$HOME/bin/gsview-dir") | |
182 ;; (mpage "$HOME/bin/mpage-dir") | |
183 ;; )) | |
184 ;; (setq pr-txt-name 'prt_06a) | |
185 ;; (setq pr-txt-printer-alist | |
186 ;; '((prt_06a "lpr" nil "prt_06a") | |
187 ;; (prt_07c nil nil "prt_07c") | |
188 ;; )) | |
189 ;; (setq pr-ps-name 'lps_06b) | |
190 ;; (setq pr-ps-printer-alist | |
191 ;; '((lps_06b "lpr" nil "-P" "lps_06b") | |
192 ;; (lps_07c "lpr" nil nil "lps_07c") | |
193 ;; (lps_08c nil nil nil "lps_08c") | |
194 ;; )) | |
195 ;; (pr-update-menus t) ; update now printer and utility menus | |
196 ;; | |
197 ;; | |
198 ;; NOTE 1: Don't forget to download and install ghostscript utilities (see | |
199 ;; Utilities section). | |
200 ;; | |
201 ;; NOTE 2: The `printer-name' and `ps-printer-name' variables don't need to be | |
202 ;; set, as they are implicit set by `pr-ps-printer-alist' and | |
203 ;; `pr-txt-printer-alist'. | |
204 ;; | |
205 ;; NOTE 3: The duplex feature will only work on PostScript printers that | |
206 ;; support this feature. | |
207 ;; You can check if your PostScript printer supports duplex feature | |
208 ;; by checking the printer manual. Or you can try these steps: | |
209 ;; 1. Open a buffer (or use the *scratch* buffer). | |
210 ;; 2. Type: | |
211 ;; First line (on first page) | |
212 ;; ^L | |
213 ;; Second line (on second page) | |
214 ;; 3. Print this buffer with duplex turned on. | |
215 ;; If it's printed 2 (two) sheets of paper, then your PostScript | |
216 ;; printer doesn't have duplex feature; otherwise, it's ok, your | |
217 ;; printer does have duplex feature. | |
218 ;; | |
54326 | 219 ;; NOTE 4: See Tips section. |
220 ;; | |
221 ;; | |
222 ;; Tips | |
223 ;; ---- | |
224 ;; | |
56390
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
225 ;; 1. If you have a local printer, that is, a printer which is connected |
54326 | 226 ;; directly to your computer, don't forget to connect the printer to your |
227 ;; computer before printing. | |
228 ;; | |
54333
085835de6939
New tips in Tips section.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54326
diff
changeset
|
229 ;; 2. If you try to print a file and it seems that the file was printed, but |
085835de6939
New tips in Tips section.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54326
diff
changeset
|
230 ;; there is no paper in the printer, then try to set `pr-delete-temp-file' |
085835de6939
New tips in Tips section.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54326
diff
changeset
|
231 ;; to nil. Probably `printing' is deleting the temporary file before your |
085835de6939
New tips in Tips section.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54326
diff
changeset
|
232 ;; local system can get it to send to the printer. |
085835de6939
New tips in Tips section.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54326
diff
changeset
|
233 ;; |
085835de6939
New tips in Tips section.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54326
diff
changeset
|
234 ;; 3. Don't try to print a dynamic buffer, that is, a buffer which is |
085835de6939
New tips in Tips section.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54326
diff
changeset
|
235 ;; modifying while `printing' tries to print. Eventually you got an error |
085835de6939
New tips in Tips section.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54326
diff
changeset
|
236 ;; message. Instead, save the dynamic buffer to a file or copy it in |
085835de6939
New tips in Tips section.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54326
diff
changeset
|
237 ;; another buffer and, then, print the file or the new static buffer. |
085835de6939
New tips in Tips section.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54326
diff
changeset
|
238 ;; An example of dynamic buffer is the *Messages* buffer. |
085835de6939
New tips in Tips section.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54326
diff
changeset
|
239 ;; |
56390
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
240 ;; 4. When running Emacs on Windows (with or without cygwin), check if your |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
241 ;; printer is a text printer or not by typing in a DOS window: |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
242 ;; |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
243 ;; print /D:\\host\printer somefile.txt |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
244 ;; |
56405
10b68aa88abe
Doc fix. Change name of some funs.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
56390
diff
changeset
|
245 ;; Where, `host' is the machine where the printer is directly connected, |
56390
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
246 ;; `printer' is the printer name and `somefile.txt' is a text file. |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
247 ;; |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
248 ;; If the printer `\\host\printer' doesn't print the content of |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
249 ;; `somefile.txt' or, instead, it returns the following message: |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
250 ;; |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
251 ;; PostScript Error Handler |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
252 ;; Offending Command = CCC |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
253 ;; Stack = |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
254 ;; |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
255 ;; Where `CCC' is whatever is at the beginning of the text to be printed. |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
256 ;; |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
257 ;; Therefore, the printer `\\host\printer' is not a text printer, but a |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
258 ;; PostScript printer. So, please, don't include this printer in |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
259 ;; `pr-txt-printer-alist' (which see). |
54675
32aae36e32af
Var initialization fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54636
diff
changeset
|
260 ;; |
63328
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
261 ;; 5. You can use gsprint instead of ghostscript to print monochrome PostScript |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
262 ;; files in Windows. The gsprint utility documentation says that it is more |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
263 ;; efficient than ghostscript to print monochrome PostScript. |
57187
c9052d462541
Doc fix (gsprint).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
56578
diff
changeset
|
264 ;; |
57241
e53d659f0afd
Check if file exists before deleting it.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
57187
diff
changeset
|
265 ;; To print non-monochrome PostScript file, the efficiency of ghostscript |
e53d659f0afd
Check if file exists before deleting it.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
57187
diff
changeset
|
266 ;; is similar to gsprint. |
57187
c9052d462541
Doc fix (gsprint).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
56578
diff
changeset
|
267 ;; |
c9052d462541
Doc fix (gsprint).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
56578
diff
changeset
|
268 ;; Also the gsprint utility comes together with gsview distribution. |
c9052d462541
Doc fix (gsprint).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
56578
diff
changeset
|
269 ;; |
c9052d462541
Doc fix (gsprint).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
56578
diff
changeset
|
270 ;; For more information about gsprint see |
c9052d462541
Doc fix (gsprint).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
56578
diff
changeset
|
271 ;; `http://www.cs.wisc.edu/~ghost/gsview/gsprint.htm'. |
c9052d462541
Doc fix (gsprint).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
56578
diff
changeset
|
272 ;; |
63328
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
273 ;; As an example of gsprint declaration: |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
274 ;; |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
275 ;; (setq pr-ps-printer-alist |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
276 ;; '((A "gsprint" ("-all" "-twoup") "-printer " "my-b/w-printer-name") |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
277 ;; (B "gsprint" ("-all" "-twoup") nil "-printer my-b/w-printer-name") |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
278 ;; ;; some other printer declaration |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
279 ;; )) |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
280 ;; |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
281 ;; The example above declares that printer A prints all pages (-all) and two |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
282 ;; pages per sheet (-twoup). The printer B declaration does the same as the |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
283 ;; printer A declaration, the only difference is the printer name selection. |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
284 ;; |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
285 ;; There are other command line options like: |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
286 ;; |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
287 ;; -mono Render in monochrome as 1bit/pixel (only black and white). |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
288 ;; -grey Render in greyscale as 8bits/pixel. |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
289 ;; -color Render in color as 24bits/pixel. |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
290 ;; |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
291 ;; The default is `-mono'. So, printer A and B in the example above are |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
292 ;; using implicitly the `-mono' option. Note that in `-mono' no gray tone |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
293 ;; or color is printed, this includes the zebra stripes, that is, in `-mono' |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
294 ;; the zebra stripes are not printed. |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
295 ;; |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
296 ;; See also documentation for `pr-ps-printer-alist'. |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
297 ;; |
49646 | 298 ;; |
299 ;; Using `printing' | |
300 ;; ---------------- | |
301 ;; | |
302 ;; To use `printing' insert in your ~/.emacs file (or c:/_emacs, if you're | |
303 ;; using Windows 9x/NT or MS-DOS): | |
304 ;; | |
305 ;; (require 'printing) | |
63328
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
306 ;; ;; ...some user settings... |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
307 ;; (pr-update-menus t) |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
308 ;; |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
309 ;; During `pr-update-menus' evaluation: |
49646 | 310 ;; * On Emacs 20: |
311 ;; it replaces the Tools/Print menu by Tools/Printing menu. | |
312 ;; * On Emacs 21: | |
313 ;; it replaces the File/Print* menu entries by File/Print menu. | |
314 ;; Please, see section Menu Layout below for menu explanation. | |
315 ;; | |
316 ;; To use `printing' utilities you can use the Printing menu options, type M-x | |
317 ;; followed by one of the commands below, or type a key associated with the | |
318 ;; command you want (if there is a key binding). | |
319 ;; | |
320 ;; `printing' has the following commands: | |
321 ;; | |
322 ;; pr-interface | |
323 ;; pr-ps-directory-preview | |
324 ;; pr-ps-directory-using-ghostscript | |
325 ;; pr-ps-directory-print | |
326 ;; pr-ps-directory-ps-print | |
327 ;; pr-ps-buffer-preview | |
328 ;; pr-ps-buffer-using-ghostscript | |
329 ;; pr-ps-buffer-print | |
330 ;; pr-ps-buffer-ps-print | |
331 ;; pr-ps-region-preview | |
332 ;; pr-ps-region-using-ghostscript | |
333 ;; pr-ps-region-print | |
334 ;; pr-ps-region-ps-print | |
335 ;; pr-ps-mode-preview | |
336 ;; pr-ps-mode-using-ghostscript | |
337 ;; pr-ps-mode-print | |
338 ;; pr-ps-mode-ps-print | |
339 ;; pr-ps-file-preview | |
340 ;; pr-ps-file-up-preview | |
341 ;; pr-ps-file-using-ghostscript | |
342 ;; pr-ps-file-print | |
343 ;; pr-ps-file-ps-print | |
344 ;; pr-ps-file-up-ps-print | |
345 ;; pr-ps-fast-fire | |
346 ;; pr-despool-preview | |
347 ;; pr-despool-using-ghostscript | |
348 ;; pr-despool-print | |
349 ;; pr-despool-ps-print | |
350 ;; pr-printify-directory | |
351 ;; pr-printify-buffer | |
352 ;; pr-printify-region | |
353 ;; pr-txt-directory | |
354 ;; pr-txt-buffer | |
355 ;; pr-txt-region | |
356 ;; pr-txt-mode | |
357 ;; pr-txt-fast-fire | |
358 ;; pr-toggle-file-duplex | |
359 ;; pr-toggle-file-tumble | |
360 ;; pr-toggle-file-landscape | |
361 ;; pr-toggle-ghostscript | |
362 ;; pr-toggle-faces | |
363 ;; pr-toggle-spool | |
364 ;; pr-toggle-duplex | |
365 ;; pr-toggle-tumble | |
366 ;; pr-toggle-landscape | |
367 ;; pr-toggle-upside-down | |
368 ;; pr-toggle-line | |
369 ;; pr-toggle-zebra | |
370 ;; pr-toggle-header | |
371 ;; pr-toggle-lock | |
372 ;; pr-toggle-region | |
373 ;; pr-toggle-mode | |
374 ;; pr-customize | |
375 ;; lpr-customize | |
376 ;; pr-help | |
377 ;; pr-ps-name | |
378 ;; pr-txt-name | |
379 ;; pr-ps-utility | |
380 ;; pr-show-ps-setup | |
381 ;; pr-show-pr-setup | |
382 ;; pr-show-lpr-setup | |
383 ;; | |
384 ;; The general meanings of above commands are: | |
385 ;; | |
386 ;; PREFIX: | |
387 ;; `pr-interface' buffer interface for printing package. | |
388 ;; `pr-help' help for printing package. | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
389 ;; `pr-ps-name' interactively select a PostScript printer. |
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
390 ;; `pr-txt-name' interactively select a text printer. |
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
391 ;; `pr-ps-utility' interactively select a PostScript utility. |
49646 | 392 ;; `pr-show-*-setup' show current settings. |
393 ;; `pr-ps-*' deal with PostScript code generation. | |
394 ;; `pr-txt-*' deal with text generation. | |
395 ;; `pr-toggle-*' toggle on/off some boolean variable. | |
396 ;; `pr-despool-*' despool the PostScript spooling buffer. | |
397 ;; `pr-printify-*' replace nonprintable ASCII by printable ASCII | |
398 ;; representation. | |
399 ;; | |
400 ;; SUFFIX: | |
401 ;; `*-customize' customization. | |
402 ;; `*-preview' preview a PostScript file. | |
403 ;; `*-using-ghostscript' use ghostscript to print. | |
404 ;; `*-fast-fire' fast fire command (see it for documentation). | |
405 ;; `*-print' send PostScript directly to printer. | |
406 ;; `*-ps-print' send PostScript directly to printer or use | |
407 ;; ghostscript to print. It depends on | |
408 ;; `pr-print-using-ghostscript' option. | |
409 ;; | |
410 ;; INFIX/SUFFIX: | |
411 ;; `*-directory*' process a directory. | |
412 ;; `*-buffer*' process a buffer. | |
413 ;; `*-region*' process a region. | |
414 ;; `*-mode*' process a major mode (see explanation below). | |
415 ;; `*-file-*' process a PostScript file. | |
416 ;; `*-file-up-*' process a PostScript file using a filter utility. | |
417 ;; | |
418 ;; Here are some examples: | |
419 ;; | |
420 ;; `pr-ps-buffer-using-ghostscript' | |
421 ;; Use ghostscript to print a buffer. | |
422 ;; | |
423 ;; `pr-ps-file-print' | |
424 ;; Print a PostScript file. | |
425 ;; | |
426 ;; `pr-toggle-spool' | |
427 ;; Toggle spooling buffer. | |
428 ;; | |
429 ;; So you can preview through ghostview, use ghostscript to print (if you don't | |
430 ;; have a PostScript printer) or send directly to printer a PostScript code | |
431 ;; generated by `ps-print' package. | |
432 ;; | |
433 ;; Besides operating one buffer or region each time, you also can postpone | |
434 ;; previewing or printing by saving the PostScript code generated in a | |
435 ;; temporary Emacs buffer. This way you can save banner pages between | |
436 ;; successive printing. You can toggle on/off spooling by invoking | |
437 ;; `pr-toggle-spool' interactively or through menu bar. | |
438 ;; | |
439 ;; If you type, for example: | |
440 ;; | |
441 ;; C-u M-x pr-ps-buffer-print RET | |
442 ;; | |
443 ;; The `pr-ps-buffer-print' command prompts you for a n-up printing number and | |
444 ;; a file name, and save the PostScript code generated to the file name instead | |
445 ;; of sending to printer. | |
446 ;; | |
447 ;; This behavior is similar with the commands that deal with PostScript code | |
448 ;; generation, that is, with `pr-ps-*' and `pr-despool-*' commands. If | |
449 ;; spooling is on, only `pr-despool-*' commands prompt for a file name and save | |
450 ;; the PostScript code spooled in this file. | |
451 ;; | |
452 ;; Besides the behavior described above, the `*-directory*' commands also | |
453 ;; prompt for a directory and a file name regexp. So, it's possible to process | |
454 ;; all or certain files on a directory at once (see also documentation for | |
455 ;; `pr-list-directory'). | |
456 ;; | |
457 ;; `printing' has also a special way to handle some major mode through | |
458 ;; `*-mode*' commands. So it's possible to customize a major mode printing, | |
459 ;; it's only needed to declare the customization in `pr-mode-alist' (see | |
460 ;; section Options) and invoke some of `*-mode*' commands. An example for | |
461 ;; major mode usage is when you're using gnus (or mh, or rmail, etc.) and | |
462 ;; you're in the *Summary* buffer, if you forget to switch to the *Article* | |
463 ;; buffer before printing, you'll get a nicely formatted list of article | |
464 ;; subjects shows up at the printer. With major mode printing you don't need | |
465 ;; to switch from gnus *Summary* buffer first. | |
466 ;; | |
467 ;; Current global keyboard mapping for GNU Emacs is: | |
468 ;; | |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
469 ;; (global-set-key [print] 'pr-ps-fast-fire) |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
470 ;; (global-set-key [M-print] 'pr-ps-mode-using-ghostscript) |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
471 ;; (global-set-key [S-print] 'pr-ps-mode-using-ghostscript) |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
472 ;; (global-set-key [C-print] 'pr-txt-fast-fire) |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
473 ;; (global-set-key [C-M-print] 'pr-txt-fast-fire) |
49646 | 474 ;; |
475 ;; And for XEmacs is: | |
476 ;; | |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
477 ;; (global-set-key 'f22 'pr-ps-fast-fire) |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
478 ;; (global-set-key '(meta f22) 'pr-ps-mode-using-ghostscript) |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
479 ;; (global-set-key '(shift f22) 'pr-ps-mode-using-ghostscript) |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
480 ;; (global-set-key '(control f22) 'pr-txt-fast-fire) |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
481 ;; (global-set-key '(control meta f22) 'pr-txt-fast-fire) |
49646 | 482 ;; |
483 ;; As a suggestion of global keyboard mapping for some `printing' commands: | |
484 ;; | |
485 ;; (global-set-key "\C-ci" 'pr-interface) | |
486 ;; (global-set-key "\C-cbp" 'pr-ps-buffer-print) | |
487 ;; (global-set-key "\C-cbx" 'pr-ps-buffer-preview) | |
488 ;; (global-set-key "\C-cbb" 'pr-ps-buffer-using-ghostscript) | |
489 ;; (global-set-key "\C-crp" 'pr-ps-region-print) | |
490 ;; (global-set-key "\C-crx" 'pr-ps-region-preview) | |
491 ;; (global-set-key "\C-crr" 'pr-ps-region-using-ghostscript) | |
492 ;; | |
493 ;; | |
494 ;; Options | |
495 ;; ------- | |
496 ;; | |
497 ;; Below it's shown a brief description of `printing' options, please, see the | |
498 ;; options declaration in the code for a long documentation. | |
499 ;; | |
500 ;; `pr-path-style' Specify which path style to use for external | |
501 ;; commands. | |
502 ;; | |
503 ;; `pr-path-alist' Specify an alist for command paths. | |
504 ;; | |
505 ;; `pr-txt-name' Specify a printer for printing a text file. | |
506 ;; | |
507 ;; `pr-txt-printer-alist' Specify an alist of all text printers. | |
508 ;; | |
509 ;; `pr-ps-name' Specify a printer for printing a PostScript | |
510 ;; file. | |
511 ;; | |
512 ;; `pr-ps-printer-alist' Specify an alist for all PostScript printers. | |
513 ;; | |
514 ;; `pr-temp-dir' Specify a directory for temporary files during | |
515 ;; printing. | |
516 ;; | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
517 ;; `pr-ps-temp-file' Specify PostScript temporary file name prefix. |
49646 | 518 ;; |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
519 ;; `pr-file-modes' Specify the file permission bits for newly |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
520 ;; created files. |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
521 ;; |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
522 ;; `pr-gv-command' Specify path and name of the gsview/gv |
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
523 ;; utility. |
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
524 ;; |
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
525 ;; `pr-gs-command' Specify path and name of the ghostscript |
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
526 ;; utility. |
49646 | 527 ;; |
528 ;; `pr-gs-switches' Specify ghostscript switches. | |
529 ;; | |
530 ;; `pr-gs-device' Specify ghostscript device switch value. | |
531 ;; | |
532 ;; `pr-gs-resolution' Specify ghostscript resolution switch value. | |
533 ;; | |
534 ;; `pr-print-using-ghostscript' Non-nil means print using ghostscript. | |
535 ;; | |
536 ;; `pr-faces-p' Non-nil means print with face attributes. | |
537 ;; | |
538 ;; `pr-spool-p' Non-nil means spool printing in a buffer. | |
539 ;; | |
540 ;; `pr-file-landscape' Non-nil means print PostScript file in | |
541 ;; landscape orientation. | |
542 ;; | |
543 ;; `pr-file-duplex' Non-nil means print PostScript file in duplex | |
544 ;; mode. | |
545 ;; | |
546 ;; `pr-file-tumble' Non-nil means print PostScript file in tumble | |
547 ;; mode. | |
548 ;; | |
549 ;; `pr-auto-region' Non-nil means region is automagically detected. | |
550 ;; | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
551 ;; `pr-auto-mode' Non-nil means major-mode specific printing is |
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
552 ;; prefered over normal printing. |
49646 | 553 ;; |
554 ;; `pr-mode-alist' Specify an alist for a major-mode and printing | |
555 ;; function. | |
556 ;; | |
557 ;; `pr-ps-utility' Specify PostScript utility processing. | |
558 ;; | |
559 ;; `pr-ps-utility-alist' Specify an alist for PostScript utility | |
560 ;; processing. | |
561 ;; | |
562 ;; `pr-menu-lock' Non-nil means menu is locked while selecting | |
563 ;; toggle options. | |
564 ;; | |
565 ;; `pr-menu-char-height' Specify menu char height in pixels. | |
566 ;; | |
567 ;; `pr-menu-char-width' Specify menu char width in pixels. | |
568 ;; | |
569 ;; `pr-setting-database' Specify an alist for settings in general. | |
570 ;; | |
571 ;; `pr-visible-entry-list' Specify a list of Printing menu visible | |
572 ;; entries. | |
573 ;; | |
574 ;; `pr-delete-temp-file' Non-nil means delete temporary files. | |
575 ;; | |
576 ;; `pr-list-directory' Non-nil means list directory when processing a | |
577 ;; directory. | |
578 ;; | |
579 ;; `pr-buffer-name' Specify the name of the buffer interface for | |
580 ;; printing package. | |
581 ;; | |
582 ;; `pr-buffer-name-ignore' Specify a regexp list for buffer names to be | |
583 ;; ignored in interface buffer. | |
584 ;; | |
585 ;; `pr-buffer-verbose' Non-nil means to be verbose when editing a | |
586 ;; field in interface buffer. | |
587 ;; | |
588 ;; To set the above options you may: | |
589 ;; | |
590 ;; a) insert the code in your ~/.emacs, like: | |
591 ;; | |
592 ;; (setq pr-faces-p t) | |
593 ;; | |
594 ;; This way always keep your default settings when you enter a new Emacs | |
595 ;; session. | |
596 ;; | |
597 ;; b) or use `set-variable' in your Emacs session, like: | |
598 ;; | |
599 ;; M-x set-variable RET pr-faces-p RET t RET | |
600 ;; | |
601 ;; This way keep your settings only during the current Emacs session. | |
602 ;; | |
603 ;; c) or use customization, for example: | |
604 ;; click on menu-bar *Help* option, | |
605 ;; then click on *Customize*, | |
606 ;; then click on *Browse Customization Groups*, | |
607 ;; expand *PostScript* group, | |
608 ;; expand *Printing* group | |
609 ;; and then customize `printing' options. | |
610 ;; Through this way, you may choose if the settings are kept or not when | |
611 ;; you leave out the current Emacs session. | |
612 ;; | |
613 ;; d) or see the option value: | |
614 ;; | |
615 ;; C-h v pr-faces-p RET | |
616 ;; | |
617 ;; and click the *customize* hypertext button. | |
618 ;; Through this way, you may choose if the settings are kept or not when | |
619 ;; you leave out the current Emacs session. | |
620 ;; | |
621 ;; e) or invoke: | |
622 ;; | |
623 ;; M-x pr-customize RET | |
624 ;; | |
625 ;; and then customize `printing' options. | |
626 ;; Through this way, you may choose if the settings are kept or not when | |
627 ;; you leave out the current Emacs session. | |
628 ;; | |
629 ;; f) or use menu bar, for example: | |
630 ;; click on menu-bar *File* option, | |
631 ;; then click on *Printing*, | |
632 ;; then click on *Customize*, | |
633 ;; then click on *printing* | |
634 ;; and then customize `printing' options. | |
635 ;; Through this way, you may choose if the settings are kept or not when | |
636 ;; you leave out the current Emacs session. | |
637 ;; | |
638 ;; | |
639 ;; Menu Layout | |
640 ;; ----------- | |
641 ;; | |
642 ;; The `printing' menu (Tools/Printing or File/Print) has the following layout: | |
643 ;; | |
644 ;; +-----------------------------+ | |
645 ;; A 0 | Printing Interface | | |
646 ;; +-----------------------------+ +-A---------+ +-B------+ | |
647 ;; I 1 | PostScript Preview >|-------|Directory >|-----|1-up | | |
648 ;; 2 | PostScript Print >|---- A |Buffer >|-- B |2-up | | |
649 ;; 3 | PostScript Printer: name >|---- C |Region >|-- B |4-up | | |
650 ;; +-----------------------------+ |Mode >|-- B |Other...| | |
651 ;; II 4 | Printify >|-----\ |File >|--\ +--------+ | |
652 ;; 5 | Print >|---\ | |Despool... | | | |
653 ;; 6 | Text Printer: name >|-\ | | +-----------+ | | |
654 ;; +-----------------------------+ | | | +---------+ +------------+ | |
54210
602769168263
Replace "As Is..." in PostScript file print/preview by "No Preprocessing...".
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54209
diff
changeset
|
655 ;; III 7 |[ ]Landscape | | | \-|Directory| | No Prep... | Ia |
49646 | 656 ;; 8 |[ ]Print Header | | | |Buffer | +------------+ Ib |
657 ;; 9 |[ ]Print Header Frame | | | |Region | | name >|- C | |
658 ;; 10 |[ ]Line Number | | | +---------+ +------------+ | |
659 ;; 11 |[ ]Zebra Stripes | | | +---------+ | 1-up... | Ic | |
660 ;; 12 |[ ]Duplex | | \---|Directory| | 2-up... | | |
661 ;; 13 |[ ]Tumble | \--\ |Buffer | | 4-up... | | |
662 ;; 14 |[ ]Upside-Down | | |Region | | Other... | | |
663 ;; 15 | Print All Pages >|--\ | |Mode | +------------+ | |
664 ;; +-----------------------------+ | | +---------+ |[ ]Landscape| Id | |
665 ;; IV 16 |[ ]Spool Buffer | | | +-C-------+ |[ ]Duplex | Ie | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
666 ;; 17 |[ ]Print with faces | | \--|( )name A| |[ ]Tumble | If |
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
667 ;; 18 |[ ]Print via Ghostscript | | |( )name B| +------------+ |
49646 | 668 ;; +-----------------------------+ | |... | |
669 ;; V 19 |[ ]Auto Region | | |(*)name | | |
670 ;; 20 |[ ]Auto Mode | | |... | | |
671 ;; 21 |[ ]Menu Lock | | +---------+ +--------------+ | |
672 ;; +-----------------------------+ \------------------|(*)All Pages | | |
673 ;; VI 22 | Customize >|--- D +-D------+ |( )Even Pages | | |
674 ;; 23 | Show Settings >|-------|printing| |( )Odd Pages | | |
675 ;; 24 | Help | |ps-print| |( )Even Sheets| | |
676 ;; +-----------------------------+ |lpr | |( )Odd Sheets | | |
677 ;; +--------+ +--------------+ | |
678 ;; | |
679 ;; See `pr-visible-entry-list' for hiding some parts of the menu. | |
680 ;; | |
681 ;; The menu has the following sections: | |
682 ;; | |
683 ;; A. Interface: | |
684 ;; | |
685 ;; 0. You can use a buffer interface instead of menus. It looks like the | |
686 ;; customization buffer. Basically, it has the same options found in the | |
687 ;; menu and some extra options, all this on a buffer. | |
688 ;; | |
689 ;; I. PostScript printing: | |
690 ;; | |
691 ;; 1. You can generate a PostScript file (if you type C-u before activating | |
692 ;; menu) or PostScript temporary file for a directory, a buffer, a region | |
693 ;; or a major mode, choosing 1-up, 2-up, 4-up or any other n-up printing; | |
694 ;; after file generation, ghostview is activated using the file generated | |
695 ;; as argument. This option is disabled if spooling is on (option 16). | |
696 ;; Also, if you already have a PostScript file you can preview it. | |
697 ;; Instead of previewing each buffer, region or major mode at once, you | |
698 ;; can save temporarily the PostScript code generated in a buffer and | |
699 ;; preview it later. The option `Despool...' despools the PostScript | |
700 ;; spooling buffer in a temporary file and uses ghostview to preview it. | |
701 ;; If you type C-u before choosing this option, the PostScript code | |
702 ;; generated is saved in a file instead of saving in a temporary file. | |
703 ;; To spool the PostScript code generated you need to turn on the option | |
704 ;; 16. The option `Despool...' is enabled if spooling is on (option | |
705 ;; 16). | |
706 ;; | |
707 ;; NOTE 1: It's possible to customize a major mode printing, just declare | |
708 ;; the customization in `pr-mode-alist' and invoke some of | |
709 ;; `*-mode*' commands or select Mode option in Printing menu. An | |
710 ;; example for major mode usage is when you're using gnus (or mh, | |
711 ;; or rmail, etc.) and you're in the *Summary* buffer, if you | |
712 ;; forget to switch to the *Article* buffer before printing, | |
713 ;; you'll get a nicely formatted list of article subjects shows | |
714 ;; up at the printer. With major mode printing you don't need to | |
715 ;; switch from gnus *Summary* buffer first. | |
716 ;; | |
717 ;; NOTE 2: There are the following options for PostScript file | |
718 ;; processing: | |
54210
602769168263
Replace "As Is..." in PostScript file print/preview by "No Preprocessing...".
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54209
diff
changeset
|
719 ;; Ia. Print the file *No Preprocessing*, that is, send it |
602769168263
Replace "As Is..." in PostScript file print/preview by "No Preprocessing...".
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54209
diff
changeset
|
720 ;; directly to PostScript printer. |
49646 | 721 ;; Ib. PostScript utility processing selection. |
722 ;; See `pr-ps-utility-alist' and `pr-setting-database' for | |
723 ;; documentation. | |
724 ;; Ic. Do n-up processing before printing. | |
725 ;; Id. Toggle on/off landscape for PostScript file processing. | |
726 ;; Ie. Toggle on/off duplex for PostScript file processing. | |
727 ;; If. Toggle on/off tumble for PostScript file processing. | |
728 ;; | |
729 ;; NOTE 3: Don't forget to download and install the utilities declared on | |
730 ;; `pr-ps-utility-alist'. | |
731 ;; | |
732 ;; 2. Operate the same way as option 1, but it sends directly the PostScript | |
733 ;; code (or put in a file, if you've typed C-u) or it uses ghostscript to | |
734 ;; print the PostScript file generated. It depends on option 18, if it's | |
735 ;; turned on, it uses ghostscript; otherwise, it sends directly to | |
736 ;; printer. If spooling is on (option 16), the PostScript code is saved | |
737 ;; temporarily in a buffer instead of printing it or saving it in a file. | |
738 ;; Also, if you already have a PostScript file you can print it. Instead | |
739 ;; of printing each buffer, region or major mode at once, you can save | |
740 ;; temporarily the PostScript code generated in a buffer and print it | |
741 ;; later. The option `Despool...' despools the PostScript spooling | |
742 ;; buffer directly on a printer. If you type C-u before choosing this | |
743 ;; option, the PostScript code generated is saved in a file instead of | |
744 ;; sending to printer. To spool the PostScript code generated you need | |
745 ;; to turn on the option 16. This option is enabled if spooling is on | |
746 ;; (option 16). See also the NOTE 1, NOTE 2 and NOTE 3 on option 1. | |
747 ;; | |
748 ;; 3. You can select a new PostScript printer to send PostScript code | |
749 ;; generated. For selection it's used all PostScript printers defined | |
750 ;; in `pr-ps-printer-alist' variable (see it for documentation). | |
751 ;; See also `pr-setting-database'. | |
752 ;; | |
753 ;; II. Text printing: | |
754 ;; | |
755 ;; 4. If you have control characters (character code from \000 to \037) in a | |
756 ;; buffer and you want to print them in a text printer, select this | |
757 ;; option. All control characters in your buffer or region will be | |
758 ;; replaced by a printable representation. The printable representations | |
759 ;; use ^ (for ASCII control characters) or hex. The characters tab, | |
760 ;; linefeed, space, return and formfeed are not affected. You don't need | |
761 ;; to select this option if you use any option of section I, the | |
762 ;; PostScript engine treats control characters properly. | |
763 ;; | |
764 ;; 5. If you want to print a directory, buffer, region or major mode in a | |
765 ;; text printer, select this option. See also the NOTE 1 on option 1. | |
766 ;; | |
767 ;; 6. You can select a new text printer to send text generated. For | |
768 ;; selection it's used all text printers defined in | |
769 ;; `pr-txt-printer-alist' variable (see it for documentation). | |
770 ;; See also `pr-setting-database'. | |
771 ;; | |
772 ;; III. PostScript page toggle options: | |
773 ;; | |
774 ;; 7. If you want a PostScript landscape printing, turn on this option. | |
775 ;; | |
776 ;; 8. If you want to have a header in each page in your PostScript code, | |
777 ;; turn on this option. | |
778 ;; | |
779 ;; 9. If you want to draw a gaudy frame around the header, turn on this | |
780 ;; option. This option is enabled if print header is on (option 8). | |
781 ;; | |
782 ;; 10. If you want that the line number is printed in your PostScript code, | |
783 ;; turn on this option. | |
784 ;; | |
785 ;; 11. If you want background zebra stripes in your PostScript code, turn on | |
786 ;; this option. | |
787 ;; | |
788 ;; 12. If you want a duplex printing and your PostScript printer has this | |
789 ;; feature, turn on this option. | |
790 ;; | |
791 ;; 13. If you turned on duplex printing, you can choose if you want to have | |
792 ;; a printing suitable for binding on the left or right (tumble off), or | |
793 ;; to have a printing suitable for binding at top or bottom (tumble on). | |
794 ;; This option is enabled if duplex is on (option 12). | |
795 ;; | |
796 ;; 14. If you want a PostScript upside-down printing, turn on this option. | |
797 ;; | |
798 ;; 15. With this option, you can choose if you want to print all pages, odd | |
799 ;; pages, even pages, odd sheets or even sheets. | |
800 ;; See also `ps-even-or-odd-pages'. | |
801 ;; | |
802 ;; IV. PostScript processing toggle options: | |
803 ;; | |
804 ;; 16. If you want to spool the PostScript code generated, turn on this | |
805 ;; option. To spool the PostScript code generated use option 2. You | |
806 ;; can despool later by choosing option 1 or 2, sub-option `Despool...'. | |
807 ;; | |
808 ;; 17. If you use colors in your buffers and want to see these colors on | |
809 ;; your PostScript code generated, turn on this option. If you have a | |
810 ;; black/white PostScript printer, these colors are displayed in gray | |
811 ;; scale by PostScript printer interpreter. | |
812 ;; | |
813 ;; 18. If you don't have a PostScript printer to send PostScript files, turn | |
814 ;; on this option. When this option is on, the ghostscript is used to | |
815 ;; print PostScript files. In GNU or Unix system, if ghostscript is set | |
816 ;; as a PostScript filter, you don't need to turn on this option. | |
817 ;; | |
818 ;; V. Printing customization: | |
819 ;; | |
820 ;; 19. If you want that region is automagically detected, turn on this | |
821 ;; option. Note that this will only work if you're using transient mark | |
822 ;; mode. When this option is on, the `*-buffer*' commands will behave | |
823 ;; like `*-region*' commands, that is, `*-buffer*' commands will print | |
824 ;; only the region marked instead of all buffer. | |
825 ;; | |
826 ;; 20. Turn this option on if you want that when current major-mode is | |
827 ;; declared in `pr-mode-alist', the `*-buffer*' and `*-region*' commands | |
828 ;; behave like `*-mode*' commands. | |
829 ;; | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
830 ;; 21. If you want that Printing menu stays open while you are setting |
49646 | 831 ;; toggle options, turn on this option. The variables |
832 ;; `pr-menu-char-height' and `pr-menu-char-width' are used to guess the | |
833 ;; menu position, so don't forget to adjust these variables if menu | |
834 ;; position is not ok. | |
835 ;; | |
836 ;; VI. Customization: | |
837 ;; | |
838 ;; 22. Besides all options in section III, IV and V, you can customize much | |
839 ;; more PostScript options in `ps-print' option. Or you can customize | |
840 ;; some `lpr' options for text printing. Or customize `printing' | |
841 ;; options. | |
842 ;; | |
843 ;; 23. Show current settings for `printing', `ps-print' or `lpr'. | |
844 ;; | |
845 ;; 24. Quick help for printing menu layout. | |
846 ;; | |
847 ;; | |
848 ;; Option Settings | |
849 ;; --------------- | |
850 ;; | |
851 ;; Below it's shown only the main options that affect all `printing' package. | |
852 ;; Check all the settings below *BEFORE* running `printing' commands. | |
853 ;; | |
854 ;; * Example of setting for GNU or Unix system: | |
855 ;; | |
856 ;; (require 'printing) | |
857 ;; (setq pr-path-alist | |
858 ;; '((unix "." "~/bin" ghostview mpage PATH) | |
859 ;; (ghostview "$HOME/bin/gsview-dir") | |
860 ;; (mpage "$HOME/bin/mpage-dir") | |
861 ;; )) | |
862 ;; (setq pr-txt-name 'prt_06a) | |
863 ;; (setq pr-txt-printer-alist | |
864 ;; '((prt_06a "lpr" nil "prt_06a") | |
865 ;; (prt_07c nil nil "prt_07c") | |
866 ;; )) | |
867 ;; (setq pr-ps-name 'lps_06b) | |
868 ;; (setq pr-ps-printer-alist | |
869 ;; '((lps_06b "lpr" nil "-P" "lps_06b") | |
870 ;; (lps_07c "lpr" nil nil "lps_07c") | |
871 ;; (lps_08c nil nil nil "lps_08c") | |
872 ;; )) | |
873 ;; (setq pr-temp-dir "/tmp/") | |
874 ;; (setq pr-gv-command "gv") | |
875 ;; (setq pr-gs-command "gs") | |
876 ;; (setq pr-gs-switches '("-q -dNOPAUSE -I/usr/share/ghostscript/5.10")) | |
877 ;; (setq pr-gs-device "uniprint") | |
878 ;; (setq pr-gs-resolution 300) | |
879 ;; (setq pr-ps-utility 'mpage) | |
880 ;; (setq pr-ps-utility-alist | |
881 ;; '((mpage "mpage" nil "-b%s" "-%d" "-l" "-t" "-T" ">" nil) | |
882 ;; (psnup "psnup" ("-q") "-P%s" "-%d" "-l" nil nil " " nil | |
883 ;; (inherits-from: . no-duplex)) | |
884 ;; )) | |
885 ;; (setq pr-setting-database | |
886 ;; '((no-duplex | |
887 ;; nil nil nil | |
888 ;; (pr-file-duplex . nil) | |
889 ;; (pr-file-tumble . nil)) | |
890 ;; )) | |
891 ;; (pr-update-menus t) ; update now printer and utility menus | |
892 ;; | |
893 ;; * Example of setting for Windows system: | |
894 ;; | |
895 ;; (require 'printing) | |
896 ;; (setq pr-path-alist | |
897 ;; '((windows "c:/applications/executables" PATH ghostview mpage) | |
898 ;; (ghostview "c:/gs/gsview-dir") | |
899 ;; (mpage "c:/mpage-dir") | |
900 ;; )) | |
901 ;; (setq pr-txt-name 'prt_06a) | |
902 ;; (setq pr-txt-printer-alist | |
903 ;; '((prt_06a "print" nil "/D:\\\\printers\\prt_06a") | |
904 ;; (prt_07c nil nil "/D:\\\\printers\\prt_07c") | |
905 ;; (PRN "" nil "PRN") | |
906 ;; (standard "redpr.exe" nil "") | |
907 ;; )) | |
908 ;; (setq pr-ps-name 'lps_06b) | |
909 ;; (setq pr-ps-printer-alist | |
910 ;; '((lps_06a "print" nil "/D:" "\\\\printers\\lps_06a") | |
911 ;; (lps_06b "print" nil nil "\\\\printers\\lps_06b") | |
912 ;; (lps_07c "print" nil "" "/D:\\\\printers\\lps_07c") | |
913 ;; (lps_08c nil nil nil "\\\\printers\\lps_08c") | |
63328
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
914 ;; (b/w "gsprint" ("-all" "-twoup") "-printer " "b/w-pr-name") |
49646 | 915 ;; (LPT1 "" nil "" "LPT1:") |
916 ;; (PRN "" nil "" "PRN") | |
917 ;; (standard "redpr.exe" nil "" "") | |
918 ;; )) | |
919 ;; (setq pr-temp-dir "C:/WINDOWS/TEMP/") | |
920 ;; (setq pr-gv-command "c:/gs/gsview/gsview32.exe") | |
921 ;; (setq pr-gs-command "c:/gs/gswin32.exe") | |
922 ;; (setq pr-gs-switches '("-q -dNOPAUSE -Ic:/gs/gs5.50;c:/gs/gs5.50/fonts")) | |
923 ;; (setq pr-gs-device "mswinpr2") | |
924 ;; (setq pr-gs-resolution 300) | |
925 ;; (setq pr-ps-utility 'psnup) | |
926 ;; (setq pr-ps-utility-alist | |
927 ;; '((psnup "c:/psutils/psnup" ("-q") "-P%s" "-%d" "-l" nil nil " " | |
928 ;; nil (inherits-from: . no-duplex)) | |
929 ;; )) | |
930 ;; (setq pr-setting-database | |
931 ;; '((no-duplex | |
932 ;; nil nil nil | |
933 ;; (pr-file-duplex . nil) | |
934 ;; (pr-file-tumble . nil)) | |
935 ;; )) | |
936 ;; (pr-update-menus t) ; update now printer and utility menus | |
937 ;; | |
938 ;; NOTE: Don't forget to download and install the utilities declared on | |
939 ;; `pr-ps-utility-alist'. | |
940 ;; | |
941 ;; | |
942 ;; Utilities | |
943 ;; --------- | |
944 ;; | |
945 ;; `printing' package has the following utilities: | |
946 ;; | |
947 ;; `pr-setup' Return the current `printing' setup. | |
948 ;; | |
949 ;; `lpr-setup' Return the current `lpr' setup. | |
950 ;; | |
951 ;; `pr-update-menus' Update utility, PostScript and text printer menus. | |
952 ;; | |
63328
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
953 ;; `pr-menu-bind' Install `printing' menu in the menubar. |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
954 ;; |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
955 ;; |
49646 | 956 ;; Below are some URL where you can find good utilities. |
957 ;; | |
958 ;; * For `printing' package: | |
959 ;; | |
73827
985f3831f360
Fix Print submenu creation
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
73770
diff
changeset
|
960 ;; printing `http://www.emacswiki.org/cgi-bin/emacs/download/printing.el' |
75712
f24fee7e36d4
Fix ps-print links
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
75347
diff
changeset
|
961 ;; ps-print `http://www.emacswiki.org/cgi-bin/wiki/PsPrintPackage' |
49646 | 962 ;; |
963 ;; * For GNU or Unix system: | |
964 ;; | |
965 ;; gs, gv `http://www.gnu.org/software/ghostscript/ghostscript.html' | |
966 ;; enscript `http://people.ssh.fi/mtr/genscript/' | |
63328
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
967 ;; psnup `http://www.knackered.org/angus/psutils/' |
49646 | 968 ;; mpage `http://www.mesa.nl/pub/mpage/' |
969 ;; | |
970 ;; * For Windows system: | |
971 ;; | |
972 ;; gswin32, gsview32 | |
973 ;; `http://www.gnu.org/software/ghostscript/ghostscript.html' | |
57187
c9052d462541
Doc fix (gsprint).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
56578
diff
changeset
|
974 ;; gsprint `http://www.cs.wisc.edu/~ghost/gsview/gsprint.htm'. |
49646 | 975 ;; enscript `http://people.ssh.fi/mtr/genscript/' |
63328
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
976 ;; psnup `http://gnuwin32.sourceforge.net/packages/psutils.htm' |
49646 | 977 ;; redmon `http://www.cs.wisc.edu/~ghost/redmon/' |
978 ;; | |
979 ;; | |
980 ;; Acknowledgments | |
981 ;; --------------- | |
982 ;; | |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
983 ;; Thanks to Stefan Monnier <monnier@iro.umontreal.ca> for GNU Emacs and XEmacs |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
984 ;; printing menu (in `pr-menu-spec') merging suggestion. |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
985 ;; |
57187
c9052d462541
Doc fix (gsprint).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
56578
diff
changeset
|
986 ;; Thanks to Lennart Borgman <lennart.borgman.073@student.lu.se> for gsprint |
c9052d462541
Doc fix (gsprint).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
56578
diff
changeset
|
987 ;; suggestion (see tip 5 in section Tips). |
c9052d462541
Doc fix (gsprint).
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
56578
diff
changeset
|
988 ;; |
56405
10b68aa88abe
Doc fix. Change name of some funs.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
56390
diff
changeset
|
989 ;; Thanks to Drew Adams <drew.adams@oracle.com> for suggestions: |
10b68aa88abe
Doc fix. Change name of some funs.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
56390
diff
changeset
|
990 ;; - directory processing. |
10b68aa88abe
Doc fix. Change name of some funs.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
56390
diff
changeset
|
991 ;; - `pr-path-alist' variable. |
10b68aa88abe
Doc fix. Change name of some funs.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
56390
diff
changeset
|
992 ;; - doc fix. |
10b68aa88abe
Doc fix. Change name of some funs.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
56390
diff
changeset
|
993 ;; - a lot of tests on Windows. |
49646 | 994 ;; |
995 ;; Thanks to Fred Labrosse <f.labrosse@maths.bath.ac.uk> for XEmacs tests. | |
996 ;; | |
997 ;; Thanks to Klaus Berndl <klaus.berndl@sdm.de> for invaluable help/debugging | |
998 ;; and for suggestions: | |
999 ;; - even/odd pages printing. | |
1000 ;; - ghostscript parameters for `pr-ps-printer-alist'. | |
1001 ;; - default printer name. | |
1002 ;; - completion functions. | |
1003 ;; - automagic region detection. | |
1004 ;; - menu entry hiding. | |
1005 ;; - fast fire PostScript printing command. | |
1006 ;; - `pr-path-style' variable. | |
1007 ;; | |
1008 ;; Thanks to Kim F. Storm <storm@filanet.dk> for beta-test and for suggestions: | |
1009 ;; - PostScript Print and PostScript Print Preview merge. | |
1010 ;; - Tools/Printing menu. | |
1011 ;; - replace *-using-preview by *-using-ghostscript. | |
1012 ;; - printer selection. | |
1013 ;; - extra parameters for `pr-ps-printer-alist'. | |
1014 ;; | |
1015 ;; Thanks to: | |
1016 ;; Frederic Corne <frederic.corne@erli.fr> print-nt.el | |
1017 ;; Tom Vogels <tov@ece.cmu.edu> mh-e-init.el | |
1018 ;; Matthew O. Persico <mpersico@erols.com> win32-ps-print.el | |
1019 ;; Volker Franz <volker.franz@tuebingen.mpg.de> ps-print-interface.el | |
1020 ;; And to all people who contributed with them. | |
1021 ;; | |
1022 ;; | |
1023 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
1024 | |
1025 ;;; Code: | |
1026 | |
1027 | |
82278
e2fa2bd67693
Require lpr and ps-print when loading printing package
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
82253
diff
changeset
|
1028 (require 'lpr) |
e2fa2bd67693
Require lpr and ps-print when loading printing package
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
82253
diff
changeset
|
1029 (require 'ps-print) |
49646 | 1030 |
1031 | |
56390
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
1032 (and (string< ps-print-version "6.6.4") |
56578
a36e2d80b510
(toplevel, pr-ps-fast-fire, pr-ps-set-utility)
John Paul Wallington <jpw@pobox.com>
parents:
56493
diff
changeset
|
1033 (error "`printing' requires `ps-print' package version 6.6.4 or later")) |
49646 | 1034 |
1035 | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
1036 (defconst pr-cygwin-system |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
1037 (and ps-windows-system (getenv "OSTYPE") |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
1038 (string-match "cygwin" (getenv "OSTYPE")))) |
49646 | 1039 |
1040 | |
1041 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
1042 ;; To avoid compilation gripes | |
1043 | |
1044 | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
1045 (or (fboundp 'subst-char-in-string) ; hacked from subr.el |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
1046 (defun subst-char-in-string (fromchar tochar string &optional inplace) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
1047 "Replace FROMCHAR with TOCHAR in STRING each time it occurs. |
49646 | 1048 Unless optional argument INPLACE is non-nil, return a new string." |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
1049 (let ((i (length string)) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
1050 (newstr (if inplace string (copy-sequence string)))) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
1051 (while (> (setq i (1- i)) 0) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
1052 (if (eq (aref newstr i) fromchar) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
1053 (aset newstr i tochar))) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
1054 newstr))) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
1055 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
1056 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
1057 (or (fboundp 'make-temp-file) ; hacked from subr.el |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
1058 (defun make-temp-file (prefix &optional dir-flag suffix) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
1059 "Create a temporary file. |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
1060 The returned file name (created by appending some random characters at the end |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
1061 of PREFIX, and expanding against `temporary-file-directory' if necessary), |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
1062 is guaranteed to point to a newly created empty file. |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
1063 You can then use `write-region' to write new data into the file. |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
1064 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
1065 If DIR-FLAG is non-nil, create a new empty directory instead of a file. |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
1066 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
1067 If SUFFIX is non-nil, add that at the end of the file name." |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
1068 (let ((umask (default-file-modes)) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
1069 file) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
1070 (unwind-protect |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
1071 (progn |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
1072 ;; Create temp files with strict access rights. It's easy to |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
1073 ;; loosen them later, whereas it's impossible to close the |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
1074 ;; time-window of loose permissions otherwise. |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
1075 (set-default-file-modes ?\700) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
1076 (while (condition-case () |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
1077 (progn |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
1078 (setq file |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
1079 (make-temp-name |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
1080 (expand-file-name prefix temporary-file-directory))) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
1081 (if suffix |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
1082 (setq file (concat file suffix))) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
1083 (if dir-flag |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
1084 (make-directory file) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
1085 (write-region "" nil file nil 'silent nil 'excl)) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
1086 nil) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
1087 (file-already-exists t)) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
1088 ;; the file was somehow created by someone else between |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
1089 ;; `make-temp-name' and `write-region', let's try again. |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
1090 nil) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
1091 file) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
1092 ;; Reset the umask. |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
1093 (set-default-file-modes umask))))) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
1094 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
1095 |
80951 | 1096 |
49646 | 1097 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1098 ;; User Interface (II) | |
1099 | |
1100 | |
1101 (defcustom pr-path-alist | |
1102 '((unix PATH) | |
1103 (cygwin PATH) | |
1104 (windows PATH)) | |
1105 "*Specify an alist for command paths. | |
1106 | |
1107 It's used to find commands used for printing package, like gv, gs, gsview.exe, | |
1108 mpage, print.exe, etc. See also `pr-command' function. | |
1109 | |
1110 Each element has the form: | |
1111 | |
1112 (ENTRY DIRECTORY...) | |
1113 | |
1114 Where: | |
1115 | |
1116 ENTRY It's a symbol, used to identify this entry. | |
1117 There must exist at least one of the following entries: | |
1118 | |
1119 unix this entry is used when Emacs is running on GNU or | |
1120 Unix system. | |
1121 | |
1122 cygwin this entry is used when Emacs is running on Windows | |
1123 95/98/NT/2000 with Cygwin. | |
1124 | |
1125 windows this entry is used when Emacs is running on Windows | |
1126 95/98/NT/2000. | |
1127 | |
1128 DIRECTORY It should be a string or a symbol. If it's a symbol, it should | |
1129 exist an equal entry in `pr-path-alist'. If it's a string, | |
1130 it's considered a directory specification. | |
1131 | |
1132 The directory specification may contain: | |
1133 $var environment variable expansion | |
1134 ~/ tilde expansion | |
1135 ./ current directory | |
1136 ../ previous directory | |
1137 | |
1138 For example, let's say the home directory is /home/my and the | |
1139 current directory is /home/my/dir, so: | |
1140 | |
1141 THE ENTRY IS EXPANDED TO | |
1142 ~/entry /home/my/entry | |
1143 ./entry /home/my/dir/entry | |
1144 ../entry /home/my/entry | |
1145 $HOME/entry /home/my/entry | |
1146 $HOME/~/other/../my/entry /home/my/entry | |
1147 | |
1148 SPECIAL SYMBOL: If the symbol `PATH' is used in the directory | |
1149 list and there isn't a `PATH' entry in `pr-path-alist' or the | |
1150 `PATH' entry has a null directory list, the PATH environment | |
1151 variable is used. | |
1152 | |
1153 Examples: | |
1154 | |
1155 * On GNU or Unix system: | |
1156 | |
1157 '((unix \".\" \"~/bin\" ghostview mpage PATH) | |
1158 (ghostview \"$HOME/bin/gsview-dir\") | |
1159 (mpage \"$HOME/bin/mpage-dir\") | |
1160 ) | |
1161 | |
1162 * On Windows system: | |
1163 | |
1164 '((windows \"c:/applications/executables\" PATH ghostview mpage) | |
1165 (ghostview \"c:/gs/gsview-dir\") | |
1166 (mpage \"c:/mpage-dir\") | |
1167 )" | |
1168 :type '(repeat | |
1169 (cons :tag "" | |
1170 (symbol :tag "Identifier ") | |
1171 (repeat :tag "Directory List" | |
1172 (choice :menu-tag "Directory" | |
1173 :tag "Directory" | |
1174 (string :value "") | |
1175 (symbol :value symbol))))) | |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
1176 :version "20" |
49646 | 1177 :group 'printing) |
1178 | |
1179 | |
1180 (defcustom pr-txt-name 'default | |
1181 "*Specify a printer for printing a text file. | |
1182 | |
1183 The printer name symbol should be defined on `pr-txt-printer-alist' (see it for | |
1184 documentation). | |
1185 | |
1186 This variable should be modified by customization engine. If this variable is | |
1187 modified by other means (for example, a lisp function), use `pr-update-menus' | |
1188 function (see it for documentation) to update text printer menu." | |
1189 :type 'symbol | |
1190 :set 'pr-txt-name-custom-set | |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
1191 :version "20" |
49646 | 1192 :group 'printing) |
1193 | |
1194 | |
1195 (defcustom pr-txt-printer-alist | |
1196 (list (list 'default lpr-command nil | |
1197 (cond ((boundp 'printer-name) printer-name) | |
1198 (ps-windows-system "PRN") | |
1199 (t nil) | |
1200 ))) | |
1201 ;; Examples: | |
1202 ;; * On GNU or Unix system: | |
1203 ;; '((prt_06a "lpr" nil "prt_06a") | |
1204 ;; (prt_07c nil nil "prt_07c") | |
1205 ;; ) | |
1206 ;; * On Windows system: | |
1207 ;; '((prt_06a "print" nil "/D:\\\\printers\\prt_06a") | |
1208 ;; (prt_07c nil nil "/D:\\\\printers\\prt_07c") | |
1209 ;; (PRN "" nil "PRN") | |
1210 ;; (standard "redpr.exe" nil "") | |
1211 ;; ) | |
1212 "*Specify an alist of all text printers (text printer database). | |
1213 | |
1214 The alist element has the form: | |
1215 | |
1216 (SYMBOL COMMAND SWITCHES NAME) | |
1217 | |
1218 Where: | |
1219 | |
1220 SYMBOL It's a symbol to identify a text printer. It's for | |
1221 `pr-txt-name' variable setting and for menu selection. | |
1222 Examples: | |
1223 'prt_06a | |
1224 'my_printer | |
1225 | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
1226 COMMAND Name of the program for printing a text file. On MS-DOS and |
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
1227 MS-Windows systems, if the value is an empty string, then Emacs |
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
1228 will write directly to the printer port given by NAME (see text |
49646 | 1229 below), that is, the NAME should be something like \"PRN\" or |
1230 \"LPT1:\". | |
1231 If NAME is something like \"\\\\\\\\host\\\\share-name\" then | |
1232 COMMAND shouldn't be an empty string. | |
1233 The programs `print' and `nprint' (the standard print programs | |
1234 on Windows NT and Novell Netware respectively) are handled | |
1235 specially, using NAME as the destination for output; any other | |
1236 program is treated like `lpr' except that an explicit filename | |
1237 is given as the last argument. | |
1238 If COMMAND is nil, it's used the default printing program: | |
1239 `print' for Windows system, `lp' for lp system and `lpr' for | |
1240 all other systems. See also `pr-path-alist'. | |
1241 Examples: | |
1242 \"print\" | |
1243 \"lpr\" | |
1244 \"lp\" | |
1245 | |
1246 SWITCHES List of sexp's to pass as extra options for text printer | |
1247 program. It is recommended to set NAME (see text below) | |
1248 instead of including an explicit switch on this list. | |
1249 Example: | |
1250 . for lpr | |
1251 '(\"-#3\" \"-l\") | |
1252 nil | |
1253 | |
1254 NAME A string that specifies a text printer name. | |
1255 On Unix-like systems, a string value should be a name | |
1256 understood by lpr's -P option (or lp's -d option). | |
1257 On MS-DOS and MS-Windows systems, it is the name of a printer | |
1258 device or port. Typical non-default settings would be \"LPT1:\" | |
1259 to \"LPT3:\" for parallel printers, or \"COM1\" to \"COM4\" or | |
1260 \"AUX\" for serial printers, or \"\\\\\\\\hostname\\\\printer\" | |
1261 (or \"/D:\\\\\\\\hostname\\\\printer\") for a shared network | |
1262 printer. You can also set it to a name of a file, in which | |
1263 case the output gets appended to that file. If you want to | |
1264 discard the printed output, set this to \"NUL\". | |
1265 Examples: | |
1266 . for print.exe | |
1267 \"/D:\\\\\\\\host\\\\share-name\" | |
1268 \"LPT1:\" | |
1269 \"PRN\" | |
1270 | |
1271 . for lpr or lp | |
1272 \"share-name\" | |
1273 | |
1274 This variable should be modified by customization engine. If this variable is | |
1275 modified by other means (for example, a lisp function), use `pr-update-menus' | |
1276 function (see it for documentation) to update text printer menu. | |
1277 | |
1278 Examples: | |
1279 | |
1280 * On GNU or Unix system: | |
1281 | |
1282 '((prt_06a \"lpr\" nil \"prt_06a\") | |
1283 (prt_07c nil nil \"prt_07c\") | |
1284 ) | |
1285 | |
1286 * On Windows system: | |
1287 | |
1288 '((prt_06a \"print\" nil \"/D:\\\\\\\\printers\\\\prt_06a\") | |
1289 (prt_07c nil nil \"/D:\\\\\\\\printers\\\\prt_07c\") | |
1290 (PRN \"\" nil \"PRN\") | |
1291 (standard \"redpr.exe\" nil \"\") | |
63328
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1292 ) |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1293 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1294 Useful links: |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1295 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1296 * Information about the print command (print.exe) |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1297 `http://www.computerhope.com/printhlp.htm' |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1298 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1299 * RedMon - Redirection Port Monitor (redpr.exe) |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1300 `http://www.cs.wisc.edu/~ghost/redmon/index.htm' |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1301 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1302 * Redirection Port Monitor (redpr.exe on-line help) |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1303 `http://www.cs.wisc.edu/~ghost/redmon/en/redmon.htm' |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1304 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1305 * UNIX man pages: lpr (or type `man lpr') |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1306 `http://bama.ua.edu/cgi-bin/man-cgi?lpr' |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1307 `http://www.mediacollege.com/cgi-bin/man/page.cgi?section=all&topic=lpr' |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1308 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1309 * UNIX man pages: lp (or type `man lp') |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1310 `http://bama.ua.edu/cgi-bin/man-cgi?lp' |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1311 `http://www.mediacollege.com/cgi-bin/man/page.cgi?section=all&topic=lp' |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1312 " |
49646 | 1313 :type '(repeat |
1314 (list :tag "Text Printer" | |
1315 (symbol :tag "Printer Symbol Name") | |
1316 (string :tag "Printer Command") | |
1317 (repeat :tag "Printer Switches" | |
1318 (sexp :tag "Switch" :value "")) | |
1319 (choice :menu-tag "Printer Name" | |
1320 :tag "Printer Name" | |
1321 (const :tag "None" nil) | |
1322 string))) | |
1323 :set 'pr-alist-custom-set | |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
1324 :version "20" |
49646 | 1325 :group 'printing) |
1326 | |
1327 | |
1328 (defcustom pr-ps-name 'default | |
1329 "*Specify a printer for printing a PostScript file. | |
1330 | |
1331 This printer name symbol should be defined on `pr-ps-printer-alist' (see it for | |
1332 documentation). | |
1333 | |
1334 This variable should be modified by customization engine. If this variable is | |
1335 modified by other means (for example, a lisp function), use `pr-update-menus' | |
1336 function (see it for documentation) to update PostScript printer menu." | |
1337 :type 'symbol | |
1338 :set 'pr-ps-name-custom-set | |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
1339 :version "20" |
49646 | 1340 :group 'printing) |
1341 | |
1342 | |
1343 (defcustom pr-ps-printer-alist | |
1344 (list (list 'default lpr-command nil | |
1345 (cond (ps-windows-system nil) | |
1346 (ps-lp-system "-d") | |
1347 (t "-P")) | |
1348 (or (getenv "PRINTER") (getenv "LPDEST") ps-printer-name))) | |
1349 ;; Examples: | |
1350 ;; * On GNU or Unix system: | |
1351 ;; '((lps_06b "lpr" nil "-P" "lps_06b") | |
1352 ;; (lps_07c "lpr" nil nil "lps_07c") | |
1353 ;; (lps_08c nil nil nil "lps_08c") | |
1354 ;; ) | |
1355 ;; * On Windows system: | |
1356 ;; '((lps_06a "print" nil "/D:" "\\\\printers\\lps_06a") | |
1357 ;; (lps_06b "print" nil nil "\\\\printers\\lps_06b") | |
1358 ;; (lps_07c "print" nil "" "/D:\\\\printers\\lps_07c") | |
1359 ;; (lps_08c nil nil nil "\\\\printers\\lps_08c") | |
63328
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1360 ;; (b/w "gsprint" ("-all" "-twoup") "-printer " "b/w-pr-name") |
49646 | 1361 ;; (LPT1 "" nil "" "LPT1:") |
1362 ;; (PRN "" nil "" "PRN") | |
1363 ;; (standard "redpr.exe" nil "" "") | |
1364 ;; ) | |
1365 "*Specify an alist for all PostScript printers (PostScript printer database). | |
1366 | |
1367 The alist element has the form: | |
1368 | |
1369 (SYMBOL COMMAND SWITCHES PRINTER-SWITCH NAME DEFAULT...) | |
1370 | |
1371 Where: | |
1372 | |
1373 SYMBOL It's a symbol to identify a PostScript printer. It's for | |
1374 `pr-ps-name' variable setting and for menu selection. | |
1375 Examples: | |
1376 'prt_06a | |
1377 'my_printer | |
1378 | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
1379 COMMAND Name of the program for printing a PostScript file. On MS-DOS |
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
1380 and MS-Windows systems, if the value is an empty string then |
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
1381 Emacs will write directly to the printer port given by NAME |
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
1382 (see text below), that is, the NAME should be something like |
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
1383 \"PRN\" or \"LPT1:\". |
49646 | 1384 If NAME is something like \"\\\\\\\\host\\\\share-name\" then |
1385 COMMAND shouldn't be an empty string. | |
1386 The programs `print' and `nprint' (the standard print programs | |
1387 on Windows NT and Novell Netware respectively) are handled | |
1388 specially, using NAME as the destination for output; any other | |
1389 program is treated like `lpr' except that an explicit filename | |
1390 is given as the last argument. | |
1391 If COMMAND is nil, it's used the default printing program: | |
1392 `print' for Windows system, `lp' for lp system and `lpr' for | |
1393 all other systems. See also `pr-path-alist'. | |
1394 Examples: | |
1395 \"print\" | |
1396 \"lpr\" | |
1397 \"lp\" | |
1398 \"cp\" | |
63328
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1399 \"gsprint\" |
49646 | 1400 |
1401 SWITCHES List of sexp's to pass as extra options for PostScript printer | |
1402 program. It is recommended to set NAME (see text below) | |
1403 instead of including an explicit switch on this list. | |
1404 Example: | |
1405 . for lpr | |
1406 '(\"-#3\" \"-l\") | |
1407 nil | |
1408 | |
63328
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1409 . for gsprint.exe |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1410 '(\"-all\" \"-twoup\") |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1411 |
49646 | 1412 PRINTER-SWITCH A string that specifies PostScript printer name switch. If |
1413 it's necessary to have a space between PRINTER-SWITCH and NAME, | |
1414 it should be inserted at the end of PRINTER-SWITCH string. | |
1415 If PRINTER-SWITCH is nil, it's used the default printer name | |
1416 switch: `/D:' for Windows system, `-d' for lp system and `-P' | |
1417 for all other systems. | |
1418 Examples: | |
1419 . for lpr | |
1420 \"-P \" | |
1421 | |
1422 . for lp | |
1423 \"-d \" | |
1424 | |
1425 . for print.exe | |
1426 \"/D:\" | |
1427 | |
63328
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1428 . for gsprint.exe |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1429 \"-printer \" |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1430 |
49646 | 1431 NAME A string that specifies a PostScript printer name. |
1432 On Unix-like systems, a string value should be a name | |
1433 understood by lpr's -P option (or lp's -d option). | |
1434 On MS-DOS and MS-Windows systems, it is the name of a printer | |
1435 device or port. Typical non-default settings would be \"LPT1:\" | |
1436 to \"LPT3:\" for parallel printers, or \"COM1\" to \"COM4\" or | |
1437 \"AUX\" for serial printers, or \"\\\\\\\\hostname\\\\printer\" | |
1438 (or \"/D:\\\\\\\\hostname\\\\printer\") for a shared network | |
1439 printer. You can also set it to a name of a file, in which | |
1440 case the output gets appended to that file. If you want to | |
1441 discard the printed output, set this to \"NUL\". | |
1442 Examples: | |
1443 . for cp.exe | |
1444 \"\\\\\\\\host\\\\share-name\" | |
1445 | |
63328
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1446 . for print.exe or gsprint.exe |
49646 | 1447 \"/D:\\\\\\\\host\\\\share-name\" |
1448 \"\\\\\\\\host\\\\share-name\" | |
1449 \"LPT1:\" | |
1450 \"PRN\" | |
1451 | |
1452 . for lpr or lp | |
1453 \"share-name\" | |
1454 | |
1455 DEFAULT It's a way to set default values when this entry is selected. | |
1456 It's a cons like: | |
1457 | |
1458 (VARIABLE . VALUE) | |
1459 | |
80951 | 1460 Which associates VARIABLE with VALUE. When this entry is |
49646 | 1461 selected, it's executed the following command: |
1462 | |
1463 (set VARIABLE (eval VALUE)) | |
1464 | |
1465 Note that VALUE can be any valid lisp expression. So, don't | |
1466 forget to quote symbols and constant lists. | |
1467 If VARIABLE is the special keyword `inherits-from:', VALUE must | |
1468 be a symbol name setting defined in `pr-setting-database' from | |
1469 which the current setting inherits the context. Take care with | |
1470 circular inheritance. | |
1471 Examples: | |
1472 '(ps-landscape-mode . nil) | |
1473 '(ps-spool-duplex . t) | |
1474 '(pr-gs-device . (my-gs-device t)) | |
1475 | |
1476 This variable should be modified by customization engine. If this variable is | |
1477 modified by other means (for example, a lisp function), use `pr-update-menus' | |
1478 function (see it for documentation) to update PostScript printer menu. | |
1479 | |
1480 Examples: | |
1481 | |
1482 * On GNU or Unix system: | |
1483 | |
1484 '((lps_06b \"lpr\" nil \"-P\" \"lps_06b\") | |
1485 (lps_07c \"lpr\" nil nil \"lps_07c\") | |
1486 (lps_08c nil nil nil \"lps_08c\") | |
1487 ) | |
1488 | |
1489 * On Windows system: | |
1490 | |
1491 '((lps_06a \"print\" nil \"/D:\" \"\\\\\\\\printers\\\\lps_06a\") | |
1492 (lps_06b \"print\" nil nil \"\\\\\\\\printers\\\\lps_06b\") | |
1493 (lps_07c \"print\" nil \"\" \"/D:\\\\\\\\printers\\\\lps_07c\") | |
1494 (lps_08c nil nil nil \"\\\\\\\\printers\\\\lps_08c\") | |
63328
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1495 (b/w1 \"gsprint\" (\"-all\" \"-twoup\") \"-printer \" \"b/w-pr-name\") |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1496 (b/w2 \"gsprint\" (\"-all\" \"-twoup\") nil \"-printer \\\\\\\\printers\\\\lps_06a\") |
49646 | 1497 (LPT1 \"\" nil \"\" \"LPT1:\") |
1498 (PRN \"\" nil \"\" \"PRN\") | |
1499 (standard \"redpr.exe\" nil \"\" \"\") | |
63328
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1500 ) |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1501 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1502 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1503 gsprint: |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1504 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1505 You can use gsprint instead of ghostscript to print monochrome PostScript files |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1506 in Windows. The gsprint utility documentation says that it is more efficient |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1507 than ghostscript to print monochrome PostScript. |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1508 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1509 To print non-monochrome PostScript file, the efficiency of ghostscript is |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1510 similar to gsprint. |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1511 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1512 Also the gsprint utility comes together with gsview distribution. |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1513 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1514 As an example of gsprint declaration: |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1515 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1516 (setq pr-ps-printer-alist |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1517 '((A \"gsprint\" (\"-all\" \"-twoup\") \"-printer \" \"lps_015\") |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1518 (B \"gsprint\" (\"-all\" \"-twoup\") nil \"-printer lps_015\") |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1519 ;; some other printer declaration |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1520 )) |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1521 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1522 The example above declares that printer A prints all pages (-all) and two pages |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1523 per sheet (-twoup). The printer B declaration does the same as the printer A |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1524 declaration, the only difference is the printer name selection. |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1525 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1526 There are other command line options like: |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1527 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1528 -mono Render in monochrome as 1bit/pixel (only black and white). |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1529 -grey Render in greyscale as 8bits/pixel. |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1530 -color Render in color as 24bits/pixel. |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1531 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1532 The default is `-mono'. So, printer A and B in the example above are using |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1533 implicitly the `-mono' option. Note that in `-mono' no gray tone or color is |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1534 printed, this includes the zebra stripes, that is, in `-mono' the zebra stripes |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1535 are not printed. |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1536 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1537 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1538 Useful links: |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1539 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1540 * GSPRINT - Ghostscript print to Windows printer |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1541 `http://www.cs.wisc.edu/~ghost/gsview/gsprint.htm' |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1542 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1543 * Introduction to Ghostscript |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1544 `http://www.cs.wisc.edu/~ghost/doc/intro.htm' |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1545 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1546 * How to use Ghostscript |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1547 `http://www.cs.wisc.edu/~ghost/doc/cvs/Use.htm' |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1548 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1549 * Information about the print command (print.exe) |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1550 `http://www.computerhope.com/printhlp.htm' |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1551 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1552 * RedMon - Redirection Port Monitor (redpr.exe) |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1553 `http://www.cs.wisc.edu/~ghost/redmon/index.htm' |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1554 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1555 * Redirection Port Monitor (redpr.exe on-line help) |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1556 `http://www.cs.wisc.edu/~ghost/redmon/en/redmon.htm' |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1557 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1558 * UNIX man pages: lpr (or type `man lpr') |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1559 `http://bama.ua.edu/cgi-bin/man-cgi?lpr' |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1560 `http://www.mediacollege.com/cgi-bin/man/page.cgi?section=all&topic=lpr' |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1561 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1562 * UNIX man pages: lp (or type `man lp') |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1563 `http://bama.ua.edu/cgi-bin/man-cgi?lp' |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1564 `http://www.mediacollege.com/cgi-bin/man/page.cgi?section=all&topic=lp' |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1565 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1566 * GNU utilities for Win32 (cp.exe) |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1567 `http://unxutils.sourceforge.net/' |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1568 " |
49646 | 1569 :type '(repeat |
1570 (list | |
1571 :tag "PostScript Printer" | |
1572 (symbol :tag "Printer Symbol Name") | |
1573 (string :tag "Printer Command") | |
1574 (repeat :tag "Printer Switches" | |
1575 (sexp :tag "Switch" :value "")) | |
1576 (choice :menu-tag "Printer Name Switch" | |
1577 :tag "Printer Name Switch" | |
1578 (const :tag "None" nil) | |
1579 string) | |
1580 (choice :menu-tag "Printer Name" | |
1581 :tag "Printer Name" | |
1582 (const :tag "None" nil) | |
1583 string) | |
1584 (repeat | |
1585 :tag "Default Value List" | |
1586 :inline t | |
1587 (cons | |
1588 :tag "" | |
1589 (choice | |
1590 :menu-tag "Variable" | |
1591 :tag "Variable" | |
1592 (const :tag "Landscape" ps-landscape-mode) | |
1593 (const :tag "Print Header" ps-print-header) | |
1594 (const :tag "Print Header Frame" ps-print-header-frame) | |
1595 (const :tag "Line Number" ps-line-number) | |
1596 (const :tag "Zebra Stripes" ps-zebra-stripes) | |
1597 (const :tag "Duplex" ps-spool-duplex) | |
1598 (const :tag "Tumble" ps-spool-tumble) | |
1599 (const :tag "Upside-Down" ps-print-upside-down) | |
1600 (const :tag "PS File Landscape" pr-file-landscape) | |
1601 (const :tag "PS File Duplex" pr-file-duplex) | |
1602 (const :tag "PS File Tumble" pr-file-tumble) | |
1603 (const :tag "Auto Region" pr-auto-region) | |
1604 (const :tag "Auto Mode" pr-auto-mode) | |
1605 (const :tag "Ghostscript Device" pr-gs-device) | |
1606 (const :tag "Ghostscript Resolution" pr-gs-resolution) | |
1607 (const :tag "inherits-from:" inherits-from:) | |
1608 (variable :tag "Other")) | |
1609 (sexp :tag "Value"))) | |
1610 )) | |
1611 :set 'pr-alist-custom-set | |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
1612 :version "20" |
49646 | 1613 :group 'printing) |
1614 | |
1615 | |
1616 (defcustom pr-temp-dir | |
56405
10b68aa88abe
Doc fix. Change name of some funs.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
56390
diff
changeset
|
1617 (pr-dosify-file-name |
49646 | 1618 (if (boundp 'temporary-file-directory) |
1619 (symbol-value 'temporary-file-directory) | |
1620 ;; hacked from `temporary-file-directory' variable in files.el | |
1621 (file-name-as-directory | |
1622 (or (getenv "TMPDIR") (getenv "TMP") (getenv "TEMP") | |
1623 (cond (ps-windows-system "c:/temp") | |
1624 ((memq system-type '(vax-vms axp-vms)) "SYS$SCRATCH:") | |
1625 (t "/tmp") | |
1626 ))))) | |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
1627 "*Specify a directory for temporary files during printing. |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
1628 |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
1629 See also `pr-ps-temp-file' and `pr-file-modes'." |
49646 | 1630 :type '(directory :tag "Temporary Directory") |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
1631 :version "20" |
49646 | 1632 :group 'printing) |
1633 | |
1634 | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
1635 (defcustom pr-ps-temp-file "prspool-" |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
1636 "*Specify PostScript temporary file name prefix. |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
1637 |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
1638 See also `pr-temp-dir' and `pr-file-modes'." |
49646 | 1639 :type '(file :tag "PostScript Temporary File Name") |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
1640 :version "21" |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
1641 :group 'printing) |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
1642 |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
1643 |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
1644 ;; It uses 0600 as default instead of (default-file-modes). |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
1645 ;; So, by default, only the session owner have permission to deal with files |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
1646 ;; generated by `printing'. |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
1647 (defcustom pr-file-modes ?\600 |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
1648 "*Specify the file permission bits for newly created files. |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
1649 |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
1650 It should be an integer; only the low 9 bits are used. |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
1651 |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
1652 See also `pr-temp-dir' and `pr-ps-temp-file'." |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
1653 :type '(integer :tag "File Permission Bits") |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
1654 :version "21.3" |
49646 | 1655 :group 'printing) |
1656 | |
1657 | |
1658 (defcustom pr-gv-command | |
1659 (if ps-windows-system | |
1660 "gsview32.exe" | |
1661 "gv") | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
1662 "*Specify path and name of the gsview/gv utility. |
49646 | 1663 |
63328
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1664 See also `pr-path-alist'. |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1665 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1666 Useful links: |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1667 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1668 * GNU gv manual |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1669 `http://www.gnu.org/software/gv/manual/gv.html' |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1670 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1671 * GSview Help |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1672 `http://www.cs.wisc.edu/~ghost/gsview/gsviewen.htm' |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1673 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1674 * GSview Help - Common Problems |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1675 `http://www.cs.wisc.edu/~ghost/gsview/gsviewen.htm#Common_Problems' |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1676 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1677 * GSview Readme (compilation & installation) |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1678 `http://www.cs.wisc.edu/~ghost/gsview/Readme.htm' |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1679 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1680 * GSview (main site) |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1681 `http://www.cs.wisc.edu/~ghost/gsview/index.htm' |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1682 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1683 * Ghostscript, Ghostview and GSview |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1684 `http://www.cs.wisc.edu/~ghost/' |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1685 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1686 * Ghostview |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1687 `http://www.cs.wisc.edu/~ghost/gv/index.htm' |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1688 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1689 * gv 3.5, June 1997 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1690 `http://www.cs.wisc.edu/~ghost/gv/gv_doc/gv.html' |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1691 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1692 * MacGSView (MacOS) |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1693 `http://www.cs.wisc.edu/~ghost/macos/index.htm' |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1694 " |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
1695 :type '(string :tag "Ghostview Utility") |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
1696 :version "20" |
49646 | 1697 :group 'printing) |
1698 | |
1699 | |
1700 (defcustom pr-gs-command | |
1701 (if ps-windows-system | |
1702 "gswin32.exe" | |
1703 "gs") | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
1704 "*Specify path and name of the ghostscript utility. |
49646 | 1705 |
63328
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1706 See also `pr-path-alist'. |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1707 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1708 Useful links: |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1709 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1710 * Ghostscript, Ghostview and GSview |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1711 `http://www.cs.wisc.edu/~ghost/' |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1712 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1713 * Introduction to Ghostscript |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1714 `http://www.cs.wisc.edu/~ghost/doc/intro.htm' |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1715 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1716 * How to use Ghostscript |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1717 `http://www.cs.wisc.edu/~ghost/doc/cvs/Use.htm' |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1718 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1719 * Printer compatibility |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1720 `http://www.cs.wisc.edu/~ghost/doc/printer.htm' |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1721 " |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
1722 :type '(string :tag "Ghostscript Utility") |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
1723 :version "20" |
49646 | 1724 :group 'printing) |
1725 | |
1726 | |
1727 (defcustom pr-gs-switches | |
1728 (if ps-windows-system | |
1729 '("-q -dNOPAUSE -Ic:/gs/gs5.50;c:/gs/gs5.50/fonts") | |
1730 '("-q -dNOPAUSE -I/usr/share/ghostscript/5.10")) | |
1731 "*Specify ghostscript switches. See the documentation on GS for more info. | |
1732 | |
1733 It's a list of strings, where each string is one or more ghostscript switches. | |
1734 | |
1735 A note on the gs switches: | |
1736 | |
1737 -q quiet | |
1738 -dNOPAUSE don't wait for user intervention | |
1739 -Ic:/gs/gs5.50;c:/gs/gs5.50/fonts the directories needed for gs | |
1740 -c quit it's added at the end to terminate gs | |
1741 | |
1742 To see ghostscript documentation for more information: | |
1743 | |
1744 * On GNU or Unix system: | |
1745 - for full documentation, type: man gs | |
1746 - for brief documentation, type: gs -h | |
1747 | |
1748 * On Windows system: | |
1749 - for full documentation, see in a browser the file | |
1750 c:/gstools/gs5.50/index.html, that is, the file index.html which is | |
1751 located in the same directory as gswin32.exe. | |
63328
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1752 - for brief documentation, type: gswin32.exe -h |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1753 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1754 Useful links: |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1755 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1756 * Introduction to Ghostscript |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1757 `http://www.cs.wisc.edu/~ghost/doc/intro.htm' |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1758 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1759 * How to use Ghostscript |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1760 `http://www.cs.wisc.edu/~ghost/doc/cvs/Use.htm' |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1761 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1762 * Printer compatibility |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1763 `http://www.cs.wisc.edu/~ghost/doc/printer.htm' |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1764 " |
49646 | 1765 :type '(repeat (string :tag "Ghostscript Switch")) |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
1766 :version "20" |
49646 | 1767 :group 'printing) |
1768 | |
1769 | |
1770 (defcustom pr-gs-device | |
1771 (if ps-windows-system | |
1772 "mswinpr2" | |
1773 "uniprint") | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
1774 "*Specify the ghostscript device switch value (-sDEVICE=). |
49646 | 1775 |
1776 A note on the gs switches: | |
1777 | |
1778 -sDEVICE=djet500 the printer - works with HP DeskJet 540 | |
1779 | |
1780 See `pr-gs-switches' for documentation. | |
1781 See also `pr-ps-printer-alist'." | |
1782 :type '(string :tag "Ghostscript Device") | |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
1783 :version "20" |
49646 | 1784 :group 'printing) |
1785 | |
1786 | |
1787 (defcustom pr-gs-resolution 300 | |
1788 "*Specify ghostscript resolution switch value (-r). | |
1789 | |
1790 A note on the gs switches: | |
1791 | |
1792 -r300 resolution 300x300 | |
1793 | |
1794 See `pr-gs-switches' for documentation. | |
1795 See also `pr-ps-printer-alist'." | |
1796 :type '(integer :tag "Ghostscript Resolution") | |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
1797 :version "20" |
49646 | 1798 :group 'printing) |
1799 | |
1800 | |
1801 (defcustom pr-print-using-ghostscript nil | |
1802 "*Non-nil means print using ghostscript. | |
1803 | |
1804 This is useful if you don't have a PostScript printer, so you could use the | |
1805 ghostscript to print a PostScript file. | |
1806 | |
1807 In GNU or Unix system, if ghostscript is set as a PostScript filter, this | |
1808 variable should be nil." | |
1809 :type 'boolean | |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
1810 :version "20" |
49646 | 1811 :group 'printing) |
1812 | |
1813 | |
1814 (defcustom pr-faces-p nil | |
1815 "*Non-nil means print with face attributes." | |
1816 :type 'boolean | |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
1817 :version "20" |
49646 | 1818 :group 'printing) |
1819 | |
1820 | |
1821 (defcustom pr-spool-p nil | |
1822 "*Non-nil means spool printing in a buffer." | |
1823 :type 'boolean | |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
1824 :version "20" |
49646 | 1825 :group 'printing) |
1826 | |
1827 | |
1828 (defcustom pr-file-landscape nil | |
1829 "*Non-nil means print PostScript file in landscape orientation." | |
1830 :type 'boolean | |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
1831 :version "20" |
49646 | 1832 :group 'printing) |
1833 | |
1834 | |
1835 (defcustom pr-file-duplex nil | |
1836 "*Non-nil means print PostScript file in duplex mode." | |
1837 :type 'boolean | |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
1838 :version "20" |
49646 | 1839 :group 'printing) |
1840 | |
1841 | |
1842 (defcustom pr-file-tumble nil | |
1843 "*Non-nil means print PostScript file in tumble mode. | |
1844 | |
1845 If tumble is off, produces a printing suitable for binding on the left or | |
1846 right. | |
1847 If tumble is on, produces a printing suitable for binding at the top or | |
1848 bottom." | |
1849 :type 'boolean | |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
1850 :version "20" |
49646 | 1851 :group 'printing) |
1852 | |
1853 | |
1854 (defcustom pr-auto-region t | |
1855 "*Non-nil means region is automagically detected. | |
1856 | |
1857 Note that this will only work if you're using transient mark mode. | |
1858 | |
1859 When this variable is non-nil, the `*-buffer*' commands will behave like | |
1860 `*-region*' commands, that is, `*-buffer*' commands will print only the region | |
1861 marked instead of all buffer." | |
1862 :type 'boolean | |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
1863 :version "20" |
49646 | 1864 :group 'printing) |
1865 | |
1866 | |
1867 (defcustom pr-auto-mode t | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
1868 "*Non-nil means major-mode specific printing is prefered over normal printing. |
49646 | 1869 |
1870 That is, if current major-mode is declared in `pr-mode-alist', the `*-buffer*' | |
1871 and `*-region*' commands will behave like `*-mode*' commands; otherwise, | |
1872 `*-buffer*' commands will print the current buffer and `*-region*' commands | |
1873 will print the current region." | |
1874 :type 'boolean | |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
1875 :version "20" |
49646 | 1876 :group 'printing) |
1877 | |
1878 | |
1879 (defcustom pr-mode-alist | |
1880 '((mh-folder-mode ; mh summary buffer | |
1881 pr-mh-lpr-1 pr-mh-print-1 | |
1882 2 | |
1883 (ps-article-author ps-article-subject) | |
1884 ("/pagenumberstring load" pr-article-date) | |
1885 nil | |
1886 ) | |
1887 (mh-letter-mode ; mh letter buffer | |
1888 pr-mh-lpr-2 pr-mh-print-2 | |
1889 2 | |
1890 (ps-article-author ps-article-subject) | |
1891 ("/pagenumberstring load" pr-article-date) | |
1892 nil | |
1893 ) | |
1894 (rmail-summary-mode ; rmail summary buffer | |
1895 pr-rmail-lpr pr-rmail-print | |
1896 3 | |
1897 (ps-article-subject ps-article-author buffer-name) | |
1898 nil | |
1899 nil | |
1900 ) | |
1901 (rmail-mode ; rmail buffer | |
1902 pr-rmail-lpr pr-rmail-print | |
1903 3 | |
1904 (ps-article-subject ps-article-author buffer-name) | |
1905 nil | |
1906 nil | |
1907 ) | |
1908 (gnus-summary-mode ; gnus summary buffer | |
1909 pr-gnus-lpr pr-gnus-print | |
1910 3 | |
1911 (ps-article-subject ps-article-author gnus-newsgroup-name) | |
1912 nil | |
1913 nil | |
1914 ) | |
1915 (gnus-article-mode ; gnus article buffer | |
1916 pr-gnus-lpr pr-gnus-print | |
1917 3 | |
1918 (ps-article-subject ps-article-author gnus-newsgroup-name) | |
1919 nil | |
1920 nil | |
1921 ) | |
1922 (Info-mode ; Info buffer | |
1923 pr-mode-lpr pr-mode-print | |
1924 2 | |
1925 (ps-info-node ps-info-file) | |
1926 nil | |
1927 nil | |
1928 ) | |
1929 (vm-mode ; vm mode | |
1930 pr-vm-lpr pr-vm-print | |
1931 3 | |
1932 (ps-article-subject ps-article-author buffer-name) | |
1933 nil | |
1934 nil | |
1935 ) | |
1936 ) | |
1937 "*Specify an alist for a major-mode and printing functions. | |
1938 | |
1939 To customize a major mode printing, just declare the customization in | |
1940 `pr-mode-alist' and invoke some of `*-mode*' commands. An example for major | |
1941 mode usage is when you're using gnus (or mh, or rmail, etc.) and you're in the | |
1942 *Summary* buffer, if you forget to switch to the *Article* buffer before | |
1943 printing, you'll get a nicely formatted list of article subjects shows up at | |
1944 the printer. With major mode printing you don't need to switch from gnus | |
1945 *Summary* buffer first. | |
1946 | |
1947 The elements have the following form: | |
1948 | |
1949 (MAJOR-MODE | |
1950 LPR-PRINT PS-PRINT | |
1951 HEADER-LINES | |
1952 LEFT-HEADER | |
1953 RIGHT-HEADER | |
1954 KILL-LOCAL-VARIABLE | |
1955 DEFAULT...) | |
1956 | |
1957 Where: | |
1958 | |
1959 MAJOR-MODE It's the major mode symbol. | |
1960 | |
1961 LPR-PRINT It's a symbol function for text printing. It's invoked with | |
1962 one argument: | |
1963 (HEADER-LINES LEFT-HEADER RIGHT-HEADER DEFAULT...). | |
1964 | |
1965 Usually LPR-PRINT function prepares the environment or buffer | |
1966 and then call the function `pr-mode-lpr' which it's used to | |
1967 process the buffer and send it to text printer. | |
1968 | |
1969 The `pr-mode-lpr' definition is: | |
1970 | |
1971 (pr-mode-lpr HEADER-LIST &optional FROM TO) | |
1972 | |
1973 Where HEADER-LIST is like the argument passed to LPR-PRINT. | |
1974 FROM and TO are the beginning and end markers, respectively, | |
1975 for a region. If FROM is nil, it's used (point-min); if TO is | |
1976 nil, it's used (point-max). | |
1977 | |
1978 PS-PRINT It's a symbol function for PostScript printing. It's invoked | |
1979 with 3 arguments: n-up printing, file name and the list: | |
1980 (HEADER-LINES LEFT-HEADER RIGHT-HEADER DEFAULT...). | |
1981 | |
1982 Usually PS-PRINT function prepares the environment or buffer | |
1983 and then call the function `pr-mode-print' which it's used to | |
1984 process the buffer and send it to PostScript printer. | |
1985 | |
1986 The `pr-mode-print' definition is: | |
1987 | |
1988 (pr-mode-print N-UP FILENAME HEADER-LIST &optional FROM TO) | |
1989 | |
1990 Where N-UP, FILENAME and HEADER-LIST are like the arguments | |
1991 passed to PS-PRINT. FROM and TO are the beginning and end | |
1992 markers, respectively, for a region. If TO is nil, it's used | |
1993 (point-max). | |
1994 | |
1995 HEADER-LINES It's the number of header lines; if is nil, it uses | |
1996 `ps-header-lines' value. | |
1997 | |
1998 LEFT-HEADER It's the left header part, it's a list of string, variable | |
1999 symbol or function symbol (with no argument); if is nil, it | |
2000 uses `ps-left-header' value. | |
2001 | |
2002 RIGHT-HEADER It's the right header part, it's a list of string, variable | |
2003 symbol or function symbol (with no argument); if is nil, it | |
2004 uses `ps-right-header' value. | |
2005 | |
2006 KILL-LOCAL-VARIABLE | |
2007 Non-nil means to kill all buffer local variable declared in | |
2008 DEFAULT (see below). | |
2009 | |
2010 DEFAULT It's a way to set default values when this entry is selected. | |
2011 It's a cons like: | |
2012 | |
2013 (VARIABLE-SYM . VALUE) | |
2014 | |
80951 | 2015 Which associates VARIABLE-SYM with VALUE. When this entry is |
49646 | 2016 selected, it's executed the following command: |
2017 | |
2018 (set (make-local-variable VARIABLE-SYM) (eval VALUE)) | |
2019 | |
2020 Note that VALUE can be any valid lisp expression. So, don't | |
2021 forget to quote symbols and constant lists. | |
2022 If VARIABLE is the special keyword `inherits-from:', VALUE must | |
2023 be a symbol name setting defined in `pr-setting-database' from | |
2024 which the current setting inherits the context. Take care with | |
2025 circular inheritance. | |
2026 Examples: | |
2027 '(ps-landscape-mode . nil) | |
2028 '(ps-spool-duplex . t) | |
2029 '(pr-gs-device . (my-gs-device t))" | |
2030 :type '(repeat | |
2031 (list | |
2032 :tag "" | |
2033 (symbol :tag "Major Mode") | |
2034 (function :tag "Text Printing Function") | |
2035 (function :tag "PS Printing Function") | |
2036 (choice :menu-tag "Number of Header Lines" | |
2037 :tag "Number of Header Lines" | |
2038 (integer :tag "Number") | |
2039 (const :tag "Default Number" nil)) | |
2040 (repeat :tag "Left Header List" | |
2041 (choice :menu-tag "Left Header" | |
2042 :tag "Left Header" | |
2043 string symbol)) | |
2044 (repeat :tag "Right Header List" | |
2045 (choice :menu-tag "Right Header" | |
2046 :tag "Right Header" | |
2047 string symbol)) | |
2048 (boolean :tag "Kill Local Variable At End") | |
2049 (repeat | |
2050 :tag "Default Value List" | |
2051 :inline t | |
2052 (cons | |
2053 :tag "" | |
2054 (choice | |
2055 :menu-tag "Variable" | |
2056 :tag "Variable" | |
2057 (const :tag "Landscape" ps-landscape-mode) | |
2058 (const :tag "Print Header" ps-print-header) | |
2059 (const :tag "Print Header Frame" ps-print-header-frame) | |
2060 (const :tag "Line Number" ps-line-number) | |
2061 (const :tag "Zebra Stripes" ps-zebra-stripes) | |
2062 (const :tag "Duplex" ps-spool-duplex) | |
2063 (const :tag "Tumble" ps-spool-tumble) | |
2064 (const :tag "Upside-Down" ps-print-upside-down) | |
2065 (const :tag "PS File Landscape" pr-file-landscape) | |
2066 (const :tag "PS File Duplex" pr-file-duplex) | |
2067 (const :tag "PS File Tumble" pr-file-tumble) | |
2068 (const :tag "Auto Region" pr-auto-region) | |
2069 (const :tag "Auto Mode" pr-auto-mode) | |
2070 (const :tag "Ghostscript Device" pr-gs-device) | |
2071 (const :tag "Ghostscript Resolution" pr-gs-resolution) | |
2072 (const :tag "inherits-from:" inherits-from:) | |
2073 (variable :tag "Other")) | |
2074 (sexp :tag "Value"))) | |
2075 )) | |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
2076 :version "20" |
49646 | 2077 :group 'printing) |
2078 | |
2079 | |
2080 (defcustom pr-ps-utility 'mpage | |
2081 "*Specify PostScript utility symbol. | |
2082 | |
2083 This utility symbol should be defined on `pr-ps-utility-alist' (see it for | |
2084 documentation). | |
2085 | |
2086 This variable should be modified by customization engine. If this variable is | |
2087 modified by other means (for example, a lisp function), use `pr-update-menus' | |
2088 function (see it for documentation) to update PostScript utility menu. | |
2089 | |
2090 NOTE: Don't forget to download and install the utilities declared on | |
2091 `pr-ps-utility-alist'." | |
2092 :type '(symbol :tag "PS File Utility") | |
2093 :set 'pr-ps-utility-custom-set | |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
2094 :version "20" |
49646 | 2095 :group 'printing) |
2096 | |
2097 | |
2098 (defcustom pr-ps-utility-alist | |
2099 '((mpage "mpage" nil "-b%s" "-%d" "-l" "-t" "-T" ">" nil) | |
2100 (psnup "psnup" ("-q") "-P%s" "-%d" "-l" nil nil " " nil | |
2101 (inherits-from: . no-duplex)) | |
2102 ) | |
2103 ;; Examples: | |
2104 ;; * On GNU or Unix system: | |
2105 ;; '((mpage "mpage" nil "-b%s" "-%d" "-l" "-t" "-T" ">" nil) | |
2106 ;; (psnup "psnup" ("-q") "-P%s" "-%d" "-l" nil nil " " nil | |
2107 ;; (pr-file-duplex . nil) (pr-file-tumble . nil)) | |
2108 ;; ) | |
2109 ;; * On Windows system: | |
2110 ;; '((psnup "c:/psutils/psnup" ("-q") "-P%s" "-%d" "-l" nil nil " " nil | |
2111 ;; (pr-file-duplex . nil) (pr-file-tumble . nil)) | |
2112 ;; ) | |
2113 "*Specify an alist for PostScript utility processing (PS utility database). | |
2114 | |
2115 The alist element has the form: | |
2116 | |
2117 (SYMBOL UTILITY MUST-SWITCHES PAPERSIZE N-UP LANDSCAPE DUPLEX TUMBLE OUTPUT | |
2118 SWITCHES DEFAULT...) | |
2119 | |
2120 Where: | |
2121 | |
2122 SYMBOL It's a symbol to identify a PostScript utility. It's for | |
2123 `pr-ps-utility' variable setting and for menu selection. | |
2124 Examples: | |
2125 'mpage | |
2126 'psnup | |
2127 | |
2128 UTILITY Name of utility for processing a PostScript file. | |
2129 See also `pr-path-alist'. | |
2130 Examples: | |
2131 . for GNU or Unix system: | |
2132 \"mpage\" | |
2133 \"psnup -q\" | |
2134 | |
2135 . for Windows system: | |
2136 \"c:/psutils/psnup -q\" | |
2137 | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
2138 MUST-SWITCHES List of sexp's to pass as options to the PostScript utility |
49646 | 2139 program. These options are necessary to process the utility |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
2140 program and must be placed before any other switches. |
49646 | 2141 Example: |
2142 . for psnup: | |
2143 '(\"-q\") | |
2144 | |
2145 PAPERSIZE It's a format string to specify paper size switch. | |
2146 Example: | |
2147 . for mpage | |
2148 \"-b%s\" | |
2149 | |
2150 N-UP It's a format string to specify n-up switch. | |
2151 Example: | |
2152 . for psnup | |
2153 \"-%d\" | |
2154 | |
2155 LANDSCAPE It's a string to specify landscape switch. If the utility | |
2156 doesn't have landscape switch, set to nil. | |
2157 Example: | |
2158 . for psnup | |
2159 \"-l\" | |
2160 | |
2161 DUPLEX It's a string to specify duplex switch. If the utility doesn't | |
2162 have duplex switch, set to nil. | |
2163 Example: | |
2164 . for psnup | |
2165 nil | |
2166 | |
2167 TUMBLE It's a string to specify tumble switch. If the utility doesn't | |
2168 have tumble switch, set to nil. | |
2169 Example: | |
2170 . for psnup | |
2171 nil | |
2172 | |
2173 OUTPUT It's a string to specify how to generate an output file. Some | |
2174 utilities accept an output file option, but some others need | |
2175 output redirection or some other way to specify an output file. | |
2176 Example: | |
2177 . for psnup | |
2178 \" \" ; psnup ... input output | |
2179 | |
2180 . for mpage | |
2181 \">\" ; mpage ... input > output | |
2182 | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
2183 SWITCHES List of sexp's to pass as extra options to the PostScript utility |
49646 | 2184 program. |
2185 Example: | |
2186 . for psnup | |
2187 '(\"-q\") | |
2188 nil | |
2189 | |
2190 DEFAULT It's a way to set default values when this entry is selected. | |
2191 It's a cons like: | |
2192 | |
2193 (VARIABLE . VALUE) | |
2194 | |
80951 | 2195 Which associates VARIABLE with VALUE. When this entry is |
49646 | 2196 selected, it's executed the following command: |
2197 | |
2198 (set VARIABLE (eval VALUE)) | |
2199 | |
2200 Note that VALUE can be any valid lisp expression. So, don't | |
2201 forget to quote symbols and constant lists. | |
2202 If VARIABLE is the special keyword `inherits-from:', VALUE must | |
2203 be a symbol name setting defined in `pr-setting-database' from | |
2204 which the current setting inherits the context. Take care with | |
2205 circular inheritance. | |
2206 Examples: | |
2207 '(pr-file-landscape . nil) | |
2208 '(pr-file-duplex . t) | |
2209 '(pr-gs-device . (my-gs-device t)) | |
2210 | |
2211 This variable should be modified by customization engine. If this variable is | |
2212 modified by other means (for example, a lisp function), use `pr-update-menus' | |
2213 function (see it for documentation) to update PostScript utility menu. | |
2214 | |
2215 NOTE: Don't forget to download and install the utilities declared on | |
2216 `pr-ps-utility-alist'. | |
2217 | |
2218 Examples: | |
2219 | |
2220 * On GNU or Unix system: | |
2221 | |
2222 '((mpage \"mpage\" nil \"-b%s\" \"-%d\" \"-l\" \"-t\" \"-T\" \">\" nil) | |
2223 (psnup \"psnup\" (\"-q\") \"-P%s\" \"-%d\" \"-l\" nil nil \" \" nil | |
2224 (pr-file-duplex . nil) (pr-file-tumble . nil)) | |
2225 ) | |
2226 | |
2227 * On Windows system: | |
2228 | |
2229 '((psnup \"c:/psutils/psnup\" (\"-q\") \"-P%s\" \"-%d\" \"-l\" nil nil \" \" | |
2230 nil (pr-file-duplex . nil) (pr-file-tumble . nil)) | |
63328
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
2231 ) |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
2232 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
2233 Useful links: |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
2234 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
2235 * mpage download (GNU or Unix) |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
2236 `http://www.mesa.nl/pub/mpage/' |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
2237 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
2238 * mpage documentation (GNU or Unix - or type `man mpage') |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
2239 `http://www.cs.umd.edu/faq/guides/manual_unix/node48.html' |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
2240 `http://www.rt.com/man/mpage.1.html' |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
2241 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
2242 * psnup (Windows, GNU or Unix) |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
2243 `http://www.knackered.org/angus/psutils/' |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
2244 `http://gershwin.ens.fr/vdaniel/Doc-Locale/Outils-Gnu-Linux/PsUtils/' |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
2245 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
2246 * psnup (PsUtils for Windows) |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
2247 `http://gnuwin32.sourceforge.net/packages/psutils.htm' |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
2248 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
2249 * psnup documentation (GNU or Unix - or type `man psnup') |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
2250 `http://linux.about.com/library/cmd/blcmdl1_psnup.htm' |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
2251 `http://amath.colorado.edu/computing/software/man/psnup.html' |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
2252 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
2253 * GNU Enscript (Windows, GNU or Unix) |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
2254 `http://people.ssh.com/mtr/genscript/' |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
2255 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
2256 * GNU Enscript documentation (Windows, GNU or Unix) |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
2257 `http://people.ssh.com/mtr/genscript/enscript.man.html' |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
2258 (on GNU or Unix, type `man enscript') |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
2259 " |
49646 | 2260 :type '(repeat |
2261 (list :tag "PS File Utility" | |
2262 (symbol :tag "Utility Symbol") | |
2263 (string :tag "Utility Name") | |
2264 (repeat :tag "Must Utility Switches" | |
2265 (sexp :tag "Switch" :value "")) | |
2266 (choice :menu-tag "Paper Size" | |
2267 :tag "Paper Size" | |
2268 (const :tag "No Paper Size" nil) | |
2269 (string :tag "Paper Size Format")) | |
2270 (choice :menu-tag "N-Up" | |
2271 :tag "N-Up" | |
2272 (const :tag "No N-Up" nil) | |
2273 (string :tag "N-Up Format")) | |
2274 (choice :menu-tag "Landscape" | |
2275 :tag "Landscape" | |
2276 (const :tag "No Landscape" nil) | |
2277 (string :tag "Landscape Switch")) | |
2278 (choice :menu-tag "Duplex" | |
2279 :tag "Duplex" | |
2280 (const :tag "No Duplex" nil) | |
2281 (string :tag "Duplex Switch")) | |
2282 (choice :menu-tag "Tumble" | |
2283 :tag "Tumble" | |
2284 (const :tag "No Tumble" nil) | |
2285 (string :tag "Tumble Switch")) | |
2286 (string :tag "Output Separator") | |
2287 (repeat :tag "Utility Switches" | |
2288 (sexp :tag "Switch" :value "")) | |
2289 (repeat | |
2290 :tag "Default Value List" | |
2291 :inline t | |
2292 (cons | |
2293 :tag "" | |
2294 (choice | |
2295 :menu-tag "Variable" | |
2296 :tag "Variable" | |
2297 (const :tag "PS File Landscape" pr-file-landscape) | |
2298 (const :tag "PS File Duplex" pr-file-duplex) | |
2299 (const :tag "PS File Tumble" pr-file-tumble) | |
2300 (const :tag "Ghostscript Device" pr-gs-device) | |
2301 (const :tag "Ghostscript Resolution" pr-gs-resolution) | |
2302 (const :tag "inherits-from:" inherits-from:) | |
2303 (variable :tag "Other")) | |
2304 (sexp :tag "Value"))) | |
2305 )) | |
2306 :set 'pr-alist-custom-set | |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
2307 :version "20" |
49646 | 2308 :group 'printing) |
2309 | |
2310 | |
2311 (defcustom pr-menu-lock t | |
2312 "*Non-nil means menu is locked while selecting toggle options. | |
2313 | |
2314 See also `pr-menu-char-height' and `pr-menu-char-width'." | |
2315 :type 'boolean | |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
2316 :version "20" |
49646 | 2317 :group 'printing) |
2318 | |
2319 | |
80951 | 2320 (defcustom pr-menu-char-height (pr-menu-char-height) |
49646 | 2321 "*Specify menu char height in pixels. |
2322 | |
2323 This variable is used to guess which vertical position should be locked the | |
2324 menu, so don't forget to adjust it if menu position is not ok. | |
2325 | |
2326 See also `pr-menu-lock' and `pr-menu-char-width'." | |
2327 :type 'integer | |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
2328 :version "20" |
49646 | 2329 :group 'printing) |
2330 | |
2331 | |
80951 | 2332 (defcustom pr-menu-char-width (pr-menu-char-width) |
49646 | 2333 "*Specify menu char width in pixels. |
2334 | |
2335 This variable is used to guess which horizontal position should be locked the | |
2336 menu, so don't forget to adjust it if menu position is not ok. | |
2337 | |
2338 See also `pr-menu-lock' and `pr-menu-char-height'." | |
2339 :type 'integer | |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
2340 :version "20" |
49646 | 2341 :group 'printing) |
2342 | |
2343 | |
2344 (defcustom pr-setting-database | |
2345 '((no-duplex ; setting symbol name | |
2346 nil nil nil ; inherits local kill-local | |
2347 (pr-file-duplex . nil) ; settings | |
2348 (pr-file-tumble . nil)) | |
2349 ) | |
2350 "*Specify an alist for settings in general. | |
2351 | |
2352 The elements have the following form: | |
2353 | |
2354 (SYMBOL INHERITS LOCAL KILL-LOCAL SETTING...) | |
2355 | |
2356 Where: | |
2357 | |
2358 SYMBOL It's a symbol to identify the setting group. | |
2359 | |
2360 INHERITS Specify the inheritance for SYMBOL group. It's a symbol name | |
2361 setting from which the current setting inherits the context. | |
2362 If INHERITS is nil, means that there is no inheritance. | |
2363 This is a simple inheritance mechanism. | |
2364 | |
2365 Let's see an example to illustrate the inheritance mechanism: | |
2366 | |
2367 (setq pr-setting-database | |
2368 '((no-duplex ; setting symbol name | |
2369 nil ; inherits | |
2370 nil nil ; local kill-local | |
2371 (pr-file-duplex . nil) ; settings | |
2372 (pr-file-tumble . nil) | |
2373 ) | |
2374 (no-duplex-and-landscape ; setting symbol name | |
2375 no-duplex ; inherits | |
2376 nil nil ; local kill-local | |
2377 (pr-file-landscape . nil) ; settings | |
2378 ))) | |
2379 | |
2380 The example above has two setting groups: no-duplex and | |
2381 no-duplex-and-landscape. When setting no-duplex is activated | |
2382 through `inherits-from:' (see `pr-ps-utility', `pr-mode-alist' | |
2383 and `pr-ps-printer-alist'), the variables pr-file-duplex and | |
2384 pr-file-tumble are both set to nil. | |
2385 | |
2386 Now when setting no-duplex-and-landscape is activated through | |
2387 `inherits-from:', the variable pr-file-landscape is set to nil | |
2388 and also the settings for no-duplex are done, because | |
2389 no-duplex-and-landscape inherits settings from no-duplex. | |
2390 | |
2391 Take care with circular inheritance. It's an error if circular | |
2392 inheritance happens. | |
2393 | |
2394 LOCAL Non-nil means that all settings for SYMBOL group will be | |
2395 declared local buffer. | |
2396 | |
2397 KILL-LOCAL Non-nil means that all settings for SYMBOL group will be | |
2398 killed at end. It has effect only when LOCAL is non-nil. | |
2399 | |
2400 SETTING It's a cons like: | |
2401 | |
2402 (VARIABLE . VALUE) | |
2403 | |
80951 | 2404 Which associates VARIABLE with VALUE. When this entry is |
49646 | 2405 selected, it's executed the following command: |
2406 | |
2407 * If LOCAL is non-nil: | |
2408 (set (make-local-variable VARIABLE) (eval VALUE)) | |
2409 | |
2410 * If LOCAL is nil: | |
2411 (set VARIABLE (eval VALUE)) | |
2412 | |
2413 Note that VALUE can be any valid lisp expression. So, don't | |
2414 forget to quote symbols and constant lists. | |
2415 This setting is ignored if VARIABLE is equal to keyword | |
2416 `inherits-from:'. | |
2417 Examples: | |
2418 '(ps-landscape-mode . nil) | |
2419 '(ps-spool-duplex . t) | |
2420 '(pr-gs-device . (my-gs-device t))" | |
2421 :type '(repeat | |
2422 (list | |
2423 :tag "" | |
2424 (symbol :tag "Setting Name") | |
2425 (choice :menu-tag "Inheritance" | |
2426 :tag "Inheritance" | |
2427 (const :tag "No Inheritance" nil) | |
2428 (symbol :tag "Inherits From")) | |
2429 (boolean :tag "Local Buffer Setting") | |
2430 (boolean :tag "Kill Local Variable At End") | |
2431 (repeat | |
2432 :tag "Setting List" | |
2433 :inline t | |
2434 (cons | |
2435 :tag "" | |
2436 (choice | |
2437 :menu-tag "Variable" | |
2438 :tag "Variable" | |
2439 (const :tag "Landscape" ps-landscape-mode) | |
2440 (const :tag "Print Header" ps-print-header) | |
2441 (const :tag "Print Header Frame" ps-print-header-frame) | |
2442 (const :tag "Line Number" ps-line-number) | |
2443 (const :tag "Zebra Stripes" ps-zebra-stripes) | |
2444 (const :tag "Duplex" ps-spool-duplex) | |
2445 (const :tag "Tumble" ps-spool-tumble) | |
2446 (const :tag "Upside-Down" ps-print-upside-down) | |
2447 (const :tag "PS File Landscape" pr-file-landscape) | |
2448 (const :tag "PS File Duplex" pr-file-duplex) | |
2449 (const :tag "PS File Tumble" pr-file-tumble) | |
2450 (const :tag "Auto Region" pr-auto-region) | |
2451 (const :tag "Auto Mode" pr-auto-mode) | |
2452 (const :tag "Ghostscript Device" pr-gs-device) | |
2453 (const :tag "Ghostscript Resolution" pr-gs-resolution) | |
2454 (variable :tag "Other")) | |
2455 (sexp :tag "Value"))) | |
2456 )) | |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
2457 :version "20" |
49646 | 2458 :group 'printing) |
2459 | |
2460 | |
2461 (defcustom pr-visible-entry-list | |
2462 '(postscript text postscript-options postscript-process printing help) | |
2463 "*Specify a list of Printing menu visible entries. | |
2464 | |
2465 Valid values with the corresponding menu parts are: | |
2466 | |
2467 +------------------------------+ | |
2468 | Printing Interface | | |
2469 +------------------------------+ | |
2470 `postscript' | PostScript Preview >| | |
2471 | PostScript Print >| | |
2472 | PostScript Printer: name >| | |
2473 +------------------------------+ | |
2474 `text' | Printify >| | |
2475 | Print >| | |
2476 | Text Printer: name >| | |
2477 +------------------------------+ | |
2478 `postscript-options' |[ ] Landscape | | |
2479 |[ ] Print Header | | |
2480 |[ ] Print Header Frame | | |
2481 |[ ] Line Number | | |
2482 |[ ] Zebra Stripes | | |
2483 |[ ] Duplex | | |
2484 |[ ] Tumble | | |
2485 |[ ] Upside-Down | | |
2486 | Print All Pages >| | |
2487 +------------------------------+ | |
2488 `postscript-process' |[ ] Spool Buffer | | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
2489 |[ ] Print with faces | |
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
2490 |[ ] Print via Ghostscript | |
49646 | 2491 +------------------------------+ |
2492 `printing' |[ ] Auto Region | | |
2493 |[ ] Auto Mode | | |
2494 |[ ] Menu Lock | | |
2495 +------------------------------+ | |
2496 `help' | Customize >| | |
2497 | Show Settings >| | |
2498 | Help | | |
2499 +------------------------------+ | |
2500 | |
2501 Any other value is ignored." | |
2502 :type '(repeat :tag "Menu Visible Part" | |
2503 (choice :menu-tag "Menu Part" | |
2504 :tag "Menu Part" | |
2505 (const postscript) | |
2506 (const text) | |
2507 (const postscript-options) | |
2508 (const postscript-process) | |
2509 (const printing) | |
2510 (const help))) | |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
2511 :version "20" |
49646 | 2512 :group 'printing) |
2513 | |
2514 | |
2515 (defcustom pr-delete-temp-file t | |
2516 "*Non-nil means delete temporary files. | |
2517 | |
2518 Set `pr-delete-temp-file' to nil, if the following message (or a similar) | |
2519 happens when printing: | |
2520 | |
2521 Error: could not open \"c:\\temp\\prspool.ps\" for reading." | |
2522 :type 'boolean | |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
2523 :version "20" |
49646 | 2524 :group 'printing) |
2525 | |
2526 | |
2527 (defcustom pr-list-directory nil | |
2528 "*Non-nil means list directory when processing a directory. | |
2529 | |
2530 That is, any subdirectories (and the superdirectory) of the directory (given as | |
2531 argument of functions below) are also printed (as dired-mode listings). | |
2532 | |
2533 It's used by `pr-ps-directory-preview', `pr-ps-directory-using-ghostscript', | |
2534 `pr-ps-directory-print', `pr-ps-directory-ps-print', `pr-printify-directory' | |
2535 and `pr-txt-directory'." | |
2536 :type 'boolean | |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
2537 :version "20" |
49646 | 2538 :group 'printing) |
2539 | |
2540 | |
2541 (defcustom pr-buffer-name "*Printing Interface*" | |
2542 "*Specify the name of the buffer interface for printing package. | |
2543 | |
2544 It's used by `pr-interface'." | |
2545 :type 'string | |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
2546 :version "20" |
49646 | 2547 :group 'printing) |
2548 | |
2549 | |
2550 (defcustom pr-buffer-name-ignore | |
2551 (list (regexp-quote pr-buffer-name) ; ignore printing interface buffer | |
2552 "^ .*$") ; ignore invisible buffers | |
2553 "*Specify a regexp list for buffer names to be ignored in interface buffer. | |
2554 | |
2555 NOTE: Case is important for matching, that is, `case-fold-search' is always | |
2556 nil. | |
2557 | |
2558 It's used by `pr-interface'." | |
2559 :type '(repeat (regexp :tag "Buffer Name Regexp")) | |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
2560 :version "20" |
49646 | 2561 :group 'printing) |
2562 | |
2563 | |
2564 (defcustom pr-buffer-verbose t | |
2565 "*Non-nil means to be verbose when editing a field in interface buffer. | |
2566 | |
2567 It's used by `pr-interface'." | |
2568 :type 'boolean | |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
2569 :version "20" |
49646 | 2570 :group 'printing) |
2571 | |
85529
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2572 (defconst pr-even-or-odd-alist |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2573 '((nil . "Print All Pages") |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2574 (even-page . "Print Even Pages") |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2575 (odd-page . "Print Odd Pages") |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2576 (even-sheet . "Print Even Sheets") |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2577 (odd-sheet . "Print Odd Sheets"))) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2578 |
49646 | 2579 |
2580 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
2581 ;; Internal Variables | |
2582 | |
2583 | |
2584 (defvar pr-txt-command nil | |
2585 "Name of program for printing a text file. | |
2586 See `pr-txt-printer-alist'.") | |
2587 | |
2588 | |
2589 (defvar pr-txt-switches nil | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
2590 "List of sexp's to pass as extra options to the text printer program. |
49646 | 2591 See `pr-txt-printer-alist'.") |
2592 | |
2593 | |
2594 (defvar pr-txt-printer nil | |
2595 "Specify text printer name. | |
2596 See `pr-txt-printer-alist'.") | |
2597 | |
2598 | |
2599 (defvar pr-ps-command nil | |
2600 "Name of program for printing a PostScript file. | |
2601 See `pr-ps-printer-alist'.") | |
2602 | |
2603 | |
2604 (defvar pr-ps-switches nil | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
2605 "List of sexp's to pass as extra options to the PostScript printer program. |
49646 | 2606 See `pr-ps-printer-alist'.") |
2607 | |
2608 | |
2609 (defvar pr-ps-printer-switch nil | |
2610 "Specify PostScript printer name switch. | |
2611 See `pr-ps-printer-alist'.") | |
2612 | |
2613 | |
2614 (defvar pr-ps-printer nil | |
2615 "Specify PostScript printer name. | |
2616 See `pr-ps-printer-alist'.") | |
2617 | |
2618 | |
2619 (defvar pr-menu-bar nil | |
2620 "Specify Printing menu-bar entry.") | |
2621 | |
85529
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2622 (defvar pr-menu-print-item "print" |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2623 "Non-nil means that menu binding was not done. |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2624 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2625 Used by `pr-menu-bind' and `pr-update-menus'.") |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2626 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2627 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2628 (defvar pr-ps-printer-menu-modified t |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2629 "Non-nil means `pr-ps-printer-alist' was modified and we need to update menu.") |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2630 (defvar pr-txt-printer-menu-modified t |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2631 "Non-nil means `pr-txt-printer-alist' was modified and we need to update menu.") |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2632 (defvar pr-ps-utility-menu-modified t |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2633 "Non-nil means `pr-ps-utility-alist' was modified and we need to update menu.") |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2634 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2635 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2636 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2637 ;; XEmacs Definitions |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2638 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2639 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2640 (cond |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2641 ((featurep 'xemacs) ; XEmacs |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2642 ;; XEmacs |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2643 (defalias 'pr-f-set-keymap-parents 'set-keymap-parents) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2644 (defalias 'pr-f-set-keymap-name 'set-keymap-name) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2645 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2646 ;; XEmacs |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2647 (defun pr-f-read-string (prompt initial history default) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2648 (let ((str (read-string prompt initial))) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2649 (if (and str (not (string= str ""))) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2650 str |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2651 default))) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2652 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2653 ;; XEmacs |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2654 (defvar zmacs-region-stays nil) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2655 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2656 ;; XEmacs |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2657 (defun pr-keep-region-active () |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2658 (setq zmacs-region-stays t)) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2659 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2660 ;; XEmacs |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2661 (defun pr-region-active-p () |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2662 (and pr-auto-region (not zmacs-region-stays) (ps-mark-active-p))) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2663 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2664 ;; XEmacs |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2665 (defun pr-menu-char-height () |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2666 (font-height (face-font 'default))) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2667 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2668 ;; XEmacs |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2669 (defun pr-menu-char-width () |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2670 (font-width (face-font 'default))) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2671 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2672 ;; XEmacs |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2673 (defmacro pr-xemacs-global-menubar (&rest body) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2674 `(save-excursion |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2675 (let ((temp (get-buffer-create (make-temp-name " *Temp")))) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2676 ;; be sure to access global menubar |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2677 (set-buffer temp) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2678 ,@body |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2679 (kill-buffer temp)))) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2680 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2681 ;; XEmacs |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2682 (defun pr-global-menubar (pr-menu-spec) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2683 ;; Menu binding |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2684 (pr-xemacs-global-menubar |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2685 (add-submenu nil (cons "Printing" pr-menu-spec) "Apps")) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2686 (setq pr-menu-print-item nil)) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2687 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2688 ;; XEmacs |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2689 (defvar current-mouse-event nil) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2690 (defun pr-menu-position (entry index horizontal) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2691 (make-event |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2692 'button-release |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2693 (list 'button 1 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2694 'x (- (event-x-pixel current-mouse-event) ; X |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2695 (* horizontal pr-menu-char-width)) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2696 'y (- (event-y-pixel current-mouse-event) ; Y |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2697 (* (pr-menu-index entry index) pr-menu-char-height))))) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2698 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2699 (defvar pr-menu-position nil) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2700 (defvar pr-menu-state nil) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2701 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2702 ;; XEmacs |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2703 (defvar current-menubar nil) ; to avoid compilation gripes |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2704 (defun pr-menu-lookup (path) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2705 (car (find-menu-item current-menubar (cons "Printing" path)))) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2706 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2707 ;; XEmacs |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2708 (defun pr-menu-lock (entry index horizontal state path) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2709 (when pr-menu-lock |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2710 (or (and pr-menu-position (eq state pr-menu-state)) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2711 (setq pr-menu-position (pr-menu-position entry index horizontal) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2712 pr-menu-state state)) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2713 (let* ((menu (pr-menu-lookup path)) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2714 (result (get-popup-menu-response menu pr-menu-position))) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2715 (and (misc-user-event-p result) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2716 (funcall (event-function result) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2717 (event-object result)))) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2718 (setq pr-menu-position nil))) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2719 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2720 ;; XEmacs |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2721 (defalias 'pr-update-mode-line 'set-menubar-dirty-flag) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2722 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2723 ;; XEmacs |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2724 (defvar pr-ps-name-old "PostScript Printers") |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2725 (defvar pr-txt-name-old "Text Printers") |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2726 (defvar pr-ps-utility-old "PostScript Utility") |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2727 (defvar pr-even-or-odd-old "Print All Pages") |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2728 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2729 ;; XEmacs |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2730 (defun pr-do-update-menus (&optional force) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2731 (pr-menu-alist pr-ps-printer-alist |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2732 'pr-ps-name |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2733 'pr-menu-set-ps-title |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2734 '("Printing") |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2735 'pr-ps-printer-menu-modified |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2736 force |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2737 pr-ps-name-old |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2738 'postscript 2) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2739 (pr-menu-alist pr-txt-printer-alist |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2740 'pr-txt-name |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2741 'pr-menu-set-txt-title |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2742 '("Printing") |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2743 'pr-txt-printer-menu-modified |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2744 force |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2745 pr-txt-name-old |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2746 'text 2) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2747 (let ((save-var pr-ps-utility-menu-modified)) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2748 (pr-menu-alist pr-ps-utility-alist |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2749 'pr-ps-utility |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2750 'pr-menu-set-utility-title |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2751 '("Printing" "PostScript Print" "File") |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2752 'save-var |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2753 force |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2754 pr-ps-utility-old |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2755 nil 1)) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2756 (pr-menu-alist pr-ps-utility-alist |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2757 'pr-ps-utility |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2758 'pr-menu-set-utility-title |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2759 '("Printing" "PostScript Preview" "File") |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2760 'pr-ps-utility-menu-modified |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2761 force |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2762 pr-ps-utility-old |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2763 nil 1) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2764 (pr-even-or-odd-pages ps-even-or-odd-pages force)) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2765 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2766 ;; XEmacs |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2767 (defun pr-menu-alist (alist var-sym fun menu-path modified-sym force name |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2768 entry index) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2769 (when (and alist (or force (symbol-value modified-sym))) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2770 (pr-xemacs-global-menubar |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2771 (add-submenu menu-path |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2772 (pr-menu-create name alist var-sym |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2773 fun entry index))) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2774 (funcall fun (symbol-value var-sym)) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2775 (set modified-sym nil))) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2776 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2777 ;; XEmacs |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2778 (defun pr-relabel-menu-item (newname var-sym) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2779 (pr-xemacs-global-menubar |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2780 (relabel-menu-item |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2781 (list "Printing" (symbol-value var-sym)) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2782 newname) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2783 (set var-sym newname))) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2784 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2785 ;; XEmacs |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2786 (defun pr-menu-set-ps-title (value &optional item entry index) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2787 (pr-relabel-menu-item (format "PostScript Printer: %s" value) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2788 'pr-ps-name-old) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2789 (pr-ps-set-printer value) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2790 (and index |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2791 (pr-menu-lock entry index 12 'toggle nil))) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2792 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2793 ;; XEmacs |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2794 (defun pr-menu-set-txt-title (value &optional item entry index) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2795 (pr-relabel-menu-item (format "Text Printer: %s" value) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2796 'pr-txt-name-old) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2797 (pr-txt-set-printer value) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2798 (and index |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2799 (pr-menu-lock entry index 12 'toggle nil))) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2800 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2801 ;; XEmacs |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2802 (defun pr-menu-set-utility-title (value &optional item entry index) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2803 (pr-xemacs-global-menubar |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2804 (let ((newname (format "%s" value))) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2805 (relabel-menu-item |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2806 (list "Printing" "PostScript Print" "File" pr-ps-utility-old) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2807 newname) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2808 (relabel-menu-item |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2809 (list "Printing" "PostScript Preview" "File" pr-ps-utility-old) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2810 newname) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2811 (setq pr-ps-utility-old newname))) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2812 (pr-ps-set-utility value) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2813 (and index |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2814 (pr-menu-lock entry index 5 nil '("PostScript Print" "File")))) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2815 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2816 ;; XEmacs |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2817 (defun pr-even-or-odd-pages (value &optional no-lock) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2818 (pr-relabel-menu-item (cdr (assq value pr-even-or-odd-alist)) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2819 'pr-even-or-odd-old) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2820 (setq ps-even-or-odd-pages value) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2821 (or no-lock |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2822 (pr-menu-lock 'postscript-options 8 12 'toggle nil))) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2823 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2824 ) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2825 (t ; GNU Emacs |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2826 ;; Do nothing |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2827 )) ; end cond featurep |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2828 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2829 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2830 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2831 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2832 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2833 ;; GNU Emacs Definitions |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2834 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2835 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2836 (cond |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2837 ((featurep 'xemacs) ; XEmacs |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2838 ;; Do nothing |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2839 ) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2840 (t ; GNU Emacs |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2841 ;; GNU Emacs |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2842 (defalias 'pr-f-set-keymap-parents 'set-keymap-parent) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2843 (defalias 'pr-f-set-keymap-name 'ignore) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2844 (defalias 'pr-f-read-string 'read-string) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2845 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2846 ;; GNU Emacs |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2847 (defvar deactivate-mark) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2848 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2849 ;; GNU Emacs |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2850 (defun pr-keep-region-active () |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2851 (setq deactivate-mark nil)) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2852 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2853 ;; GNU Emacs |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2854 (defun pr-region-active-p () |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2855 (and pr-auto-region transient-mark-mode mark-active)) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2856 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2857 ;; GNU Emacs |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2858 (defun pr-menu-char-height () |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2859 (frame-char-height)) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2860 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2861 ;; GNU Emacs |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2862 (defun pr-menu-char-width () |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2863 (frame-char-width)) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2864 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2865 ;; GNU Emacs |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2866 ;; Menu binding |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2867 ;; Replace existing "print" item by "Printing" item. |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2868 ;; If you're changing this file, you'll load it a second, |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2869 ;; third... time, but "print" item exists only in the first load. |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2870 (eval-and-compile |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2871 (cond |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2872 ;; GNU Emacs 20 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2873 ((< emacs-major-version 21) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2874 (defun pr-global-menubar (pr-menu-spec) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2875 (require 'easymenu) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2876 (easy-menu-change '("tools") "Printing" pr-menu-spec pr-menu-print-item) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2877 (when pr-menu-print-item |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2878 (easy-menu-remove-item nil '("tools") pr-menu-print-item) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2879 (setq pr-menu-print-item nil |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2880 pr-menu-bar (vector 'menu-bar 'tools |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2881 (pr-get-symbol "Printing"))))) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2882 ) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2883 ;; GNU Emacs 21 & 22 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2884 (t |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2885 (defun pr-global-menubar (pr-menu-spec) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2886 (require 'easymenu) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2887 (let ((menu-file (if (= emacs-major-version 21) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2888 '("menu-bar" "files") ; GNU Emacs 21 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2889 '("menu-bar" "file")))) ; GNU Emacs 22 or higher |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2890 (cond |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2891 (pr-menu-print-item |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2892 (easy-menu-add-item global-map menu-file |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2893 (easy-menu-create-menu "Print" pr-menu-spec) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2894 "print-buffer") |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2895 (dolist (item '("print-buffer" "print-region" |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2896 "ps-print-buffer-faces" "ps-print-region-faces" |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2897 "ps-print-buffer" "ps-print-region")) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2898 (easy-menu-remove-item global-map menu-file item)) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2899 (setq pr-menu-print-item nil |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2900 pr-menu-bar (vector 'menu-bar |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2901 (pr-get-symbol (nth 1 menu-file)) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2902 (pr-get-symbol "Print")))) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2903 (t |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2904 (easy-menu-add-item global-map menu-file |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2905 (easy-menu-create-menu "Print" pr-menu-spec))) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2906 ))) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2907 ))) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2908 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2909 (eval-and-compile |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2910 (cond |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2911 (ps-windows-system |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2912 ;; GNU Emacs for Windows 9x/NT |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2913 (defun pr-menu-position (entry index horizontal) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2914 (let ((pos (cdr (mouse-pixel-position)))) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2915 (list |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2916 (list (or (car pos) 0) ; X |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2917 (- (or (cdr pos) 0) ; Y |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2918 (* (pr-menu-index entry index) pr-menu-char-height))) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2919 (selected-frame)))) ; frame |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2920 ) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2921 (t |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2922 ;; GNU Emacs |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2923 (defun pr-menu-position (entry index horizontal) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2924 (let ((pos (cdr (mouse-pixel-position)))) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2925 (list |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2926 (list (- (or (car pos) 0) ; X |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2927 (* horizontal pr-menu-char-width)) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2928 (- (or (cdr pos) 0) ; Y |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2929 (* (pr-menu-index entry index) pr-menu-char-height))) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2930 (selected-frame)))) ; frame |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2931 ))) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2932 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2933 (defvar pr-menu-position nil) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2934 (defvar pr-menu-state nil) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2935 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2936 ;; GNU Emacs |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2937 (defun pr-menu-lookup (path) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2938 (lookup-key global-map |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2939 (if path |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2940 (vconcat pr-menu-bar |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2941 (mapcar 'pr-get-symbol |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2942 (if (listp path) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2943 path |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2944 (list path)))) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2945 pr-menu-bar))) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2946 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2947 ;; GNU Emacs |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2948 (defun pr-menu-lock (entry index horizontal state path) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2949 (when pr-menu-lock |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2950 (or (and pr-menu-position (eq state pr-menu-state)) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2951 (setq pr-menu-position (pr-menu-position entry index horizontal) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2952 pr-menu-state state)) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2953 (let* ((menu (pr-menu-lookup path)) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2954 (result (x-popup-menu pr-menu-position menu))) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2955 (and result |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2956 (let ((command (lookup-key menu (vconcat result)))) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2957 (if (fboundp command) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2958 (funcall command) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2959 (eval command))))) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2960 (setq pr-menu-position nil))) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2961 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2962 ;; GNU Emacs |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2963 (defalias 'pr-update-mode-line 'force-mode-line-update) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2964 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2965 ;; GNU Emacs |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2966 (defun pr-do-update-menus (&optional force) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2967 (pr-menu-alist pr-ps-printer-alist |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2968 'pr-ps-name |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2969 'pr-menu-set-ps-title |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2970 "PostScript Printers" |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2971 'pr-ps-printer-menu-modified |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2972 force |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2973 "PostScript Printers" |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2974 'postscript 2) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2975 (pr-menu-alist pr-txt-printer-alist |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2976 'pr-txt-name |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2977 'pr-menu-set-txt-title |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2978 "Text Printers" |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2979 'pr-txt-printer-menu-modified |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2980 force |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2981 "Text Printers" |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2982 'text 2) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2983 (let ((save-var pr-ps-utility-menu-modified)) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2984 (pr-menu-alist pr-ps-utility-alist |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2985 'pr-ps-utility |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2986 'pr-menu-set-utility-title |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2987 '("PostScript Print" "File" "PostScript Utility") |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2988 'save-var |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2989 force |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2990 "PostScript Utility" |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2991 nil 1)) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2992 (pr-menu-alist pr-ps-utility-alist |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2993 'pr-ps-utility |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2994 'pr-menu-set-utility-title |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2995 '("PostScript Preview" "File" "PostScript Utility") |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2996 'pr-ps-utility-menu-modified |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2997 force |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2998 "PostScript Utility" |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2999 nil 1) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3000 (pr-even-or-odd-pages ps-even-or-odd-pages force)) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3001 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3002 ;; GNU Emacs |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3003 (defun pr-menu-get-item (name-list) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3004 ;; NAME-LIST is a string or a list of strings. |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3005 (or (listp name-list) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3006 (setq name-list (list name-list))) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3007 (and name-list |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3008 (let* ((reversed (reverse name-list)) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3009 (name (pr-get-symbol (car reversed))) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3010 (path (nreverse (cdr reversed))) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3011 (menu (lookup-key |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3012 global-map |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3013 (vconcat pr-menu-bar |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3014 (mapcar 'pr-get-symbol path))))) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3015 (assq name (nthcdr 2 menu))))) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3016 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3017 ;; GNU Emacs |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3018 (defvar pr-temp-menu nil) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3019 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3020 ;; GNU Emacs |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3021 (defun pr-menu-alist (alist var-sym fun menu-path modified-sym force name |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3022 entry index) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3023 (when (and alist (or force (symbol-value modified-sym))) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3024 (easy-menu-define pr-temp-menu nil "" |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3025 (pr-menu-create name alist var-sym fun entry index)) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3026 (let ((item (pr-menu-get-item menu-path))) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3027 (and item |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3028 (let* ((binding (nthcdr 3 item)) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3029 (key-binding (cdr binding))) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3030 (setcar binding pr-temp-menu) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3031 (and key-binding (listp (car key-binding)) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3032 (setcdr binding (cdr key-binding))) ; skip KEY-BINDING |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3033 (funcall fun (symbol-value var-sym) item)))) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3034 (set modified-sym nil))) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3035 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3036 ;; GNU Emacs |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3037 (defun pr-menu-set-item-name (item name) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3038 (and item |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3039 (setcar (nthcdr 2 item) name))) ; ITEM-NAME |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3040 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3041 ;; GNU Emacs |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3042 (defun pr-menu-set-ps-title (value &optional item entry index) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3043 (pr-menu-set-item-name (or item |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3044 (pr-menu-get-item "PostScript Printers")) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3045 (format "PostScript Printer: %s" value)) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3046 (pr-ps-set-printer value) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3047 (and index |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3048 (pr-menu-lock entry index 12 'toggle nil))) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3049 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3050 ;; GNU Emacs |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3051 (defun pr-menu-set-txt-title (value &optional item entry index) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3052 (pr-menu-set-item-name (or item |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3053 (pr-menu-get-item "Text Printers")) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3054 (format "Text Printer: %s" value)) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3055 (pr-txt-set-printer value) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3056 (and index |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3057 (pr-menu-lock entry index 12 'toggle nil))) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3058 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3059 ;; GNU Emacs |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3060 (defun pr-menu-set-utility-title (value &optional item entry index) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3061 (let ((name (symbol-name value))) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3062 (if item |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3063 (pr-menu-set-item-name item name) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3064 (pr-menu-set-item-name |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3065 (pr-menu-get-item |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3066 '("PostScript Print" "File" "PostScript Utility")) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3067 name) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3068 (pr-menu-set-item-name |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3069 (pr-menu-get-item |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3070 '("PostScript Preview" "File" "PostScript Utility")) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3071 name))) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3072 (pr-ps-set-utility value) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3073 (and index |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3074 (pr-menu-lock entry index 5 nil '("PostScript Print" "File")))) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3075 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3076 ;; GNU Emacs |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3077 (defun pr-even-or-odd-pages (value &optional no-lock) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3078 (pr-menu-set-item-name (pr-menu-get-item "Print All Pages") |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3079 (cdr (assq value pr-even-or-odd-alist))) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3080 (setq ps-even-or-odd-pages value) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3081 (or no-lock |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3082 (pr-menu-lock 'postscript-options 8 12 'toggle nil))) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3083 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3084 )) ; end cond featurep |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3085 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3086 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3087 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3088 ;; Customization Functions |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3089 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3090 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3091 (defun pr-alist-custom-set (symbol value) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3092 "Set the value of custom variables for printer & utility selection." |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3093 (set symbol value) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3094 (and (featurep 'printing) ; update only after printing is loaded |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3095 (pr-update-menus t))) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3096 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3097 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3098 (defun pr-ps-utility-custom-set (symbol value) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3099 "Update utility menu entry." |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3100 (set symbol value) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3101 (and (featurep 'printing) ; update only after printing is loaded |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3102 (pr-menu-set-utility-title value))) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3103 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3104 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3105 (defun pr-ps-name-custom-set (symbol value) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3106 "Update `PostScript Printer:' menu entry." |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3107 (set symbol value) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3108 (and (featurep 'printing) ; update only after printing is loaded |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3109 (pr-menu-set-ps-title value))) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3110 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3111 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3112 (defun pr-txt-name-custom-set (symbol value) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3113 "Update `Text Printer:' menu entry." |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3114 (set symbol value) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3115 (and (featurep 'printing) ; update only after printing is loaded |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3116 (pr-menu-set-txt-title value))) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3117 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3118 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3119 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3120 ;; User Interface (I) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3121 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3122 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3123 (defgroup printing nil |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3124 "Printing Utilities group." |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3125 :tag "Printing Utilities" |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3126 :link '(emacs-library-link :tag "Source Lisp File" "printing.el") |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3127 :prefix "pr-" |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3128 :version "20" |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3129 :group 'wp |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3130 :group 'postscript) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3131 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3132 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3133 (defcustom pr-path-style |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3134 (if (and (not pr-cygwin-system) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3135 ps-windows-system) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3136 'windows |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3137 'unix) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3138 "*Specify which path style to use for external commands. |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3139 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3140 Valid values are: |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3141 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3142 windows Windows 9x/NT style (\\) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3143 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3144 unix Unix style (/)" |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3145 :type '(choice :tag "Path style" |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3146 (const :tag "Windows 9x/NT Style (\\)" :value windows) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3147 (const :tag "Unix Style (/)" :value unix)) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3148 :version "20" |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3149 :group 'printing) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3150 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3151 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3152 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3153 ;; Internal Functions (I) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3154 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3155 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3156 (defun pr-dosify-file-name (path) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3157 "Replace unix-style directory separator character with dos/windows one." |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3158 (interactive "sPath: ") |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3159 (if (eq pr-path-style 'windows) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3160 (subst-char-in-string ?/ ?\\ path) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3161 path)) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3162 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3163 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3164 (defun pr-unixify-file-name (path) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3165 "Replace dos/windows-style directory separator character with unix one." |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3166 (interactive "sPath: ") |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3167 (if (eq pr-path-style 'windows) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3168 (subst-char-in-string ?\\ ?/ path) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3169 path)) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3170 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3171 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3172 (defun pr-standard-file-name (path) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3173 "Ensure the proper directory separator depending on the OS. |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3174 That is, if Emacs is running on DOS/Windows, ensure dos/windows-style directory |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3175 separator; otherwise, ensure unix-style directory separator." |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3176 (if (or pr-cygwin-system ps-windows-system) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3177 (subst-char-in-string ?/ ?\\ path) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3178 (subst-char-in-string ?\\ ?/ path))) |
49646 | 3179 |
3180 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
3181 ;; Macros |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
3182 |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
3183 |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
3184 (defmacro pr-save-file-modes (&rest body) |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
3185 "Set temporally file modes to `pr-file-modes'." |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
3186 `(let ((pr--default-file-modes (default-file-modes))) ; save default |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
3187 (set-default-file-modes pr-file-modes) |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
3188 ,@body |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
3189 (set-default-file-modes pr--default-file-modes))) ; restore default |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
3190 |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
3191 |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
3192 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
49646 | 3193 ;; Keys & Menus |
3194 | |
3195 | |
3196 (defsubst pr-visible-p (key) | |
3197 (memq key pr-visible-entry-list)) | |
3198 | |
3199 | |
3200 (defsubst pr-mode-alist-p () | |
3201 (cdr (assq major-mode pr-mode-alist))) | |
3202 | |
3203 | |
3204 (defsubst pr-auto-mode-p () | |
3205 (and pr-auto-mode (pr-mode-alist-p))) | |
3206 | |
3207 | |
3208 (defsubst pr-using-ghostscript-p () | |
3209 (and pr-print-using-ghostscript (not pr-spool-p))) | |
3210 | |
3211 | |
66951
e21a70dc8958
(easy-menu-intern): Don't define.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
65680
diff
changeset
|
3212 (defalias 'pr-get-symbol |
73027
575850f5bd53
Adjust X-URL
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
68651
diff
changeset
|
3213 (if (fboundp 'easy-menu-intern) ; hacked from easymenu.el |
66951
e21a70dc8958
(easy-menu-intern): Don't define.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
65680
diff
changeset
|
3214 'easy-menu-intern |
e21a70dc8958
(easy-menu-intern): Don't define.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
65680
diff
changeset
|
3215 (lambda (s) (if (stringp s) (intern s) s)))) |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3216 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3217 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3218 (defconst pr-menu-spec |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3219 ;; Menu mapping: |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3220 ;; unfortunately XEmacs doesn't support :active for submenus, |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3221 ;; only for items. |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3222 ;; So, it uses :included instead of :active. |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3223 ;; Also, XEmacs doesn't support :help tag. |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3224 (let ((pr-:active (if (featurep 'xemacs) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3225 :included ; XEmacs |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3226 :active)) ; GNU Emacs |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3227 (pr-:help (if (featurep 'xemacs) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3228 'ignore ; XEmacs |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3229 #'(lambda (text) (list :help text))))) ; GNU Emacs |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3230 `( |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3231 ["Printing Interface" pr-interface |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3232 ,@(funcall |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3233 pr-:help "Use buffer interface instead of menu interface")] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3234 "--" |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3235 ("PostScript Preview" :included (pr-visible-p 'postscript) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3236 ,@(funcall |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3237 pr-:help "Preview PostScript instead of sending to printer") |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3238 ("Directory" ,pr-:active (not pr-spool-p) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3239 ["1-up" (pr-ps-directory-preview 1 nil nil t) t] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3240 ["2-up" (pr-ps-directory-preview 2 nil nil t) t] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3241 ["4-up" (pr-ps-directory-preview 4 nil nil t) t] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3242 ["Other..." (pr-ps-directory-preview nil nil nil t) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3243 :keys "\\[pr-ps-buffer-preview]"]) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3244 ("Buffer" ,pr-:active (not pr-spool-p) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3245 ["1-up" (pr-ps-buffer-preview 1 t) t] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3246 ["2-up" (pr-ps-buffer-preview 2 t) t] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3247 ["4-up" (pr-ps-buffer-preview 4 t) t] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3248 ["Other..." (pr-ps-buffer-preview nil t) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3249 :keys "\\[pr-ps-buffer-preview]"]) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3250 ("Region" ,pr-:active (and (not pr-spool-p) (ps-mark-active-p)) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3251 ["1-up" (pr-ps-region-preview 1 t) t] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3252 ["2-up" (pr-ps-region-preview 2 t) t] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3253 ["4-up" (pr-ps-region-preview 4 t) t] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3254 ["Other..." (pr-ps-region-preview nil t) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3255 :keys "\\[pr-ps-region-preview]"]) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3256 ("Mode" ,pr-:active (and (not pr-spool-p) (pr-mode-alist-p)) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3257 ["1-up" (pr-ps-mode-preview 1 t) t] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3258 ["2-up" (pr-ps-mode-preview 2 t) t] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3259 ["4-up" (pr-ps-mode-preview 4 t) t] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3260 ["Other..." (pr-ps-mode-preview nil t) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3261 :keys "\\[pr-ps-mode-preview]"]) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3262 ("File" |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3263 ["No Preprocessing..." (call-interactively 'pr-ps-file-preview) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3264 :keys "\\[pr-ps-file-preview]" |
58218
63c796a99b3e
adjust pr-menu-spec
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58204
diff
changeset
|
3265 ,@(funcall |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3266 pr-:help "Preview PostScript file")] |
49646 | 3267 "--" |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3268 ["PostScript Utility" pr-update-menus :active pr-ps-utility-alist |
58218
63c796a99b3e
adjust pr-menu-spec
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58204
diff
changeset
|
3269 ,@(funcall |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3270 pr-:help "Select PostScript utility")] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3271 "--" |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3272 ["1-up..." (pr-ps-file-up-preview 1 t t) pr-ps-utility-alist] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3273 ["2-up..." (pr-ps-file-up-preview 2 t t) pr-ps-utility-alist] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3274 ["4-up..." (pr-ps-file-up-preview 4 t t) pr-ps-utility-alist] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3275 ["Other..." (pr-ps-file-up-preview nil t t) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3276 :keys "\\[pr-ps-file-up-preview]" :active pr-ps-utility-alist] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3277 "--" |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3278 ["Landscape" pr-toggle-file-landscape-menu |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3279 :style toggle :selected pr-file-landscape |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3280 ,@(funcall |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3281 pr-:help "Toggle landscape for PostScript file") |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3282 :active pr-ps-utility-alist] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3283 ["Duplex" pr-toggle-file-duplex-menu |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3284 :style toggle :selected pr-file-duplex |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3285 ,@(funcall |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3286 pr-:help "Toggle duplex for PostScript file") |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3287 :active pr-ps-utility-alist] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3288 ["Tumble" pr-toggle-file-tumble-menu |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3289 :style toggle :selected pr-file-tumble |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3290 ,@(funcall |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3291 pr-:help "Toggle tumble for PostScript file") |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3292 :active (and pr-file-duplex pr-ps-utility-alist)]) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3293 ["Despool..." (call-interactively 'pr-despool-preview) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3294 :active pr-spool-p :keys "\\[pr-despool-preview]" |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3295 ,@(funcall |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3296 pr-:help "Despool PostScript buffer to printer or file (C-u)")]) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3297 ("PostScript Print" :included (pr-visible-p 'postscript) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3298 ,@(funcall |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3299 pr-:help "Send PostScript to printer or file (C-u)") |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3300 ("Directory" |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3301 ["1-up" (pr-ps-directory-ps-print 1 nil nil t) t] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3302 ["2-up" (pr-ps-directory-ps-print 2 nil nil t) t] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3303 ["4-up" (pr-ps-directory-ps-print 4 nil nil t) t] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3304 ["Other..." (pr-ps-directory-ps-print nil nil nil t) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3305 :keys "\\[pr-ps-buffer-ps-print]"]) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3306 ("Buffer" |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3307 ["1-up" (pr-ps-buffer-ps-print 1 t) t] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3308 ["2-up" (pr-ps-buffer-ps-print 2 t) t] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3309 ["4-up" (pr-ps-buffer-ps-print 4 t) t] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3310 ["Other..." (pr-ps-buffer-ps-print nil t) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3311 :keys "\\[pr-ps-buffer-ps-print]"]) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3312 ("Region" ,pr-:active (ps-mark-active-p) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3313 ["1-up" (pr-ps-region-ps-print 1 t) t] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3314 ["2-up" (pr-ps-region-ps-print 2 t) t] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3315 ["4-up" (pr-ps-region-ps-print 4 t) t] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3316 ["Other..." (pr-ps-region-ps-print nil t) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3317 :keys "\\[pr-ps-region-ps-print]"]) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3318 ("Mode" ,pr-:active (pr-mode-alist-p) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3319 ["1-up" (pr-ps-mode-ps-print 1 t) t] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3320 ["2-up" (pr-ps-mode-ps-print 2 t) t] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3321 ["4-up" (pr-ps-mode-ps-print 4 t) t] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3322 ["Other..." (pr-ps-mode-ps-print nil t) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3323 :keys "\\[pr-ps-mode-ps-print]"]) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3324 ("File" |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3325 ["No Preprocessing..." (call-interactively 'pr-ps-file-ps-print) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3326 :keys "\\[pr-ps-file-ps-print]" |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3327 ,@(funcall |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3328 pr-:help "Send PostScript file to printer")] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3329 "--" |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3330 ["PostScript Utility" pr-update-menus :active pr-ps-utility-alist |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3331 ,@(funcall |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3332 pr-:help "Select PostScript utility")] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3333 "--" |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3334 ["1-up..." (pr-ps-file-up-ps-print 1 t t) pr-ps-utility-alist] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3335 ["2-up..." (pr-ps-file-up-ps-print 2 t t) pr-ps-utility-alist] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3336 ["4-up..." (pr-ps-file-up-ps-print 4 t t) pr-ps-utility-alist] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3337 ["Other..." (pr-ps-file-up-ps-print nil t t) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3338 :keys "\\[pr-ps-file-up-ps-print]" :active pr-ps-utility-alist] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3339 "--" |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3340 ["Landscape" pr-toggle-file-landscape-menu |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3341 :style toggle :selected pr-file-landscape |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3342 ,@(funcall |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3343 pr-:help "Toggle landscape for PostScript file") |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3344 :active pr-ps-utility-alist] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3345 ["Duplex" pr-toggle-file-duplex-menu |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3346 :style toggle :selected pr-file-duplex |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3347 ,@(funcall |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3348 pr-:help "Toggle duplex for PostScript file") |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3349 :active pr-ps-utility-alist] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3350 ["Tumble" pr-toggle-file-tumble-menu |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3351 :style toggle :selected pr-file-tumble |
58218
63c796a99b3e
adjust pr-menu-spec
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58204
diff
changeset
|
3352 ,@(funcall |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3353 pr-:help "Toggle tumble for PostScript file") |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3354 :active (and pr-file-duplex pr-ps-utility-alist)]) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3355 ["Despool..." (call-interactively 'pr-despool-ps-print) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3356 :active pr-spool-p :keys "\\[pr-despool-ps-print]" |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3357 ,@(funcall |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3358 pr-:help "Despool PostScript buffer to printer or file (C-u)")]) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3359 ["PostScript Printers" pr-update-menus |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3360 :active pr-ps-printer-alist :included (pr-visible-p 'postscript) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3361 ,@(funcall |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3362 pr-:help "Select PostScript printer")] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3363 "--" |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3364 ("Printify" :included (pr-visible-p 'text) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3365 ,@(funcall |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3366 pr-:help |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3367 "Replace non-printing chars with printable representations.") |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3368 ["Directory" pr-printify-directory t] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3369 ["Buffer" pr-printify-buffer t] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3370 ["Region" pr-printify-region (ps-mark-active-p)]) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3371 ("Print" :included (pr-visible-p 'text) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3372 ,@(funcall |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3373 pr-:help "Send text to printer") |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3374 ["Directory" pr-txt-directory t] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3375 ["Buffer" pr-txt-buffer t] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3376 ["Region" pr-txt-region (ps-mark-active-p)] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3377 ["Mode" pr-txt-mode (pr-mode-alist-p)]) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3378 ["Text Printers" pr-update-menus |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3379 :active pr-txt-printer-alist :included (pr-visible-p 'text) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3380 ,@(funcall |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3381 pr-:help "Select text printer")] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3382 "--" |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3383 ["Landscape" pr-toggle-landscape-menu |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3384 :style toggle :selected ps-landscape-mode |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3385 :included (pr-visible-p 'postscript-options)] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3386 ["Print Header" pr-toggle-header-menu |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3387 :style toggle :selected ps-print-header |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3388 :included (pr-visible-p 'postscript-options)] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3389 ["Print Header Frame" pr-toggle-header-frame-menu |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3390 :style toggle :selected ps-print-header-frame :active ps-print-header |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3391 :included (pr-visible-p 'postscript-options)] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3392 ["Line Number" pr-toggle-line-menu |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3393 :style toggle :selected ps-line-number |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3394 :included (pr-visible-p 'postscript-options)] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3395 ["Zebra Stripes" pr-toggle-zebra-menu |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3396 :style toggle :selected ps-zebra-stripes |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3397 :included (pr-visible-p 'postscript-options)] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3398 ["Duplex" pr-toggle-duplex-menu |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3399 :style toggle :selected ps-spool-duplex |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3400 :included (pr-visible-p 'postscript-options)] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3401 ["Tumble" pr-toggle-tumble-menu |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3402 :style toggle :selected ps-spool-tumble :active ps-spool-duplex |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3403 :included (pr-visible-p 'postscript-options)] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3404 ["Upside-Down" pr-toggle-upside-down-menu |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3405 :style toggle :selected ps-print-upside-down |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3406 :included (pr-visible-p 'postscript-options)] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3407 ("Print All Pages" :included (pr-visible-p 'postscript-options) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3408 ,@(funcall |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3409 pr-:help "Select odd/even pages/sheets to print") |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3410 ["All Pages" (pr-even-or-odd-pages nil) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3411 :style radio :selected (eq ps-even-or-odd-pages nil)] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3412 ["Even Pages" (pr-even-or-odd-pages 'even-page) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3413 :style radio :selected (eq ps-even-or-odd-pages 'even-page)] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3414 ["Odd Pages" (pr-even-or-odd-pages 'odd-page) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3415 :style radio :selected (eq ps-even-or-odd-pages 'odd-page)] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3416 ["Even Sheets" (pr-even-or-odd-pages 'even-sheet) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3417 :style radio :selected (eq ps-even-or-odd-pages 'even-sheet)] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3418 ["Odd Sheets" (pr-even-or-odd-pages 'odd-sheet) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3419 :style radio :selected (eq ps-even-or-odd-pages 'odd-sheet)]) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3420 "--" |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3421 ["Spool Buffer" pr-toggle-spool-menu |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3422 :style toggle :selected pr-spool-p |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3423 :included (pr-visible-p 'postscript-process) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3424 ,@(funcall |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3425 pr-:help "Toggle PostScript spooling")] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3426 ["Print with faces" pr-toggle-faces-menu |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3427 :style toggle :selected pr-faces-p |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3428 :included (pr-visible-p 'postscript-process) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3429 ,@(funcall |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3430 pr-:help "Toggle PostScript printing with faces")] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3431 ["Print via Ghostscript" pr-toggle-ghostscript-menu |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3432 :style toggle :selected pr-print-using-ghostscript |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3433 :included (pr-visible-p 'postscript-process) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3434 ,@(funcall |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3435 pr-:help "Toggle PostScript generation using ghostscript")] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3436 "--" |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3437 ["Auto Region" pr-toggle-region-menu |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3438 :style toggle :selected pr-auto-region |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3439 :included (pr-visible-p 'printing)] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3440 ["Auto Mode" pr-toggle-mode-menu |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3441 :style toggle :selected pr-auto-mode |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3442 :included (pr-visible-p 'printing)] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3443 ["Menu Lock" pr-toggle-lock-menu |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3444 :style toggle :selected pr-menu-lock |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3445 :included (pr-visible-p 'printing)] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3446 "--" |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3447 ("Customize" :included (pr-visible-p 'help) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3448 ["printing" pr-customize t] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3449 ["ps-print" ps-print-customize t] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3450 ["lpr" lpr-customize t]) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3451 ("Show Settings" :included (pr-visible-p 'help) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3452 ["printing" pr-show-pr-setup t] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3453 ["ps-print" pr-show-ps-setup t] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3454 ["lpr" pr-show-lpr-setup t]) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3455 ["Help" pr-help :active t :included (pr-visible-p 'help)] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3456 ))) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3457 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3458 |
63328
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
3459 (defun pr-menu-bind () |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
3460 "Install `printing' menu in the menubar. |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
3461 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
3462 On Emacs 20, it replaces the Tools/Print menu by Tools/Printing menu. |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
3463 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
3464 On Emacs 21 and 22, it replaces the File/Print* menu entries by File/Print |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
3465 menu. |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
3466 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
3467 Calls `pr-update-menus' to adjust menus." |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
3468 (interactive) |
80951 | 3469 (pr-global-menubar pr-menu-spec) |
63328
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
3470 (pr-update-menus t)) |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3471 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3472 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3473 ;; Key binding |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3474 (let ((pr-print-key (if (featurep 'xemacs) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3475 'f22 ; XEmacs |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3476 'print))) ; GNU Emacs |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3477 (global-set-key `[,pr-print-key] 'pr-ps-fast-fire) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3478 ;; Well, M-print and S-print are used because in my keyboard S-print works |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3479 ;; and M-print doesn't. But M-print can work in other keyboard. |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3480 (global-set-key `[(meta ,pr-print-key)] 'pr-ps-mode-using-ghostscript) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3481 (global-set-key `[(shift ,pr-print-key)] 'pr-ps-mode-using-ghostscript) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3482 ;; Well, C-print and C-M-print are used because in my keyboard C-M-print works |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3483 ;; and C-print doesn't. But C-print can work in other keyboard. |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3484 (global-set-key `[(control ,pr-print-key)] 'pr-txt-fast-fire) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3485 (global-set-key `[(control meta ,pr-print-key)] 'pr-txt-fast-fire)) |
49646 | 3486 |
3487 | |
3488 ;;; You can also use something like: | |
3489 ;;;(global-set-key "\C-ci" 'pr-interface) | |
3490 ;;;(global-set-key "\C-cbp" 'pr-ps-buffer-print) | |
3491 ;;;(global-set-key "\C-cbx" 'pr-ps-buffer-preview) | |
3492 ;;;(global-set-key "\C-cbb" 'pr-ps-buffer-using-ghostscript) | |
3493 ;;;(global-set-key "\C-crp" 'pr-ps-region-print) | |
3494 ;;;(global-set-key "\C-crx" 'pr-ps-region-preview) | |
3495 ;;;(global-set-key "\C-crr" 'pr-ps-region-using-ghostscript) | |
3496 | |
3497 | |
3498 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
3499 ;; Help Message | |
3500 | |
3501 | |
3502 (defconst pr-help-message | |
3503 (concat "printing.el version " pr-version | |
3504 " ps-print.el version " ps-print-version | |
3505 "\n\n | |
3506 Menu Layout | |
3507 ----------- | |
3508 | |
3509 The `printing' menu (Tools/Printing or File/Print) has the following layout: | |
3510 | |
3511 +-----------------------------+ | |
3512 A 0 | Printing Interface | | |
3513 +-----------------------------+ +-A---------+ +-B------+ | |
3514 I 1 | PostScript Preview >|-------|Directory >|-----|1-up | | |
3515 2 | PostScript Print >|---- A |Buffer >|-- B |2-up | | |
3516 3 | PostScript Printer: name >|---- C |Region >|-- B |4-up | | |
3517 +-----------------------------+ |Mode >|-- B |Other...| | |
3518 II 4 | Printify >|-----\\ |File >|--\\ +--------+ | |
3519 5 | Print >|---\\ | |Despool... | | | |
3520 6 | Text Printer: name >|-\\ | | +-----------+ | | |
3521 +-----------------------------+ | | | +---------+ +------------+ | |
54210
602769168263
Replace "As Is..." in PostScript file print/preview by "No Preprocessing...".
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54209
diff
changeset
|
3522 III 7 |[ ]Landscape | | | \\-|Directory| | No Prep... | Ia |
49646 | 3523 8 |[ ]Print Header | | | |Buffer | +------------+ Ib |
3524 9 |[ ]Print Header Frame | | | |Region | | name >|- C | |
3525 10 |[ ]Line Number | | | +---------+ +------------+ | |
3526 11 |[ ]Zebra Stripes | | | +---------+ | 1-up... | Ic | |
3527 12 |[ ]Duplex | | \\---|Directory| | 2-up... | | |
3528 13 |[ ]Tumble | \\--\\ |Buffer | | 4-up... | | |
3529 14 |[ ]Upside-Down | | |Region | | Other... | | |
3530 15 | Print All Pages >|--\\ | |Mode | +------------+ | |
3531 +-----------------------------+ | | +---------+ |[ ]Landscape| Id | |
3532 IV 16 |[ ]Spool Buffer | | | +-C-------+ |[ ]Duplex | Ie | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
3533 17 |[ ]Print with faces | | \\--|( )name A| |[ ]Tumble | If |
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
3534 18 |[ ]Print via Ghostscript | | |( )name B| +------------+ |
49646 | 3535 +-----------------------------+ | |... | |
3536 V 19 |[ ]Auto Region | | |(*)name | | |
3537 20 |[ ]Auto Mode | | |... | | |
3538 21 |[ ]Menu Lock | | +---------+ +--------------+ | |
3539 +-----------------------------+ \\------------------|(*)All Pages | | |
3540 VI 22 | Customize >|--- D +-D------+ |( )Even Pages | | |
3541 23 | Show Settings >|-------|printing| |( )Odd Pages | | |
3542 24 | Help | |ps-print| |( )Even Sheets| | |
3543 +-----------------------------+ |lpr | |( )Odd Sheets | | |
3544 +--------+ +--------------+ | |
3545 | |
3546 See `pr-visible-entry-list' for hiding some parts of the menu. | |
3547 | |
3548 The menu has the following sections: | |
3549 | |
3550 A. Interface: | |
3551 | |
3552 0. You can use a buffer interface instead of menus. It looks like the | |
3553 customization buffer. Basically, it has the same options found in the | |
3554 menu and some extra options, all this on a buffer. | |
3555 | |
3556 I. PostScript printing: | |
3557 | |
3558 1. You can generate a PostScript file (if you type C-u before activating | |
3559 menu) or PostScript temporary file for a directory, a buffer, a region | |
3560 or a major mode, choosing 1-up, 2-up, 4-up or any other n-up printing; | |
3561 after file generation, ghostview is activated using the file generated | |
3562 as argument. This option is disabled if spooling is on (option 16). | |
3563 Also, if you already have a PostScript file you can preview it. | |
3564 Instead of previewing each buffer, region or major mode at once, you | |
3565 can save temporarily the PostScript code generated in a buffer and | |
3566 preview it later. The option `Despool...' despools the PostScript | |
3567 spooling buffer in a temporary file and uses ghostview to preview it. | |
3568 If you type C-u before choosing this option, the PostScript code | |
3569 generated is saved in a file instead of saving in a temporary file. To | |
3570 spool the PostScript code generated you need to turn on the option 16. | |
3571 The option `Despool...' is enabled if spooling is on (option 16). | |
3572 | |
3573 NOTE 1: It's possible to customize a major mode printing, just declare | |
3574 the customization in `pr-mode-alist' and invoke some of | |
3575 `*-mode*' commands or select Mode option in Printing menu. An | |
3576 example for major mode usage is when you're using gnus (or mh, | |
3577 or rmail, etc.) and you're in the *Summary* buffer, if you | |
3578 forget to switch to the *Article* buffer before printing, | |
3579 you'll get a nicely formatted list of article subjects shows | |
3580 up at the printer. With major mode printing you don't need to | |
3581 switch from gnus *Summary* buffer first. | |
3582 | |
3583 NOTE 2: There are the following options for PostScript file processing: | |
54210
602769168263
Replace "As Is..." in PostScript file print/preview by "No Preprocessing...".
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54209
diff
changeset
|
3584 Ia. Print the file *No Preprocessing*, that is, send it |
602769168263
Replace "As Is..." in PostScript file print/preview by "No Preprocessing...".
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54209
diff
changeset
|
3585 directly to PostScript printer. |
49646 | 3586 Ib. PostScript utility processing selection. |
3587 See `pr-ps-utility-alist' and `pr-setting-database' for | |
3588 documentation. | |
3589 Ic. Do n-up processing before printing. | |
3590 Id. Toggle on/off landscape for PostScript file processing. | |
3591 Ie. Toggle on/off duplex for PostScript file processing. | |
3592 If. Toggle on/off tumble for PostScript file processing. | |
3593 | |
3594 NOTE 3: Don't forget to download and install the utilities declared on | |
3595 `pr-ps-utility-alist'. | |
3596 | |
3597 2. Operate the same way as option 1, but it sends directly the PostScript | |
3598 code (or put in a file, if you've typed C-u) or it uses ghostscript to | |
3599 print the PostScript file generated. It depends on option 18, if it's | |
3600 turned on, it uses ghostscript; otherwise, it sends directly to | |
3601 printer. If spooling is on (option 16), the PostScript code is saved | |
3602 temporarily in a buffer instead of printing it or saving it in a file. | |
3603 Also, if you already have a PostScript file you can print it. | |
3604 Instead of printing each buffer, region or major mode at once, you can | |
3605 save temporarily the PostScript code generated in a buffer and print it | |
3606 later. The option `Despool...' despools the PostScript spooling buffer | |
3607 directly on a printer. If you type C-u before choosing this option, | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
3608 the PostScript code generated is saved in a file instead of sending it to |
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
3609 the printer. To spool the PostScript code generated you need to turn on |
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
3610 option 16. This option is enabled if spooling is on (option 16). |
49646 | 3611 See also the NOTE 1, NOTE 2 and NOTE 3 on option 1. |
3612 | |
3613 3. You can select a new PostScript printer to send PostScript code | |
3614 generated. For selection it's used all PostScript printers defined | |
3615 in `pr-ps-printer-alist' variable (see it for documentation). | |
3616 See also `pr-setting-database'. | |
3617 | |
3618 II. Text printing: | |
3619 | |
3620 4. If you have control characters (character code from \\000 to \\037) in a | |
3621 buffer and you want to print them in a text printer, select this | |
3622 option. All control characters in your buffer or region will be | |
3623 replaced by a printable representation. The printable representations | |
3624 use ^ (for ASCII control characters) or hex. The characters tab, | |
3625 linefeed, space, return and formfeed are not affected. | |
3626 You don't need to select this option if you use any option of section | |
3627 I, the PostScript engine treats control characters properly. | |
3628 | |
3629 5. If you want to print a directory, buffer, region or major mode in a | |
3630 text printer, select this option. See also the NOTE 1 on option 1. | |
3631 | |
3632 6. You can select a new text printer to send text generated. For | |
3633 selection it's used all text printers defined in `pr-txt-printer-alist' | |
3634 variable (see it for documentation). | |
3635 See also `pr-setting-database'. | |
3636 | |
3637 III. PostScript page toggle options: | |
3638 | |
3639 7. If you want a PostScript landscape printing, turn on this option. | |
3640 | |
3641 8. If you want to have a header in each page in your PostScript code, | |
3642 turn on this option. | |
3643 | |
3644 9. If you want to draw a gaudy frame around the header, turn on this | |
3645 option. This option is enabled if print header is on (option 8). | |
3646 | |
3647 10. If you want that the line number is printed in your PostScript code, | |
3648 turn on this option. | |
3649 | |
3650 11. If you want background zebra stripes in your PostScript code, turn on | |
3651 this option. | |
3652 | |
3653 12. If you want a duplex printing and your PostScript printer has this | |
3654 feature, turn on this option. | |
3655 | |
3656 13. If you turned on duplex printing, you can choose if you want to have a | |
3657 printing suitable for binding on the left or right (tumble off), or to | |
3658 have a printing suitable for binding at top or bottom (tumble on). | |
3659 This option is enabled if duplex is on (option 12). | |
3660 | |
3661 14. If you want a PostScript upside-down printing, turn on this option. | |
3662 | |
3663 15. With this option, you can choose if you want to print all pages, odd | |
3664 pages, even pages, odd sheets or even sheets. | |
3665 See also `ps-even-or-odd-pages'. | |
3666 | |
3667 IV. PostScript processing toggle options: | |
3668 | |
3669 16. If you want to spool the PostScript code generated, turn on this | |
3670 option. To spool the PostScript code generated use option 2. You can | |
3671 despool later by choosing option 1 or 2, sub-option `Despool...'. | |
3672 | |
3673 17. If you use colors in your buffers and want to see these colors on your | |
3674 PostScript code generated, turn on this option. If you have a | |
3675 black/white PostScript printer, these colors are displayed in gray | |
3676 scale by PostScript printer interpreter. | |
3677 | |
3678 18. If you don't have a PostScript printer to send PostScript files, turn | |
3679 on this option. When this option is on, the ghostscript is used to | |
3680 print PostScript files. In GNU or Unix system, if ghostscript is set | |
3681 as a PostScript filter, you don't need to turn on this option. | |
3682 | |
3683 V. Printing customization: | |
3684 | |
3685 19. If you want that region is automagically detected, turn on this | |
3686 option. Note that this will only work if you're using transient mark | |
3687 mode. When this option is on, the `*-buffer*' commands will behave | |
3688 like `*-region*' commands, that is, `*-buffer*' commands will print | |
3689 only the region marked instead of all buffer. | |
3690 | |
3691 20. Turn this option on if you want that when current major-mode is | |
3692 declared in `pr-mode-alist', the `*-buffer*' and `*-region*' commands | |
3693 behave like `*-mode*' commands. | |
3694 | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
3695 21. If you want that Printing menu stays open while you are setting |
49646 | 3696 toggle options, turn on this option. The variables |
3697 `pr-menu-char-height' and `pr-menu-char-width' are used to guess the | |
3698 menu position, so don't forget to adjust these variables if menu | |
3699 position is not ok. | |
3700 | |
3701 VI. Customization: | |
3702 | |
3703 22. Besides all options in section III, IV and V, you can customize much | |
3704 more PostScript options in `ps-print' option. Or you can customize | |
3705 some `lpr' options for text printing. Or customize `printing' | |
3706 options. | |
3707 | |
3708 23. Show current settings for `printing', `ps-print' or `lpr'. | |
3709 | |
3710 24. Quick help for printing menu layout. | |
3711 ") | |
3712 "Printing help message.") | |
3713 | |
3714 | |
3715 (defconst pr-interface-help-message | |
3716 (concat "printing.el version " pr-version | |
3717 " ps-print.el version " ps-print-version | |
3718 "\n\n | |
3719 The printing interface buffer has the same functionality as the printing menu. | |
3720 The major difference is that the states (like sending PostScript generated to a | |
3721 file, n-up printing, etc.) are set and saved between priting buffer | |
3722 activation. Also, the landscape, duplex and tumble values are the same for | |
3723 PostScript file and directory/buffer/region/mode processing; using menu, there | |
3724 are different value sets for PostScript file and directory/buffer/region/mode | |
3725 processing. | |
3726 | |
3727 The printing interface buffer has the following sections: | |
3728 | |
3729 1. Print: | |
3730 | |
3731 Here you can choose to print/preview a buffer, a directory or a PostScript | |
3732 file: | |
3733 | |
3734 1a. Buffer: | |
3735 | |
3736 * Buffer List: | |
3737 Select a buffer from the current buffer list. | |
3738 | |
3739 * Region: | |
3740 If it's on, this means that the selected buffer has an active region, | |
3741 so you can turn on/off, as you wish. | |
3742 If it's off when a buffer is selected, this means that the selected | |
3743 buffer has no active region, so it'll not be possible to turn it on. | |
3744 If you want to process the region, let this option on. | |
3745 If you want to process the whole buffer, let this option off. | |
3746 | |
3747 * Mode: | |
3748 If it's on, this means that the selected buffer major mode is declared | |
3749 for major mode processing, so you can turn on/off, as you wish. | |
3750 If it's off when a buffer is selected, this means that the selected | |
3751 buffer major mode isn't declared for major mode processing, so it'll | |
3752 not be possible to turn it on. | |
3753 If you want the major mode processing, let this option on. | |
3754 If you don't want the major mode processing, let this option off. | |
3755 | |
3756 NOTE 1: It's possible to customize a major mode printing, just declare | |
3757 the customization in `pr-mode-alist' and invoke some of | |
3758 `*-mode*' commands or select Mode option in Printing menu. An | |
3759 example for major mode usage is when you're using gnus (or mh, | |
3760 or rmail, etc.) and you're in the *Summary* buffer, if you | |
3761 forget to switch to the *Article* buffer before printing, | |
3762 you'll get a nicely formatted list of article subjects shows | |
3763 up at the printer. With major mode printing you don't need to | |
3764 switch from gnus *Summary* buffer first. | |
3765 | |
3766 1b. Directory: | |
3767 | |
3768 * Directory: | |
3769 Specify a valid directory path. | |
3770 | |
3771 * File Regexp: | |
3772 Specify a file name regexp. All file names in the directory that | |
3773 match with regexp will be printed/previewed. An empty file name | |
3774 regexp means to print/preview all files in the directory. | |
3775 | |
3776 * List Directory Entry: | |
3777 If it's turned on, list directory entries besides file entries. | |
3778 | |
3779 1c. PostScript file: | |
3780 | |
3781 * PostScript File: | |
3782 Specify an existent PostScript file to print/preview. | |
3783 | |
3784 * PostScript Utility: | |
3785 Select a PostScript utility. | |
3786 See `pr-ps-utility-alist' and `pr-setting-database' for documentation. | |
3787 | |
3788 NOTE 2: Don't forget to download and install the utilities declared on | |
3789 `pr-ps-utility-alist'. | |
3790 | |
54210
602769168263
Replace "As Is..." in PostScript file print/preview by "No Preprocessing...".
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54209
diff
changeset
|
3791 * No Preprocessing: |
49646 | 3792 If it's turned on, don't use the PostScript utility to preprocess the |
3793 PostScript file before printing/previewing. | |
3794 | |
3795 2. PostScript printer: | |
3796 | |
3797 * PostScript Printer: | |
3798 You can select a new PostScript printer to send PostScript code | |
3799 generated. For selection it's used all PostScript printers defined | |
3800 in `pr-ps-printer-alist' variable (see it for documentation). | |
3801 See also `pr-setting-database'. | |
3802 | |
3803 * Despool: | |
3804 If spooling is on, you can turn it on/off, as you wish. | |
3805 If spooling is off, it'll not be possible to turn it on. | |
3806 If it's turned on, specify to despools the PostScript spooling buffer in | |
3807 a temporary file or in the selected PostScript file when | |
3808 printing/previewing. | |
3809 | |
3810 * Preview: | |
3811 Preview the PostScript generated. | |
3812 | |
3813 * Print: | |
3814 Print the PostScript generated. | |
3815 | |
3816 * Quit: | |
3817 Quit from printing interface buffer. | |
3818 | |
3819 * Send to Printer/Temporary File: | |
3820 If it's turned on, the PostScript generated is sent directly to | |
3821 PostScript printer or, for previewing, to a temporary file. | |
3822 | |
3823 * Send to File: | |
3824 Specify a file name to send the PostScript generated. | |
3825 | |
3826 * N-Up: | |
3827 Specify n-up printing. | |
3828 | |
3829 3. Text printer: | |
3830 | |
3831 * Text Printer: | |
3832 Select a new text printer to send text generated. For selection it's used | |
3833 all text printers defined in `pr-txt-printer-alist' variable (see it for | |
3834 documentation). See also `pr-setting-database'. | |
3835 | |
3836 * Printify: | |
3837 If you have control characters (character code from \\000 to \\037) in a | |
3838 buffer and you want to print them in a text printer, select this | |
3839 option. All control characters in your buffer or region will be | |
3840 replaced by a printable representation. The printable representations | |
3841 use ^ (for ASCII control characters) or hex. The characters tab, | |
3842 linefeed, space, return and formfeed are not affected. | |
3843 You don't need to select this option if you use any option of section | |
3844 I, the PostScript engine treats control characters properly. | |
3845 | |
3846 * Print: | |
3847 To print a directory, buffer, region or major mode in a | |
3848 text printer, select this option. See also the NOTE 1 on section 1. | |
3849 | |
3850 * Quit: | |
3851 Quit from printing interface buffer. | |
3852 | |
3853 4. Settings: | |
3854 | |
3855 There are 3 setting columns: | |
3856 | |
3857 4a. First column (left column): | |
3858 | |
3859 * Landscape: | |
3860 PostScript landscape printing. | |
3861 | |
3862 * Print Header: | |
3863 To have a header in each page in your PostScript code. | |
3864 | |
3865 * Print Header Frame: | |
3866 To draw a gaudy frame around the header. | |
3867 | |
3868 * Line Number: | |
3869 The line number is printed in your PostScript code. | |
3870 | |
3871 * Zebra Stripes: | |
3872 Background zebra stripes in your PostScript code. | |
3873 | |
3874 * Duplex: | |
3875 Duplex printing (if your PostScript printer has this feature). | |
3876 | |
3877 * Tumble: | |
3878 If duplex printing is on, you can choose if you want to have a | |
3879 printing suitable for binding on the left or right (tumble off), or to | |
3880 have a printing suitable for binding at top or bottom (tumble on). | |
3881 | |
3882 * Upside-Down: | |
3883 PostScript upside-down printing. | |
3884 | |
3885 4b. Second column (middle column): | |
3886 | |
3887 * Auto Region: | |
3888 If you want that region is automagically detected, turn on this | |
3889 option. Note that this will only work if you're using transient mark | |
3890 mode. When this option is on, the `*-buffer*' commands will behave | |
3891 like `*-region*' commands, that is, `*-buffer*' commands will print | |
3892 only the region marked instead of all buffer. | |
3893 | |
3894 * Auto Mode: | |
3895 Turn this option on if you want that when current major-mode is | |
3896 declared in `pr-mode-alist', the `*-buffer*' and `*-region*' commands | |
3897 behave like `*-mode*' commands. | |
3898 | |
3899 * Menu Lock: | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
3900 If you want that Printing menu stays open while you are setting |
49646 | 3901 toggle options, turn on this option. The variables |
3902 `pr-menu-char-height' and `pr-menu-char-width' are used to guess the | |
3903 menu position, so don't forget to adjust these variables if menu | |
3904 position is not ok. | |
3905 | |
3906 * Spool Buffer: | |
3907 To spool the PostScript code generated. You can despool later by | |
3908 setting Despool option on PostScript printer section. | |
3909 | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
3910 * Print with faces: |
49646 | 3911 If you use colors in your buffers and want to see these colors on your |
3912 PostScript code generated, turn on this option. If you have a | |
3913 black/white PostScript printer, these colors are displayed in gray | |
3914 scale by PostScript printer interpreter. | |
3915 | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
3916 * Print via Ghostscript: |
49646 | 3917 If you don't have a PostScript printer to send PostScript files, turn |
3918 on this option. When this option is on, the ghostscript is used to | |
3919 print PostScript files. In GNU or Unix system, if ghostscript is set | |
3920 as a PostScript filter, you don't need to turn on this option. | |
3921 | |
3922 * Parity Page Menu: | |
3923 To print all pages, odd pages, even pages, odd sheets or even sheets. | |
3924 See also `ps-even-or-odd-pages'. | |
3925 | |
3926 4c. Third column (right column): | |
3927 | |
3928 * Verbose: | |
3929 That is, to be verbose when editing a field in interface buffer. | |
3930 | |
3931 5. Customize: | |
3932 | |
3933 Besides all options in section 4, you can customize much more PostScript | |
3934 options in `ps-print' option. Or you can customize some `lpr' options for | |
3935 text printing. Or customize `printing' options. | |
3936 | |
3937 6. Show settings: | |
3938 | |
3939 Show current settings for `printing', `ps-print' or `lpr'. | |
3940 | |
3941 7. Help: | |
3942 | |
3943 Quick help for printing interface buffer and printing menu layout. You can | |
3944 also quit the printing interface buffer or kill all printing help buffer. | |
3945 ") | |
3946 "Printing buffer interface help message.") | |
3947 | |
3948 | |
3949 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
3950 ;; Commands | |
3951 | |
3952 | |
3953 ;;;###autoload | |
3954 (defun pr-interface (&optional buffer) | |
3955 "Activate the printing interface buffer. | |
3956 | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
3957 If BUFFER is nil, the current buffer is used for printing. |
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
3958 |
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
3959 For more information, type \\[pr-interface-help]." |
49646 | 3960 (interactive) |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3961 (save-excursion |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3962 (set-buffer (or buffer (current-buffer))) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3963 (pr-create-interface))) |
49646 | 3964 |
3965 | |
3966 ;;;###autoload | |
3967 (defun pr-ps-directory-preview (n-up dir file-regexp &optional filename) | |
3968 "Preview directory using ghostview. | |
3969 | |
3970 Interactively, the command prompts for N-UP printing number, a directory, a | |
3971 file name regexp for matching and, when you use a prefix argument (C-u), the | |
3972 command prompts the user for a file name, and saves the PostScript image in | |
3973 that file instead of saving it in a temporary file. | |
3974 | |
3975 Noninteractively, if N-UP is nil, prompts for N-UP printing number. If DIR is | |
3976 nil, prompts for DIRectory. If FILE-REGEXP is nil, prompts for | |
3977 FILE(name)-REGEXP. The argument FILENAME is treated as follows: if it's nil, | |
3978 save the image in a temporary file. If FILENAME is a string, save the | |
3979 PostScript image in a file with that name. If FILENAME is t, prompts for a | |
3980 file name. | |
3981 | |
3982 See also documentation for `pr-list-directory'." | |
3983 (interactive (pr-interactive-ps-dir-args (pr-prompt "PS preview dir"))) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3984 (pr-set-ps-dir-args 'n-up 'dir 'file-regexp 'filename |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3985 (pr-prompt "PS preview dir")) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3986 (setq filename (pr-ps-file filename)) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3987 (pr-ps-file-list n-up dir file-regexp filename) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3988 (or pr-spool-p |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3989 (pr-ps-file-preview filename))) |
49646 | 3990 |
3991 | |
3992 ;;;###autoload | |
3993 (defun pr-ps-directory-using-ghostscript (n-up dir file-regexp &optional filename) | |
3994 "Print directory using PostScript through ghostscript. | |
3995 | |
3996 Interactively, the command prompts for N-UP printing number, a directory, a | |
3997 file name regexp for matching and, when you use a prefix argument (C-u), the | |
3998 command prompts the user for a file name, and saves the PostScript image in | |
3999 that file instead of saving it in a temporary file. | |
4000 | |
4001 Noninteractively, if N-UP is nil, prompts for N-UP printing number. If DIR is | |
4002 nil, prompts for DIRectory. If FILE-REGEXP is nil, prompts for | |
4003 FILE(name)-REGEXP. The argument FILENAME is treated as follows: if it's nil, | |
4004 save the image in a temporary file. If FILENAME is a string, save the | |
4005 PostScript image in a file with that name. If FILENAME is t, prompts for a | |
4006 file name. | |
4007 | |
4008 See also documentation for `pr-list-directory'." | |
4009 (interactive (pr-interactive-ps-dir-args (pr-prompt "PS print dir GS"))) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4010 (pr-set-ps-dir-args 'n-up 'dir 'file-regexp 'filename |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4011 (pr-prompt "PS print dir GS")) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4012 (let ((file (pr-ps-file filename))) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4013 (pr-ps-file-list n-up dir file-regexp file) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4014 (pr-ps-file-using-ghostscript file) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4015 (or filename (pr-delete-file file)))) |
49646 | 4016 |
4017 | |
4018 ;;;###autoload | |
4019 (defun pr-ps-directory-print (n-up dir file-regexp &optional filename) | |
4020 "Print directory using PostScript printer. | |
4021 | |
4022 Interactively, the command prompts for N-UP printing number, a directory, a | |
4023 file name regexp for matching and, when you use a prefix argument (C-u), the | |
4024 command prompts the user for a file name, and saves the PostScript image in | |
4025 that file instead of saving it in a temporary file. | |
4026 | |
4027 Noninteractively, if N-UP is nil, prompts for N-UP printing number. If DIR is | |
4028 nil, prompts for DIRectory. If FILE-REGEXP is nil, prompts for | |
4029 FILE(name)-REGEXP. The argument FILENAME is treated as follows: if it's nil, | |
4030 save the image in a temporary file. If FILENAME is a string, save the | |
4031 PostScript image in a file with that name. If FILENAME is t, prompts for a | |
4032 file name. | |
4033 | |
4034 See also documentation for `pr-list-directory'." | |
4035 (interactive (pr-interactive-ps-dir-args (pr-prompt "PS print dir"))) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4036 (pr-set-ps-dir-args 'n-up 'dir 'file-regexp 'filename |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4037 (pr-prompt "PS print dir")) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4038 (let ((file (pr-ps-file filename))) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4039 (pr-ps-file-list n-up dir file-regexp file) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4040 (pr-ps-file-print file) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4041 (or filename (pr-delete-file file)))) |
49646 | 4042 |
4043 | |
4044 ;;;###autoload | |
4045 (defun pr-ps-directory-ps-print (n-up dir file-regexp &optional filename) | |
4046 "Print directory using PostScript printer or through ghostscript. | |
4047 | |
4048 It depends on `pr-print-using-ghostscript'. | |
4049 | |
4050 Interactively, the command prompts for N-UP printing number, a directory, a | |
4051 file name regexp for matching and, when you use a prefix argument (C-u), the | |
4052 command prompts the user for a file name, and saves the PostScript image in | |
4053 that file instead of saving it in a temporary file. | |
4054 | |
4055 Noninteractively, if N-UP is nil, prompts for N-UP printing number. If DIR is | |
4056 nil, prompts for DIRectory. If FILE-REGEXP is nil, prompts for | |
4057 FILE(name)-REGEXP. The argument FILENAME is treated as follows: if it's nil, | |
4058 save the image in a temporary file. If FILENAME is a string, save the | |
4059 PostScript image in a file with that name. If FILENAME is t, prompts for a | |
4060 file name. | |
4061 | |
4062 See also documentation for `pr-list-directory'." | |
4063 (interactive (pr-interactive-ps-dir-args | |
4064 (pr-prompt (pr-prompt-gs "PS print dir")))) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4065 (pr-set-ps-dir-args 'n-up 'dir 'file-regexp 'filename |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4066 (pr-prompt (pr-prompt-gs "PS print dir"))) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4067 (if (pr-using-ghostscript-p) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4068 (pr-ps-directory-using-ghostscript n-up dir file-regexp filename) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4069 (pr-ps-directory-print n-up dir file-regexp filename))) |
49646 | 4070 |
4071 | |
4072 ;;;###autoload | |
4073 (defun pr-ps-buffer-preview (n-up &optional filename) | |
4074 "Preview buffer using ghostview. | |
4075 | |
4076 Interactively, the command prompts for N-UP printing number and, when you use a | |
4077 prefix argument (C-u), the command prompts the user for a file name, and saves | |
4078 the PostScript image in that file instead of saving it in a temporary file. | |
4079 | |
4080 Noninteractively, if N-UP is nil, prompts for N-UP printing number. The | |
4081 argument FILENAME is treated as follows: if it's nil, save the image in a | |
4082 temporary file. If FILENAME is a string, save the PostScript image in a file | |
4083 with that name. If FILENAME is t, prompts for a file name." | |
4084 (interactive (pr-interactive-n-up-file (pr-prompt "PS preview"))) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4085 (if (pr-auto-mode-p) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4086 (pr-ps-mode-preview n-up filename) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4087 (pr-ps-preview (pr-region-active-symbol) n-up filename |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4088 (pr-region-active-string "PS preview")))) |
49646 | 4089 |
4090 | |
4091 ;;;###autoload | |
4092 (defun pr-ps-buffer-using-ghostscript (n-up &optional filename) | |
4093 "Print buffer using PostScript through ghostscript. | |
4094 | |
4095 Interactively, the command prompts for N-UP printing number and, when you use a | |
4096 prefix argument (C-u), the command prompts the user for a file name, and saves | |
4097 the PostScript image in that file instead of sending it to the printer. | |
4098 | |
4099 Noninteractively, if N-UP is nil, prompts for N-UP printing number. The | |
4100 argument FILENAME is treated as follows: if it's nil, send the image to the | |
4101 printer. If FILENAME is a string, save the PostScript image in a file with | |
4102 that name. If FILENAME is t, prompts for a file name." | |
4103 (interactive (pr-interactive-n-up-file (pr-prompt "PS print GS"))) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4104 (if (pr-auto-mode-p) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4105 (pr-ps-mode-using-ghostscript n-up filename) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4106 (pr-ps-using-ghostscript (pr-region-active-symbol) n-up filename |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4107 (pr-region-active-string "PS print GS")))) |
49646 | 4108 |
4109 | |
4110 ;;;###autoload | |
4111 (defun pr-ps-buffer-print (n-up &optional filename) | |
4112 "Print buffer using PostScript printer. | |
4113 | |
4114 Interactively, the command prompts for N-UP printing number and, when you use a | |
4115 prefix argument (C-u), the command prompts the user for a file name, and saves | |
4116 the PostScript image in that file instead of sending it to the printer. | |
4117 | |
4118 Noninteractively, if N-UP is nil, prompts for N-UP printing number. The | |
4119 argument FILENAME is treated as follows: if it's nil, send the image to the | |
4120 printer. If FILENAME is a string, save the PostScript image in a file with | |
4121 that name. If FILENAME is t, prompts for a file name." | |
4122 (interactive (pr-interactive-n-up-file (pr-prompt "PS print"))) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4123 (if (pr-auto-mode-p) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4124 (pr-ps-mode-print n-up filename) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4125 (pr-ps-print (pr-region-active-symbol) n-up filename |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4126 (pr-region-active-string "PS print")))) |
49646 | 4127 |
4128 | |
4129 ;;;###autoload | |
4130 (defun pr-ps-buffer-ps-print (n-up &optional filename) | |
4131 "Print buffer using PostScript printer or through ghostscript. | |
4132 | |
4133 It depends on `pr-print-using-ghostscript'. | |
4134 | |
4135 Interactively, the command prompts for N-UP printing number and, when you use a | |
4136 prefix argument (C-u), the command prompts the user for a file name, and saves | |
4137 the PostScript image in that file instead of sending it to the printer. | |
4138 | |
4139 Noninteractively, if N-UP is nil, prompts for N-UP printing number. The | |
4140 argument FILENAME is treated as follows: if it's nil, send the image to the | |
4141 printer. If FILENAME is a string, save the PostScript image in a file with | |
4142 that name. If FILENAME is t, prompts for a file name." | |
4143 (interactive (pr-interactive-n-up-file | |
4144 (pr-prompt (pr-prompt-gs "PS print")))) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4145 (cond ((pr-auto-mode-p) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4146 (pr-ps-mode-ps-print n-up filename)) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4147 ((pr-using-ghostscript-p) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4148 (pr-ps-using-ghostscript (pr-region-active-symbol) n-up filename |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4149 (pr-region-active-string "PS print GS"))) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4150 (t |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4151 (pr-ps-print (pr-region-active-symbol) n-up filename |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4152 (pr-region-active-string "PS print"))))) |
49646 | 4153 |
4154 | |
4155 ;;;###autoload | |
4156 (defun pr-ps-region-preview (n-up &optional filename) | |
4157 "Preview region using ghostview. | |
4158 | |
4159 See also `pr-ps-buffer-preview'." | |
4160 (interactive (pr-interactive-n-up-file (pr-prompt-region "PS preview"))) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4161 (if (pr-auto-mode-p) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4162 (let ((pr-auto-region t)) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4163 (pr-ps-mode-preview n-up filename)) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4164 (pr-ps-preview 'region n-up filename "PS preview region"))) |
49646 | 4165 |
4166 | |
4167 ;;;###autoload | |
4168 (defun pr-ps-region-using-ghostscript (n-up &optional filename) | |
4169 "Print region using PostScript through ghostscript. | |
4170 | |
4171 See also `pr-ps-buffer-using-ghostscript'." | |
4172 (interactive (pr-interactive-n-up-file (pr-prompt-region "PS print GS"))) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4173 (if (pr-auto-mode-p) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4174 (let ((pr-auto-region t)) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4175 (pr-ps-mode-using-ghostscript n-up filename)) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4176 (pr-ps-using-ghostscript 'region n-up filename "PS print GS region"))) |
49646 | 4177 |
4178 | |
4179 ;;;###autoload | |
4180 (defun pr-ps-region-print (n-up &optional filename) | |
4181 "Print region using PostScript printer. | |
4182 | |
4183 See also `pr-ps-buffer-print'." | |
4184 (interactive (pr-interactive-n-up-file (pr-prompt-region "PS print"))) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4185 (if (pr-auto-mode-p) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4186 (let ((pr-auto-region t)) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4187 (pr-ps-mode-print n-up filename)) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4188 (pr-ps-print 'region n-up filename "PS print region"))) |
49646 | 4189 |
4190 | |
4191 ;;;###autoload | |
4192 (defun pr-ps-region-ps-print (n-up &optional filename) | |
4193 "Print region using PostScript printer or through ghostscript. | |
4194 | |
4195 See also `pr-ps-buffer-ps-print'." | |
4196 (interactive (pr-interactive-n-up-file | |
4197 (pr-prompt-region (pr-prompt-gs "PS print")))) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4198 (cond ((pr-auto-mode-p) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4199 (let ((pr-auto-region t)) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4200 (pr-ps-mode-ps-print n-up filename))) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4201 ((pr-using-ghostscript-p) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4202 (pr-ps-using-ghostscript 'region n-up filename "PS print GS region")) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4203 (t |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4204 (pr-ps-print 'region n-up filename "PS print region")))) |
49646 | 4205 |
4206 | |
4207 ;;;###autoload | |
4208 (defun pr-ps-mode-preview (n-up &optional filename) | |
4209 "Preview major mode using ghostview. | |
4210 | |
4211 See also `pr-ps-buffer-preview'." | |
4212 (interactive (pr-interactive-n-up-file "PS preview mode")) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4213 (pr-set-n-up-and-filename 'n-up 'filename "PS preview mode") |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4214 (let ((file (pr-ps-file filename))) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4215 (and (pr-ps-mode n-up file) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4216 (not pr-spool-p) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4217 (pr-ps-file-preview file)))) |
49646 | 4218 |
4219 | |
4220 ;;;###autoload | |
4221 (defun pr-ps-mode-using-ghostscript (n-up &optional filename) | |
4222 "Print major mode using PostScript through ghostscript. | |
4223 | |
4224 See also `pr-ps-buffer-using-ghostscript'." | |
4225 (interactive (pr-interactive-n-up-file "PS print GS mode")) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4226 (pr-set-n-up-and-filename 'n-up 'filename "PS print GS mode") |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4227 (let ((file (pr-ps-file filename))) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4228 (when (and (pr-ps-mode n-up file) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4229 (not pr-spool-p)) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4230 (pr-ps-file-using-ghostscript file) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4231 (or filename (pr-delete-file file))))) |
49646 | 4232 |
4233 | |
4234 ;;;###autoload | |
4235 (defun pr-ps-mode-print (n-up &optional filename) | |
4236 "Print major mode using PostScript printer. | |
4237 | |
4238 See also `pr-ps-buffer-print'." | |
4239 (interactive (pr-interactive-n-up-file "PS print mode")) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4240 (pr-set-n-up-and-filename 'n-up 'filename "PS print mode") |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4241 (pr-ps-mode n-up filename)) |
49646 | 4242 |
4243 | |
4244 ;;;###autoload | |
4245 (defun pr-ps-mode-ps-print (n-up &optional filename) | |
4246 "Print major mode using PostScript or through ghostscript. | |
4247 | |
4248 See also `pr-ps-buffer-ps-print'." | |
4249 (interactive (pr-interactive-n-up-file (pr-prompt-gs "PS print mode"))) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4250 (if (pr-using-ghostscript-p) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4251 (pr-ps-mode-using-ghostscript n-up filename) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4252 (pr-ps-mode-print n-up filename))) |
49646 | 4253 |
4254 | |
4255 ;;;###autoload | |
4256 (defun pr-printify-directory (&optional dir file-regexp) | |
4257 "Replace nonprinting characters in directory with printable representations. | |
4258 The printable representations use ^ (for ASCII control characters) or hex. | |
4259 The characters tab, linefeed, space, return and formfeed are not affected. | |
4260 | |
4261 Interactively, the command prompts for a directory and a file name regexp for | |
4262 matching. | |
4263 | |
4264 Noninteractively, if DIR is nil, prompts for DIRectory. If FILE-REGEXP is nil, | |
4265 prompts for FILE(name)-REGEXP. | |
4266 | |
4267 See also documentation for `pr-list-directory'." | |
4268 (interactive (pr-interactive-dir-args "Printify dir")) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4269 (pr-set-dir-args 'dir 'file-regexp "Printify dir") |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4270 (pr-file-list dir file-regexp 'pr-printify-buffer)) |
49646 | 4271 |
4272 | |
4273 ;;;###autoload | |
4274 (defun pr-printify-buffer () | |
4275 "Replace nonprinting characters in buffer with printable representations. | |
4276 The printable representations use ^ (for ASCII control characters) or hex. | |
4277 The characters tab, linefeed, space, return and formfeed are not affected." | |
4278 (interactive "*") | |
4279 (if (pr-region-active-p) | |
4280 (pr-printify-region) | |
4281 (printify-region (point-min) (point-max)))) | |
4282 | |
4283 | |
4284 ;;;###autoload | |
4285 (defun pr-printify-region () | |
4286 "Replace nonprinting characters in region with printable representations. | |
4287 The printable representations use ^ (for ASCII control characters) or hex. | |
4288 The characters tab, linefeed, space, return and formfeed are not affected." | |
4289 (interactive "*") | |
4290 (printify-region (point) (mark))) | |
4291 | |
4292 | |
4293 ;;;###autoload | |
4294 (defun pr-txt-directory (&optional dir file-regexp) | |
4295 "Print directory using text printer. | |
4296 | |
4297 Interactively, the command prompts for a directory and a file name regexp for | |
4298 matching. | |
4299 | |
4300 Noninteractively, if DIR is nil, prompts for DIRectory. If FILE-REGEXP is nil, | |
4301 prompts for FILE(name)-REGEXP. | |
4302 | |
4303 See also documentation for `pr-list-directory'." | |
4304 (interactive (pr-interactive-dir-args "Print dir")) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4305 (pr-set-dir-args 'dir 'file-regexp "Print dir") |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4306 (pr-file-list dir file-regexp 'pr-txt-buffer)) |
49646 | 4307 |
4308 | |
4309 ;;;###autoload | |
4310 (defun pr-txt-buffer () | |
4311 "Print buffer using text printer." | |
4312 (interactive) | |
4313 (cond ((pr-auto-mode-p) | |
4314 (pr-txt-mode)) | |
4315 ((pr-region-active-p) | |
4316 (pr-txt-region)) | |
4317 (t | |
4318 (pr-txt-print (point-min) (point-max))))) | |
4319 | |
4320 | |
4321 ;;;###autoload | |
4322 (defun pr-txt-region () | |
4323 "Print region using text printer." | |
4324 (interactive) | |
4325 (if (pr-auto-mode-p) | |
4326 (let ((pr-auto-region t)) | |
4327 (pr-txt-mode)) | |
4328 (pr-txt-print (point) (mark)))) | |
4329 | |
4330 | |
4331 ;;;###autoload | |
4332 (defun pr-txt-mode () | |
4333 "Print major mode using text printer." | |
4334 (interactive) | |
4335 (let ((args (pr-mode-alist-p))) | |
4336 (if args | |
4337 (funcall (car args) (nthcdr 2 args)) | |
4338 (ding) | |
4339 (message "`%s' major mode not declared." major-mode)))) | |
4340 | |
4341 | |
4342 ;;;###autoload | |
4343 (defun pr-despool-preview (&optional filename) | |
4344 "Preview spooled PostScript. | |
4345 | |
4346 Interactively, when you use a prefix argument (C-u), the command prompts the | |
4347 user for a file name, and saves the spooled PostScript image in that file | |
4348 instead of saving it in a temporary file. | |
4349 | |
4350 Noninteractively, the argument FILENAME is treated as follows: if it is nil, | |
4351 save the image in a temporary file. If FILENAME is a string, save the | |
4352 PostScript image in a file with that name." | |
4353 (interactive (list (ps-print-preprint current-prefix-arg))) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4354 (let ((file (pr-ps-file filename))) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4355 (when (stringp file) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4356 (pr-despool-print file) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4357 (pr-ps-file-preview file)))) |
49646 | 4358 |
4359 | |
4360 ;;;###autoload | |
4361 (defun pr-despool-using-ghostscript (&optional filename) | |
4362 "Print spooled PostScript using ghostscript. | |
4363 | |
4364 Interactively, when you use a prefix argument (C-u), the command prompts the | |
4365 user for a file name, and saves the spooled PostScript image in that file | |
4366 instead of sending it to the printer. | |
4367 | |
4368 Noninteractively, the argument FILENAME is treated as follows: if it is nil, | |
4369 send the image to the printer. If FILENAME is a string, save the PostScript | |
4370 image in a file with that name." | |
4371 (interactive (list (ps-print-preprint current-prefix-arg))) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4372 (let ((file (pr-ps-file filename))) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4373 (when (stringp file) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4374 (pr-despool-print file) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4375 (pr-ps-file-using-ghostscript file) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4376 (or filename (pr-delete-file file))))) |
49646 | 4377 |
4378 | |
4379 ;;;###autoload | |
4380 (defun pr-despool-print (&optional filename) | |
4381 "Send the spooled PostScript to the printer. | |
4382 | |
4383 Interactively, when you use a prefix argument (C-u), the command prompts the | |
4384 user for a file name, and saves the spooled PostScript image in that file | |
4385 instead of sending it to the printer. | |
4386 | |
4387 Noninteractively, the argument FILENAME is treated as follows: if it is nil, | |
4388 send the image to the printer. If FILENAME is a string, save the PostScript | |
4389 image in a file with that name." | |
4390 (interactive (list (ps-print-preprint current-prefix-arg))) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4391 (pr-save-file-modes |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4392 (let ((ps-lpr-command (pr-command pr-ps-command)) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4393 (ps-lpr-switches pr-ps-switches) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4394 (ps-printer-name-option pr-ps-printer-switch) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4395 (ps-printer-name pr-ps-printer)) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4396 (ps-despool filename)))) |
49646 | 4397 |
4398 | |
4399 ;;;###autoload | |
4400 (defun pr-despool-ps-print (&optional filename) | |
4401 "Send the spooled PostScript to the printer or use ghostscript to print it. | |
4402 | |
4403 Interactively, when you use a prefix argument (C-u), the command prompts the | |
4404 user for a file name, and saves the spooled PostScript image in that file | |
4405 instead of sending it to the printer. | |
4406 | |
4407 Noninteractively, the argument FILENAME is treated as follows: if it is nil, | |
4408 send the image to the printer. If FILENAME is a string, save the PostScript | |
4409 image in a file with that name." | |
4410 (interactive (list (ps-print-preprint current-prefix-arg))) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4411 (if pr-print-using-ghostscript |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4412 (pr-despool-using-ghostscript filename) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4413 (pr-despool-print filename))) |
49646 | 4414 |
4415 | |
4416 ;;;###autoload | |
4417 (defun pr-ps-file-preview (filename) | |
4418 "Preview PostScript file FILENAME." | |
4419 (interactive (list (pr-ps-infile-preprint "Preview "))) | |
4420 (and (stringp filename) (file-exists-p filename) | |
56390
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
4421 (pr-call-process pr-gv-command filename))) |
49646 | 4422 |
4423 | |
4424 ;;;###autoload | |
4425 (defun pr-ps-file-up-preview (n-up ifilename &optional ofilename) | |
4426 "Preview PostScript file FILENAME." | |
4427 (interactive (pr-interactive-n-up-inout "PS preview")) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4428 (let ((outfile (pr-ps-utility-args 'n-up 'ifilename 'ofilename |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4429 "PS preview "))) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4430 (pr-ps-utility-process n-up ifilename outfile) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4431 (pr-ps-file-preview outfile))) |
49646 | 4432 |
4433 | |
4434 ;;;###autoload | |
4435 (defun pr-ps-file-using-ghostscript (filename) | |
4436 "Print PostScript file FILENAME using ghostscript." | |
4437 (interactive (list (pr-ps-infile-preprint "Print preview "))) | |
4438 (and (stringp filename) (file-exists-p filename) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4439 (let* ((file (pr-expand-file-name filename)) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4440 (tempfile (pr-dosify-file-name (make-temp-file file)))) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4441 ;; gs use |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4442 (pr-call-process pr-gs-command |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4443 (format "-sDEVICE=%s" pr-gs-device) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4444 (format "-r%d" pr-gs-resolution) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4445 (pr-switches-string pr-gs-switches "pr-gs-switches") |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4446 (format "-sOutputFile=\"%s\"" tempfile) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4447 file |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4448 "-c quit") |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4449 ;; printing |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4450 (pr-ps-file-print tempfile) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4451 ;; deleting |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4452 (pr-delete-file tempfile)))) |
49646 | 4453 |
4454 | |
4455 ;;;###autoload | |
4456 (defun pr-ps-file-print (filename) | |
4457 "Print PostScript file FILENAME." | |
4458 (interactive (list (pr-ps-infile-preprint "Print "))) | |
4459 (and (stringp filename) (file-exists-p filename) | |
4460 ;; printing | |
4461 (let ((file (pr-expand-file-name filename))) | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
4462 (if (string= pr-ps-command "") |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
4463 ;; default action |
49646 | 4464 (let ((ps-spool-buffer (get-buffer-create ps-spool-buffer-name))) |
4465 (save-excursion | |
4466 (set-buffer ps-spool-buffer) | |
4467 (erase-buffer) | |
4468 (insert-file-contents-literally file)) | |
4469 (pr-despool-print)) | |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
4470 ;; use `pr-ps-command' to print |
56390
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
4471 (apply 'pr-call-process |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
4472 pr-ps-command |
58241
4aa6d60fc66c
Fix typos & pr-switches-string
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58218
diff
changeset
|
4473 (pr-switches-string pr-ps-switches "pr-ps-switches") |
56390
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
4474 (if (string-match "cp" pr-ps-command) |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
4475 ;; for "cp" (cmd in out) |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
4476 (list file |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
4477 (concat pr-ps-printer-switch pr-ps-printer)) |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
4478 ;; else, for others (cmd out in) |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
4479 (list (concat pr-ps-printer-switch pr-ps-printer) |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
4480 file))))))) |
49646 | 4481 |
4482 | |
4483 ;;;###autoload | |
4484 (defun pr-ps-file-ps-print (filename) | |
4485 "Send PostScript file FILENAME to printer or use ghostscript to print it." | |
4486 (interactive (list (pr-ps-infile-preprint | |
4487 (if pr-print-using-ghostscript | |
4488 "Print preview " | |
4489 "Print ")))) | |
4490 (if pr-print-using-ghostscript | |
4491 (pr-ps-file-using-ghostscript filename) | |
4492 (pr-ps-file-print filename))) | |
4493 | |
4494 | |
4495 ;;;###autoload | |
4496 (defun pr-ps-file-up-ps-print (n-up ifilename &optional ofilename) | |
4497 "Process a PostScript file IFILENAME and send it to printer. | |
4498 | |
4499 Interactively, the command prompts for N-UP printing number, for an input | |
4500 PostScript file IFILENAME and, when you use a prefix argument (C-u), the | |
4501 command prompts the user for an output PostScript file name OFILENAME, and | |
4502 saves the PostScript image in that file instead of sending it to the printer. | |
4503 | |
4504 Noninteractively, if N-UP is nil, prompts for N-UP printing number. The | |
4505 argument IFILENAME is treated as follows: if it's t, prompts for an input | |
4506 PostScript file name; otherwise, it *must* be a string that it's an input | |
4507 PostScript file name. The argument OFILENAME is treated as follows: if it's | |
4508 nil, send the image to the printer. If OFILENAME is a string, save the | |
4509 PostScript image in a file with that name. If OFILENAME is t, prompts for a | |
4510 file name." | |
4511 (interactive (pr-interactive-n-up-inout | |
4512 (if pr-print-using-ghostscript | |
4513 "PS print GS" | |
4514 "PS print"))) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4515 (let ((outfile (pr-ps-utility-args 'n-up 'ifilename 'ofilename |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4516 (if pr-print-using-ghostscript |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4517 "PS print GS " |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4518 "PS print ")))) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4519 (pr-ps-utility-process n-up ifilename outfile) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4520 (unless ofilename |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4521 (pr-ps-file-ps-print outfile) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4522 (pr-delete-file outfile)))) |
49646 | 4523 |
4524 | |
4525 ;;;###autoload | |
4526 (defun pr-toggle-file-duplex () | |
4527 "Toggle duplex for PostScript file." | |
4528 (interactive) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4529 (pr-toggle-file-duplex-menu t)) |
49646 | 4530 |
4531 | |
4532 ;;;###autoload | |
4533 (defun pr-toggle-file-tumble () | |
4534 "Toggle tumble for PostScript file. | |
4535 | |
4536 If tumble is off, produces a printing suitable for binding on the left or | |
4537 right. | |
4538 If tumble is on, produces a printing suitable for binding at the top or | |
4539 bottom." | |
4540 (interactive) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4541 (pr-toggle-file-tumble-menu t)) |
49646 | 4542 |
4543 | |
4544 ;;;###autoload | |
4545 (defun pr-toggle-file-landscape () | |
4546 "Toggle landscape for PostScript file." | |
4547 (interactive) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4548 (pr-toggle-file-landscape-menu t)) |
49646 | 4549 |
4550 | |
4551 ;;;###autoload | |
4552 (defun pr-toggle-ghostscript () | |
4553 "Toggle printing using ghostscript." | |
4554 (interactive) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4555 (pr-toggle-ghostscript-menu t)) |
49646 | 4556 |
4557 | |
4558 ;;;###autoload | |
4559 (defun pr-toggle-faces () | |
4560 "Toggle printing with faces." | |
4561 (interactive) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4562 (pr-toggle-faces-menu t)) |
49646 | 4563 |
4564 | |
4565 ;;;###autoload | |
4566 (defun pr-toggle-spool () | |
4567 "Toggle spooling." | |
4568 (interactive) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4569 (pr-toggle-spool-menu t)) |
49646 | 4570 |
4571 | |
4572 ;;;###autoload | |
4573 (defun pr-toggle-duplex () | |
4574 "Toggle duplex." | |
4575 (interactive) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4576 (pr-toggle-duplex-menu t)) |
49646 | 4577 |
4578 | |
4579 ;;;###autoload | |
4580 (defun pr-toggle-tumble () | |
4581 "Toggle tumble. | |
4582 | |
4583 If tumble is off, produces a printing suitable for binding on the left or | |
4584 right. | |
4585 If tumble is on, produces a printing suitable for binding at the top or | |
4586 bottom." | |
4587 (interactive) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4588 (pr-toggle-tumble-menu t)) |
49646 | 4589 |
4590 | |
4591 ;;;###autoload | |
4592 (defun pr-toggle-landscape () | |
4593 "Toggle landscape." | |
4594 (interactive) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4595 (pr-toggle-landscape-menu t)) |
49646 | 4596 |
4597 | |
4598 ;;;###autoload | |
4599 (defun pr-toggle-upside-down () | |
4600 "Toggle upside-down." | |
4601 (interactive) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4602 (pr-toggle-upside-down-menu t)) |
49646 | 4603 |
4604 | |
4605 ;;;###autoload | |
4606 (defun pr-toggle-line () | |
4607 "Toggle line number." | |
4608 (interactive) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4609 (pr-toggle-line-menu t)) |
49646 | 4610 |
4611 | |
4612 ;;;###autoload | |
4613 (defun pr-toggle-zebra () | |
4614 "Toggle zebra stripes." | |
4615 (interactive) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4616 (pr-toggle-zebra-menu t)) |
49646 | 4617 |
4618 | |
4619 ;;;###autoload | |
4620 (defun pr-toggle-header () | |
4621 "Toggle printing header." | |
4622 (interactive) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4623 (pr-toggle-header-menu t)) |
49646 | 4624 |
4625 | |
4626 ;;;###autoload | |
4627 (defun pr-toggle-header-frame () | |
4628 "Toggle printing header frame." | |
4629 (interactive) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4630 (pr-toggle-header-frame-menu t)) |
49646 | 4631 |
4632 | |
4633 ;;;###autoload | |
4634 (defun pr-toggle-lock () | |
4635 "Toggle menu lock." | |
4636 (interactive) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4637 (pr-toggle-lock-menu t)) |
49646 | 4638 |
4639 | |
4640 ;;;###autoload | |
4641 (defun pr-toggle-region () | |
4642 "Toggle auto region." | |
4643 (interactive) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4644 (pr-toggle-region-menu t)) |
49646 | 4645 |
4646 | |
4647 ;;;###autoload | |
4648 (defun pr-toggle-mode () | |
4649 "Toggle auto mode." | |
4650 (interactive) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4651 (pr-toggle-mode-menu t)) |
49646 | 4652 |
4653 | |
4654 ;;;###autoload | |
4655 (defun pr-customize (&rest ignore) | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
4656 "Customization of the `printing' group." |
49646 | 4657 (interactive) |
4658 (customize-group 'printing)) | |
4659 | |
4660 | |
4661 ;;;###autoload | |
4662 (defun lpr-customize (&rest ignore) | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
4663 "Customization of the `lpr' group." |
49646 | 4664 (interactive) |
4665 (customize-group 'lpr)) | |
4666 | |
4667 | |
4668 ;;;###autoload | |
4669 (defun pr-help (&rest ignore) | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
4670 "Help for the printing package." |
49646 | 4671 (interactive) |
4672 (pr-show-setup pr-help-message "*Printing Help*")) | |
4673 | |
4674 | |
4675 ;;;###autoload | |
4676 (defun pr-ps-name () | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
4677 "Interactively select a PostScript printer." |
49646 | 4678 (interactive) |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4679 (pr-menu-set-ps-title |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4680 (pr-complete-alist "PostScript printer" |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4681 pr-ps-printer-alist pr-ps-name))) |
49646 | 4682 |
4683 | |
4684 ;;;###autoload | |
4685 (defun pr-txt-name () | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
4686 "Interactively select a text printer." |
49646 | 4687 (interactive) |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4688 (pr-menu-set-txt-title |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4689 (pr-complete-alist "Text printer" |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4690 pr-txt-printer-alist pr-txt-name))) |
49646 | 4691 |
4692 | |
4693 ;;;###autoload | |
4694 (defun pr-ps-utility () | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
4695 "Interactively select a PostScript utility." |
49646 | 4696 (interactive) |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4697 (pr-menu-set-utility-title |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4698 (pr-complete-alist "Postscript utility" |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4699 pr-ps-utility-alist pr-ps-utility))) |
49646 | 4700 |
4701 | |
4702 ;;;###autoload | |
4703 (defun pr-show-ps-setup (&rest ignore) | |
4704 "Show current ps-print settings." | |
4705 (interactive) | |
4706 (pr-show-setup (ps-setup) "*PS Setup*")) | |
4707 | |
4708 | |
4709 ;;;###autoload | |
4710 (defun pr-show-pr-setup (&rest ignore) | |
4711 "Show current printing settings." | |
4712 (interactive) | |
4713 (pr-show-setup (pr-setup) "*PR Setup*")) | |
4714 | |
4715 | |
4716 ;;;###autoload | |
4717 (defun pr-show-lpr-setup (&rest ignore) | |
4718 "Show current lpr settings." | |
4719 (interactive) | |
4720 (pr-show-setup (lpr-setup) "*LPR Setup*")) | |
4721 | |
4722 | |
4723 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
4724 ;; Fast Commands | |
4725 | |
4726 | |
4727 ;;;###autoload | |
4728 (defun pr-ps-fast-fire (n-up &optional select) | |
4729 "Fast fire function for PostScript printing. | |
4730 | |
4731 If a region is active, the region will be printed instead of the whole buffer. | |
4732 Also if the current major-mode is defined in `pr-mode-alist', the settings in | |
4733 `pr-mode-alist' will be used, that is, the current buffer or region will be | |
4734 printed using `pr-ps-mode-ps-print'. | |
4735 | |
4736 | |
4737 Interactively, you have the following situations: | |
4738 | |
4739 M-x pr-ps-fast-fire RET | |
4740 The command prompts the user for a N-UP value and printing will | |
4741 immediatelly be done using the current active printer. | |
4742 | |
4743 C-u M-x pr-ps-fast-fire RET | |
4744 C-u 0 M-x pr-ps-fast-fire RET | |
4745 The command prompts the user for a N-UP value and also for a current | |
4746 PostScript printer, then printing will immediatelly be done using the new | |
4747 current active printer. | |
4748 | |
4749 C-u 1 M-x pr-ps-fast-fire RET | |
4750 The command prompts the user for a N-UP value and also for a file name, | |
4751 and saves the PostScript image in that file instead of sending it to the | |
4752 printer. | |
4753 | |
4754 C-u 2 M-x pr-ps-fast-fire RET | |
4755 The command prompts the user for a N-UP value, then for a current | |
4756 PostScript printer and, finally, for a file name. Then change the active | |
77718
1142d0b0c510
(pr-ps-fast-fire): Fix typos in docstring.
Juanma Barranquero <lekktu@gmail.com>
parents:
75712
diff
changeset
|
4757 printer to that chosen by user and saves the PostScript image in |
49646 | 4758 that file instead of sending it to the printer. |
4759 | |
4760 | |
4761 Noninteractively, the argument N-UP should be a positive integer greater than | |
4762 zero and the argument SELECT is treated as follows: | |
4763 | |
4764 If it's nil, send the image to the printer. | |
4765 | |
4766 If it's a list or an integer lesser or equal to zero, the command prompts | |
4767 the user for a current PostScript printer, then printing will immediatelly | |
4768 be done using the new current active printer. | |
4769 | |
4770 If it's an integer equal to 1, the command prompts the user for a file name | |
4771 and saves the PostScript image in that file instead of sending it to the | |
4772 printer. | |
4773 | |
4774 If it's an integer greater or equal to 2, the command prompts the user for a | |
4775 current PostScript printer and for a file name. Then change the active | |
77718
1142d0b0c510
(pr-ps-fast-fire): Fix typos in docstring.
Juanma Barranquero <lekktu@gmail.com>
parents:
75712
diff
changeset
|
4776 printer to that chosen by user and saves the PostScript image in that file |
49646 | 4777 instead of sending it to the printer. |
4778 | |
4779 If it's a symbol which it's defined in `pr-ps-printer-alist', it's the new | |
4780 active printer and printing will immediatelly be done using the new active | |
4781 printer. | |
4782 | |
4783 Otherwise, send the image to the printer. | |
4784 | |
4785 | |
4786 Note that this command always behaves as if `pr-auto-region' and `pr-auto-mode' | |
4787 are both set to t." | |
4788 (interactive (list (pr-interactive-n-up (pr-prompt-gs "PS print fast")) | |
4789 current-prefix-arg)) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4790 (let ((pr-auto-region t) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4791 (pr-auto-mode t) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4792 filename) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4793 (cond ((null select)) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4794 ((listp select) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4795 (pr-ps-name)) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4796 ((and (symbolp select) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4797 (assq select pr-ps-printer-alist)) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4798 (pr-menu-set-ps-title select)) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4799 ((integerp select) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4800 (and (/= select 1) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4801 (pr-ps-name)) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4802 (and (>= select 1) (not pr-spool-p) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4803 (setq filename (pr-ps-outfile-preprint |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4804 (if pr-print-using-ghostscript |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4805 "Fast GS " |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4806 "Fast ")))))) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4807 (pr-ps-buffer-ps-print |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4808 (if (integerp n-up) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4809 (min (max n-up 1) 100) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4810 (error "n-up must be an integer greater than zero")) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4811 filename))) |
49646 | 4812 |
4813 | |
4814 ;;;###autoload | |
4815 (defun pr-txt-fast-fire (&optional select-printer) | |
4816 "Fast fire function for text printing. | |
4817 | |
4818 If a region is active, the region will be printed instead of the whole buffer. | |
4819 Also if the current major-mode is defined in `pr-mode-alist', the settings in | |
4820 `pr-mode-alist' will be used, that is, the current buffer or region will be | |
4821 printed using `pr-txt-mode'. | |
4822 | |
4823 Interactively, when you use a prefix argument (C-u), the command prompts the | |
4824 user for a new active text printer. | |
4825 | |
4826 Noninteractively, the argument SELECT-PRINTER is treated as follows: | |
4827 | |
4828 If it's nil, the printing is sent to the current active text printer. | |
4829 | |
4830 If it's a symbol which it's defined in `pr-txt-printer-alist', it's the new | |
4831 active printer and printing will immediatelly be done using the new active | |
4832 printer. | |
4833 | |
4834 If it's non-nil, the command prompts the user for a new active text printer. | |
4835 | |
4836 Note that this command always behaves as if `pr-auto-region' and `pr-auto-mode' | |
4837 are both set to t." | |
4838 (interactive (list current-prefix-arg)) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4839 (cond ((null select-printer)) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4840 ((and (symbolp select-printer) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4841 (assq select-printer pr-txt-printer-alist)) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4842 (pr-menu-set-txt-title select-printer)) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4843 (t |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4844 (pr-txt-name))) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4845 (let ((pr-auto-region t) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4846 (pr-auto-mode t)) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4847 (pr-txt-buffer))) |
49646 | 4848 |
4849 | |
4850 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
4851 ;; Utilities | |
4852 | |
4853 | |
4854 (defun pr-setup () | |
4855 "Return the current `printing' setup. | |
4856 | |
4857 This is *not* an interactive command. | |
4858 One way to see `printing' setup is to switch to a *Scratch* buffer and type: | |
4859 | |
4860 M-: (insert (pr-setup)) RET | |
4861 | |
4862 Or choose the menu option Printing/Show Settings/printing." | |
4863 (let (ps-prefix-quote) | |
4864 (mapconcat | |
4865 #'ps-print-quote | |
4866 (list | |
4867 (concat "\n;;; printing.el version " pr-version "\n") | |
56390
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
4868 ";; internal vars" |
58408
6b5846d74ff0
pr-setup & lpr-setup
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58306
diff
changeset
|
4869 (ps-comment-string "emacs-version " emacs-version) |
56390
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
4870 (ps-comment-string "pr-txt-command " pr-txt-command) |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
4871 (ps-comment-string "pr-txt-switches " |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
4872 (pr-switches-string pr-txt-switches "pr-txt-switches")) |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
4873 (ps-comment-string "pr-txt-printer " pr-txt-printer) |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
4874 (ps-comment-string "pr-ps-command " pr-ps-command) |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
4875 (ps-comment-string "pr-ps-switches " |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
4876 (pr-switches-string pr-ps-switches "pr-ps-switches")) |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
4877 (ps-comment-string "pr-ps-printer-switch" pr-ps-printer-switch) |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
4878 (ps-comment-string "pr-ps-printer " pr-ps-printer) |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
4879 (ps-comment-string "pr-cygwin-system " pr-cygwin-system) |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
4880 (ps-comment-string "ps-windows-system " ps-windows-system) |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
4881 (ps-comment-string "ps-lp-system " ps-lp-system) |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
4882 nil |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
4883 '(14 . pr-path-style) |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
4884 '(14 . pr-path-alist) |
49646 | 4885 nil |
4886 '(21 . pr-txt-name) | |
4887 '(21 . pr-txt-printer-alist) | |
4888 nil | |
4889 '(20 . pr-ps-name) | |
4890 '(20 . pr-ps-printer-alist) | |
4891 nil | |
4892 '(20 . pr-temp-dir) | |
4893 '(20 . pr-ps-temp-file) | |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
4894 '(20 . pr-file-modes) |
49646 | 4895 '(20 . pr-delete-temp-file) |
4896 '(20 . pr-list-directory) | |
4897 nil | |
4898 '(17 . pr-gv-command) | |
4899 '(17 . pr-gs-command) | |
4900 '(17 . pr-gs-switches) | |
4901 '(17 . pr-gs-device) | |
4902 '(17 . pr-gs-resolution) | |
4903 nil | |
4904 '(27 . pr-print-using-ghostscript) | |
4905 '(27 . pr-faces-p) | |
4906 '(27 . pr-spool-p) | |
4907 '(27 . pr-file-landscape) | |
4908 '(27 . pr-file-duplex) | |
4909 '(27 . pr-file-tumble) | |
4910 '(27 . pr-auto-region) | |
4911 '(27 . pr-auto-mode) | |
4912 nil | |
4913 '(20 . pr-ps-utility) | |
4914 '(20 . pr-ps-utility-alist) | |
4915 nil | |
4916 '(14 . pr-mode-alist) | |
4917 nil | |
4918 '(20 . pr-menu-lock) | |
4919 '(20 . pr-menu-char-height) | |
4920 '(20 . pr-menu-char-width) | |
4921 nil | |
4922 '(20 . pr-setting-database) | |
4923 nil | |
4924 '(22 . pr-visible-entry-list) | |
4925 nil | |
4926 '(22 . pr-buffer-verbose) | |
4927 '(22 . pr-buffer-name) | |
4928 '(22 . pr-buffer-name-ignore) | |
4929 ")\n\n;;; printing.el - end of settings\n") | |
4930 "\n"))) | |
4931 | |
4932 | |
4933 (defun lpr-setup () | |
4934 "Return the current `lpr' setup. | |
4935 | |
4936 This is *not* an interactive command. | |
4937 One way to see `lpr' setup is to switch to a *Scratch* buffer and type: | |
4938 | |
4939 M-: (insert (lpr-setup)) RET | |
4940 | |
4941 Or choose the menu option Printing/Show Settings/lpr." | |
4942 (let (ps-prefix-quote) | |
4943 (mapconcat | |
4944 #'ps-print-quote | |
58408
6b5846d74ff0
pr-setup & lpr-setup
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58306
diff
changeset
|
4945 (list |
6b5846d74ff0
pr-setup & lpr-setup
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58306
diff
changeset
|
4946 "\n;;; lpr.el settings\n" |
6b5846d74ff0
pr-setup & lpr-setup
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58306
diff
changeset
|
4947 (ps-comment-string "emacs-version" emacs-version) |
6b5846d74ff0
pr-setup & lpr-setup
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58306
diff
changeset
|
4948 nil |
6b5846d74ff0
pr-setup & lpr-setup
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58306
diff
changeset
|
4949 '(25 . printer-name) |
6b5846d74ff0
pr-setup & lpr-setup
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58306
diff
changeset
|
4950 '(25 . lpr-switches) |
6b5846d74ff0
pr-setup & lpr-setup
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58306
diff
changeset
|
4951 '(25 . lpr-add-switches) |
6b5846d74ff0
pr-setup & lpr-setup
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58306
diff
changeset
|
4952 '(25 . lpr-command) |
6b5846d74ff0
pr-setup & lpr-setup
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58306
diff
changeset
|
4953 '(25 . lpr-headers-switches) |
6b5846d74ff0
pr-setup & lpr-setup
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58306
diff
changeset
|
4954 '(25 . print-region-function) |
6b5846d74ff0
pr-setup & lpr-setup
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58306
diff
changeset
|
4955 '(25 . lpr-page-header-program) |
6b5846d74ff0
pr-setup & lpr-setup
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58306
diff
changeset
|
4956 '(25 . lpr-page-header-switches) |
6b5846d74ff0
pr-setup & lpr-setup
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58306
diff
changeset
|
4957 ")\n\n;;; lpr.el - end of settings\n") |
49646 | 4958 "\n"))) |
4959 | |
4960 | |
4961 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
4962 ;; mh-e (adapted from mh-e-init.el -- Tom Vogels <tov@ece.cmu.edu>) | |
4963 | |
4964 | |
4965 (defalias 'pr-mh-get-msg-num 'mh-get-msg-num) | |
4966 (defalias 'pr-mh-show 'mh-show) | |
4967 (defalias 'pr-mh-start-of-uncleaned-message 'mh-start-of-uncleaned-message) | |
4968 (defvar mh-show-buffer nil) | |
4969 | |
4970 | |
4971 (defun pr-article-date () | |
4972 "Find the date of an article or mail message in current buffer. | |
4973 Return only the dayname, if present, weekday, month, and year." | |
4974 (save-excursion | |
4975 (goto-char (point-min)) | |
4976 (if (re-search-forward | |
4977 "^Date:[ \t]+\\(\\([A-Za-z]+, \\)?[0-9]+ [A-Za-z]+ [0-9]+\\)" nil t) | |
4978 (buffer-substring (match-beginning 1) (match-end 1)) | |
4979 (format-time-string "%Y/%m/%d")))) | |
4980 | |
4981 | |
4982 (defun pr-mh-current-message () | |
4983 "Go to mh-inbox current message." | |
4984 (let ((msg (or (pr-mh-get-msg-num nil) 0))) | |
4985 (pr-mh-show) | |
4986 (set-buffer mh-show-buffer) | |
4987 (goto-char (point-min)) | |
4988 (pr-mh-start-of-uncleaned-message) | |
4989 (message "Printing message %d" msg))) | |
4990 | |
4991 | |
4992 (defun pr-mh-print-1 (n-up filename header-list) | |
4993 "Print mh-inbox current message in PostScript." | |
4994 (save-excursion | |
4995 (save-window-excursion | |
4996 (pr-mh-current-message) | |
4997 (pr-mode-print n-up filename header-list (point))))) | |
4998 | |
4999 | |
5000 (defun pr-mh-lpr-1 (header-list) | |
5001 "Print mh-inbox current message in text printer." | |
5002 (save-excursion | |
5003 (save-window-excursion | |
5004 (pr-mh-current-message) | |
5005 (pr-mode-lpr header-list (point))))) | |
5006 | |
5007 | |
5008 (defalias 'pr-mh-print-2 'pr-mode-print) | |
5009 | |
5010 | |
5011 (defalias 'pr-mh-lpr-2 'pr-mode-lpr) | |
5012 | |
5013 | |
5014 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
5015 ;; rmail (hacked from ps-print.el) | |
5016 | |
5017 | |
5018 (defun pr-rmail-lpr (header-list) | |
5019 "Print RMAIL current message in text printer." | |
5020 (pr-lpr-message-from-summary header-list | |
5021 'rmail-buffer 'rmail-summary-buffer)) | |
5022 | |
5023 | |
5024 (defun pr-rmail-print (n-up filename header-list) | |
5025 "Print RMAIL current message in PostScript." | |
5026 (pr-ps-message-from-summary n-up filename header-list | |
5027 'rmail-buffer 'rmail-summary-buffer)) | |
5028 | |
5029 | |
5030 (defun pr-ps-message-from-summary (n-up filename header-list | |
5031 summary-buffer summary-default) | |
5032 "Print current message in PostScript." | |
5033 (let ((buf (or (and (boundp summary-buffer) | |
5034 (symbol-value summary-buffer)) | |
5035 (symbol-value summary-default)))) | |
5036 (and (get-buffer buf) | |
5037 (save-excursion | |
5038 (set-buffer buf) | |
5039 (pr-mode-print n-up filename header-list))))) | |
5040 | |
5041 | |
5042 (defun pr-lpr-message-from-summary (header-list summary-buffer summary-default) | |
5043 "Print current message in text printer." | |
5044 (let ((buf (or (and (boundp summary-buffer) | |
5045 (symbol-value summary-buffer)) | |
5046 (symbol-value summary-default)))) | |
5047 (and (get-buffer buf) | |
5048 (save-excursion | |
5049 (set-buffer buf) | |
5050 (pr-mode-lpr header-list))))) | |
5051 | |
5052 | |
5053 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
5054 ;; gnus (hacked from ps-print.el) | |
5055 | |
5056 | |
5057 (defvar pr-gnus-article "*Article*") | |
5058 | |
5059 | |
5060 (defun pr-gnus-print (n-up filename header-list) | |
5061 "Print *Article* current message in PostScript." | |
5062 (pr-ps-message-from-summary n-up filename header-list | |
5063 'gnus-article-buffer 'pr-gnus-article)) | |
5064 | |
5065 | |
5066 (defun pr-gnus-lpr (header-list) | |
5067 "Print *Article* current message in text printer." | |
5068 (pr-lpr-message-from-summary header-list | |
5069 'gnus-article-buffer 'pr-gnus-article)) | |
5070 | |
5071 | |
5072 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
5073 ;; vm (hacked from ps-print.el) | |
5074 | |
5075 | |
5076 (defvar pr-vm-summary "") | |
5077 | |
5078 | |
5079 (defun pr-vm-print (n-up filename header-list) | |
5080 "Print current vm message in PostScript." | |
5081 (pr-ps-message-from-summary n-up filename header-list | |
5082 'vm-mail-buffer 'pr-vm-summary)) | |
5083 | |
5084 | |
5085 (defun pr-vm-lpr (header-list) | |
5086 "Print current vm message in text printer." | |
5087 (pr-lpr-message-from-summary header-list | |
5088 'vm-mail-buffer 'pr-vm-summary)) | |
5089 | |
5090 | |
5091 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
5092 ;; Mode Functions | |
5093 | |
5094 | |
5095 (defun pr-ps-mode (n-up filename) | |
5096 "If current major mode is declared, print it in PostScript." | |
5097 (let ((args (pr-mode-alist-p))) | |
5098 (if args | |
5099 (let ((fun (cdr args))) | |
5100 (funcall (car fun) n-up filename (cdr fun)) | |
5101 t) | |
5102 (ding) | |
5103 (message "`%s' major mode not declared." major-mode) | |
5104 nil))) | |
5105 | |
5106 | |
5107 (defmacro pr-local-variable (header-list &rest body) | |
5108 `(save-excursion | |
5109 (let ((ps-header-lines (or (nth 0 ,header-list) ps-header-lines)) | |
5110 (ps-left-header (or (nth 1 ,header-list) ps-left-header)) | |
5111 (ps-right-header (or (nth 2 ,header-list) ps-right-header)) | |
5112 ps-razzle-dazzle) | |
5113 (let ((local-var-list (pr-eval-local-alist (nthcdr 4 ,header-list)))) | |
5114 ,@body | |
5115 (and (nth 3 ,header-list) | |
5116 (pr-kill-local-variable local-var-list)))))) | |
5117 | |
5118 | |
5119 (defun pr-mode-print (n-up filename header-list &optional from to) | |
5120 "Print current major mode in PostScript." | |
5121 (pr-local-variable | |
5122 header-list | |
5123 (let ((file (pr-ps-file filename)) | |
5124 (start (cond (from) | |
5125 ((pr-region-active-p) (region-beginning)) | |
5126 (t nil) | |
5127 ))) | |
5128 (pr-text2ps (pr-region-active-symbol start) n-up file start | |
5129 (cond (to) | |
5130 ((pr-region-active-p) (region-end)) | |
5131 (from (point-max)) | |
5132 )) | |
5133 (unless (or pr-spool-p filename) | |
5134 (pr-ps-file-print file) | |
5135 (pr-delete-file file))))) | |
5136 | |
5137 | |
5138 (defun pr-mode-lpr (header-list &optional from to) | |
5139 "Print current major mode in text printer." | |
5140 (pr-local-variable | |
5141 header-list | |
5142 (pr-txt-print (cond (from) | |
5143 ((pr-region-active-p) (region-beginning)) | |
5144 (t (point-min))) | |
5145 (cond (to) | |
5146 ((pr-region-active-p) (region-end)) | |
5147 (t (point-max)))))) | |
5148 | |
5149 | |
5150 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
5151 ;; Menu Lock | |
5152 | |
5153 | |
5154 (defconst pr-menu-entry-alist | |
5155 '((postscript . 3) | |
5156 (text . 3) | |
5157 (postscript-options . 9) | |
5158 (postscript-process . 3) | |
5159 (printing . 3) | |
5160 (help . 3) | |
5161 ) | |
5162 "Alist that associates menu part with number of items per part. | |
5163 | |
5164 It's used by `pr-menu-index'. | |
5165 | |
5166 Each element has the form: | |
5167 | |
5168 (MENU-PART . NUMBER-OF-ITEMS) | |
5169 | |
5170 See `pr-visible-entry-alist'.") | |
5171 | |
5172 | |
5173 (defun pr-menu-index (entry index) | |
5174 (let ((base-list | |
5175 (cond ((eq entry 'text) | |
5176 '(postscript)) | |
5177 ((eq entry 'postscript-options) | |
5178 '(postscript text)) | |
5179 ((eq entry 'postscript-process) | |
5180 '(postscript text postscript-options)) | |
5181 ((eq entry 'printing) | |
5182 '(postscript text postscript-options postscript-process)) | |
5183 (t | |
5184 nil) | |
5185 )) | |
5186 key) | |
5187 (while base-list | |
5188 (setq key (car base-list) | |
5189 base-list (cdr base-list)) | |
5190 (and (pr-visible-p key) | |
5191 (setq index (+ index | |
5192 (cdr (assq key pr-menu-entry-alist))))))) | |
5193 (+ index 2)) | |
5194 | |
5195 | |
5196 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
5197 ;; Printer & Utility Selection | |
5198 | |
5199 | |
5200 (defun pr-update-var (var-sym alist) | |
5201 (or (assq (symbol-value var-sym) alist) | |
5202 (set var-sym (car (car alist))))) | |
5203 | |
5204 | |
5205 (defun pr-update-menus (&optional force) | |
5206 "Update utility, PostScript and text printer menus. | |
5207 | |
5208 If FORCE is non-nil, update menus doesn't matter if `pr-ps-printer-alist', | |
5209 `pr-txt-printer-alist' or `pr-ps-utility-alist' were modified or not; | |
82295
638fa1c98d72
Docstring fix
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
82278
diff
changeset
|
5210 otherwise, update PostScript printer menu if `pr-ps-printer-menu-modified' is |
638fa1c98d72
Docstring fix
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
82278
diff
changeset
|
5211 non-nil, update text printer menu if `pr-txt-printer-menu-modified' is |
638fa1c98d72
Docstring fix
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
82278
diff
changeset
|
5212 non-nil, and update PostScript File menus if `pr-ps-utility-menu-modified' is |
63328
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
5213 non-nil. |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
5214 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
5215 If menu binding was not done, calls `pr-menu-bind'." |
54621
14d929e67a70
Modify interactive declaration.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54333
diff
changeset
|
5216 (interactive "P") |
63328
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
5217 (if pr-menu-print-item ; since v6.8.4 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
5218 ;; There was no menu binding yet, so do it now! |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
5219 ;; This is a hack to be compatible with old versions of printing. |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
5220 ;; So, user does not need to change printing calling in init files. |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
5221 (pr-menu-bind) |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
5222 ;; Here menu binding is ok. |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
5223 (pr-update-var 'pr-ps-name pr-ps-printer-alist) |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
5224 (pr-update-var 'pr-txt-name pr-txt-printer-alist) |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
5225 (pr-update-var 'pr-ps-utility pr-ps-utility-alist) |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
5226 (pr-do-update-menus force))) |
49646 | 5227 |
5228 | |
5229 (defun pr-menu-create (name alist var-sym fun entry index) | |
5230 (cons name | |
5231 (mapcar | |
5232 #'(lambda (elt) | |
5233 (let ((sym (car elt))) | |
5234 (vector | |
5235 (symbol-name sym) | |
5236 (list fun (list 'quote sym) nil (list 'quote entry) index) | |
5237 :style 'radio | |
5238 :selected (list 'eq var-sym (list 'quote sym))))) | |
5239 alist))) | |
5240 | |
5241 | |
5242 (defun pr-ps-set-utility (value) | |
5243 (let ((item (cdr (assq value pr-ps-utility-alist)))) | |
5244 (or item | |
5245 (error | |
56578
a36e2d80b510
(toplevel, pr-ps-fast-fire, pr-ps-set-utility)
John Paul Wallington <jpw@pobox.com>
parents:
56493
diff
changeset
|
5246 "Invalid PostScript utility name `%s' for variable `pr-ps-utility'" |
49646 | 5247 value)) |
5248 (setq pr-ps-utility value) | |
5249 (pr-eval-alist (nthcdr 9 item))) | |
5250 (pr-update-mode-line)) | |
5251 | |
5252 | |
5253 (defun pr-ps-set-printer (value) | |
5254 (let ((ps (cdr (assq value pr-ps-printer-alist)))) | |
5255 (or ps | |
5256 (error | |
56578
a36e2d80b510
(toplevel, pr-ps-fast-fire, pr-ps-set-utility)
John Paul Wallington <jpw@pobox.com>
parents:
56493
diff
changeset
|
5257 "Invalid PostScript printer name `%s' for variable `pr-ps-name'" |
49646 | 5258 value)) |
5259 (setq pr-ps-name value | |
56405
10b68aa88abe
Doc fix. Change name of some funs.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
56390
diff
changeset
|
5260 pr-ps-command (pr-dosify-file-name (nth 0 ps)) |
49646 | 5261 pr-ps-switches (nth 1 ps) |
5262 pr-ps-printer-switch (nth 2 ps) | |
56390
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
5263 pr-ps-printer (nth 3 ps)) |
49646 | 5264 (or (stringp pr-ps-command) |
5265 (setq pr-ps-command | |
5266 (cond (ps-windows-system "print") | |
5267 (ps-lp-system "lp") | |
5268 (t "lpr") | |
5269 ))) | |
5270 (or (stringp pr-ps-printer-switch) | |
5271 (setq pr-ps-printer-switch | |
5272 (cond (ps-windows-system "/D:") | |
5273 (ps-lp-system "-d") | |
5274 (t "-P") | |
5275 ))) | |
5276 (pr-eval-alist (nthcdr 4 ps))) | |
5277 (pr-update-mode-line)) | |
5278 | |
5279 | |
5280 (defun pr-txt-set-printer (value) | |
5281 (let ((txt (cdr (assq value pr-txt-printer-alist)))) | |
5282 (or txt | |
56578
a36e2d80b510
(toplevel, pr-ps-fast-fire, pr-ps-set-utility)
John Paul Wallington <jpw@pobox.com>
parents:
56493
diff
changeset
|
5283 (error "Invalid text printer name `%s' for variable `pr-txt-name'" |
49646 | 5284 value)) |
5285 (setq pr-txt-name value | |
56405
10b68aa88abe
Doc fix. Change name of some funs.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
56390
diff
changeset
|
5286 pr-txt-command (pr-dosify-file-name (nth 0 txt)) |
49646 | 5287 pr-txt-switches (nth 1 txt) |
56390
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
5288 pr-txt-printer (nth 2 txt))) |
49646 | 5289 (or (stringp pr-txt-command) |
5290 (setq pr-txt-command | |
5291 (cond (ps-windows-system "print") | |
5292 (ps-lp-system "lp") | |
5293 (t "lpr") | |
5294 ))) | |
5295 (pr-update-mode-line)) | |
5296 | |
5297 | |
5298 (defun pr-eval-alist (alist) | |
5299 (mapcar #'(lambda (option) | |
5300 (let ((var-sym (car option)) | |
5301 (value (cdr option))) | |
5302 (if (eq var-sym 'inherits-from:) | |
5303 (pr-eval-setting-alist value 'global) | |
5304 (set var-sym (eval value))))) | |
5305 alist)) | |
5306 | |
5307 | |
5308 (defun pr-eval-local-alist (alist) | |
5309 (let (local-list) | |
84876
0755bdd211b9
(pr-eval-local-alist, pr-eval-setting-alist): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents:
82295
diff
changeset
|
5310 (mapc #'(lambda (option) |
0755bdd211b9
(pr-eval-local-alist, pr-eval-setting-alist): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents:
82295
diff
changeset
|
5311 (let ((var-sym (car option)) |
0755bdd211b9
(pr-eval-local-alist, pr-eval-setting-alist): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents:
82295
diff
changeset
|
5312 (value (cdr option))) |
0755bdd211b9
(pr-eval-local-alist, pr-eval-setting-alist): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents:
82295
diff
changeset
|
5313 (setq local-list |
0755bdd211b9
(pr-eval-local-alist, pr-eval-setting-alist): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents:
82295
diff
changeset
|
5314 (if (eq var-sym 'inherits-from:) |
0755bdd211b9
(pr-eval-local-alist, pr-eval-setting-alist): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents:
82295
diff
changeset
|
5315 (nconc (pr-eval-setting-alist value) local-list) |
0755bdd211b9
(pr-eval-local-alist, pr-eval-setting-alist): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents:
82295
diff
changeset
|
5316 (set (make-local-variable var-sym) (eval value)) |
0755bdd211b9
(pr-eval-local-alist, pr-eval-setting-alist): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents:
82295
diff
changeset
|
5317 (cons var-sym local-list))))) |
0755bdd211b9
(pr-eval-local-alist, pr-eval-setting-alist): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents:
82295
diff
changeset
|
5318 alist) |
49646 | 5319 local-list)) |
5320 | |
5321 | |
5322 (defun pr-eval-setting-alist (key &optional global old) | |
5323 (let ((setting (cdr (assq key pr-setting-database)))) | |
5324 (and setting | |
5325 (let ((inherits (nth 0 setting)) | |
5326 (local (nth 1 setting)) | |
5327 (kill (nth 2 setting)) | |
5328 local-list) | |
5329 (and local global | |
5330 (progn | |
5331 (ding) | |
5332 (message "There are local buffer settings for `%S'." key) | |
5333 (setq global nil))) | |
5334 (and inherits | |
5335 (if (memq inherits old) | |
56578
a36e2d80b510
(toplevel, pr-ps-fast-fire, pr-ps-set-utility)
John Paul Wallington <jpw@pobox.com>
parents:
56493
diff
changeset
|
5336 (error "Circular inheritance for `%S'" inherits) |
49646 | 5337 (setq local-list |
5338 (pr-eval-setting-alist inherits global | |
5339 (cons inherits old))))) | |
84876
0755bdd211b9
(pr-eval-local-alist, pr-eval-setting-alist): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents:
82295
diff
changeset
|
5340 (mapc |
49646 | 5341 (cond ((not local) ; global settings |
5342 #'(lambda (option) | |
5343 (let ((var-sym (car option))) | |
5344 (or (eq var-sym 'inherits-from:) | |
5345 (set var-sym (eval (cdr option))))))) | |
5346 (kill ; local settings with killing | |
5347 #'(lambda (option) | |
5348 (let ((var-sym (car option))) | |
5349 (unless (eq var-sym 'inherits-from:) | |
5350 (setq local-list (cons var-sym local-list)) | |
5351 (set (make-local-variable var-sym) | |
5352 (eval (cdr option))))))) | |
5353 (t ; local settings without killing | |
5354 #'(lambda (option) | |
5355 (let ((var-sym (car option))) | |
5356 (or (eq var-sym 'inherits-from:) | |
5357 (set (make-local-variable var-sym) | |
5358 (eval (cdr option)))))))) | |
5359 (nthcdr 3 setting)) | |
5360 local-list)))) | |
5361 | |
5362 | |
5363 (defun pr-kill-local-variable (local-var-list) | |
5364 (mapcar 'kill-local-variable local-var-list)) | |
5365 | |
5366 | |
5367 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
5368 ;; Internal Functions (II) | |
5369 | |
5370 | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5371 (defun pr-toggle (var-sym mess entry index horizontal state |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5372 &optional path no-menu) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5373 (set var-sym (not (symbol-value var-sym))) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5374 (message "%s is %s" mess (if (symbol-value var-sym) "on" "off")) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5375 (or no-menu |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5376 (pr-menu-lock entry index horizontal state path))) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5377 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5378 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5379 (defun pr-toggle-file-duplex-menu (&optional no-menu) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5380 (interactive) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5381 (pr-toggle 'pr-file-duplex "PS file duplex" nil 7 5 nil |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5382 '("PostScript Print" "File") no-menu)) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5383 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5384 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5385 (defun pr-toggle-file-tumble-menu (&optional no-menu) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5386 (interactive) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5387 (pr-toggle 'pr-file-tumble "PS file tumble" nil 8 5 nil |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5388 '("PostScript Print" "File") no-menu)) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5389 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5390 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5391 (defun pr-toggle-file-landscape-menu (&optional no-menu) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5392 (interactive) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5393 (pr-toggle 'pr-file-landscape "PS file landscape" nil 6 5 nil |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5394 '("PostScript Print" "File") no-menu)) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5395 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5396 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5397 (defun pr-toggle-ghostscript-menu (&optional no-menu) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5398 (interactive) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5399 (pr-toggle 'pr-print-using-ghostscript "Printing using ghostscript" |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5400 'postscript-process 2 12 'toggle nil no-menu)) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5401 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5402 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5403 (defun pr-toggle-faces-menu (&optional no-menu) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5404 (interactive) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5405 (pr-toggle 'pr-faces-p "Printing with faces" |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5406 'postscript-process 1 12 'toggle nil no-menu)) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5407 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5408 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5409 (defun pr-toggle-spool-menu (&optional no-menu) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5410 (interactive) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5411 (pr-toggle 'pr-spool-p "Spooling printing" |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5412 'postscript-process 0 12 'toggle nil no-menu)) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5413 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5414 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5415 (defun pr-toggle-duplex-menu (&optional no-menu) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5416 (interactive) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5417 (pr-toggle 'ps-spool-duplex "Printing duplex" |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5418 'postscript-options 5 12 'toggle nil no-menu)) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5419 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5420 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5421 (defun pr-toggle-tumble-menu (&optional no-menu) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5422 (interactive) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5423 (pr-toggle 'ps-spool-tumble "Tumble" |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5424 'postscript-options 6 12 'toggle nil no-menu)) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5425 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5426 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5427 (defun pr-toggle-landscape-menu (&optional no-menu) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5428 (interactive) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5429 (pr-toggle 'ps-landscape-mode "Landscape" |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5430 'postscript-options 0 12 'toggle nil no-menu)) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5431 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5432 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5433 (defun pr-toggle-upside-down-menu (&optional no-menu) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5434 (interactive) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5435 (pr-toggle 'ps-print-upside-down "Upside-Down" |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5436 'postscript-options 7 12 'toggle nil no-menu)) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5437 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5438 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5439 (defun pr-toggle-line-menu (&optional no-menu) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5440 (interactive) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5441 (pr-toggle 'ps-line-number "Line number" |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5442 'postscript-options 3 12 'toggle nil no-menu)) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5443 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5444 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5445 (defun pr-toggle-zebra-menu (&optional no-menu) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5446 (interactive) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5447 (pr-toggle 'ps-zebra-stripes "Zebra stripe" |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5448 'postscript-options 4 12 'toggle nil no-menu)) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5449 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5450 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5451 (defun pr-toggle-header-menu (&optional no-menu) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5452 (interactive) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5453 (pr-toggle 'ps-print-header "Print header" |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5454 'postscript-options 1 12 'toggle nil no-menu)) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5455 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5456 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5457 (defun pr-toggle-header-frame-menu (&optional no-menu) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5458 (interactive) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5459 (pr-toggle 'ps-print-header-frame "Print header frame" |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5460 'postscript-options 2 12 'toggle nil no-menu)) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5461 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5462 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5463 (defun pr-toggle-lock-menu (&optional no-menu) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5464 (interactive) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5465 (pr-toggle 'pr-menu-lock "Menu lock" |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5466 'printing 2 12 'toggle nil no-menu)) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5467 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5468 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5469 (defun pr-toggle-region-menu (&optional no-menu) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5470 (interactive) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5471 (pr-toggle 'pr-auto-region "Auto region" |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5472 'printing 0 12 'toggle nil no-menu)) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5473 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5474 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5475 (defun pr-toggle-mode-menu (&optional no-menu) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5476 (interactive) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5477 (pr-toggle 'pr-auto-mode "Auto mode" |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5478 'printing 1 12 'toggle nil no-menu)) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5479 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5480 |
49646 | 5481 (defun pr-prompt (str) |
5482 (if (pr-auto-mode-p) | |
5483 (concat str " mode") | |
5484 (pr-region-active-string str))) | |
5485 | |
5486 | |
5487 (defun pr-prompt-region (str) | |
5488 (concat str (if (pr-auto-mode-p) | |
5489 " mode" | |
5490 " region"))) | |
5491 | |
5492 | |
5493 (defun pr-prompt-gs (str) | |
5494 (if (pr-using-ghostscript-p) | |
5495 (concat str " GS") | |
5496 str)) | |
5497 | |
5498 | |
5499 (defun pr-region-active-symbol (&optional region-p) | |
5500 (if (or region-p (pr-region-active-p)) | |
5501 'region | |
5502 'buffer)) | |
5503 | |
5504 | |
5505 (defun pr-region-active-string (prefix) | |
5506 (concat prefix | |
5507 (if (pr-region-active-p) | |
5508 " region" | |
5509 " buffer"))) | |
5510 | |
5511 | |
5512 (defun pr-show-setup (settings buffer-name) | |
5513 (with-output-to-temp-buffer buffer-name | |
5514 (princ settings) | |
5515 (print-help-return-message))) | |
5516 | |
5517 | |
5518 (defun pr-complete-alist (prompt alist default) | |
5519 (let ((collection (mapcar #'(lambda (elt) | |
5520 (setq elt (car elt)) | |
5521 (cons (symbol-name elt) elt)) | |
5522 alist))) | |
5523 (cdr (assoc (completing-read (concat prompt ": ") | |
5524 collection nil t | |
5525 (symbol-name default) nil | |
5526 (symbol-name default)) | |
5527 collection)))) | |
5528 | |
5529 | |
5530 (defun pr-delete-file (file) | |
57241
e53d659f0afd
Check if file exists before deleting it.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
57187
diff
changeset
|
5531 (and pr-delete-temp-file (file-exists-p file) |
e53d659f0afd
Check if file exists before deleting it.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
57187
diff
changeset
|
5532 (delete-file file))) |
49646 | 5533 |
5534 | |
5535 (defun pr-expand-file-name (filename) | |
56405
10b68aa88abe
Doc fix. Change name of some funs.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
56390
diff
changeset
|
5536 (pr-dosify-file-name (expand-file-name filename))) |
49646 | 5537 |
5538 | |
5539 (defun pr-ps-outfile-preprint (&optional mess) | |
5540 (let* ((prompt (format "%soutput PostScript file name: " (or mess ""))) | |
5541 (res (read-file-name prompt default-directory "" nil))) | |
5542 (while (cond ((not (file-writable-p res)) | |
5543 (ding) | |
5544 (setq prompt "is unwritable")) | |
5545 ((file-directory-p res) | |
5546 (ding) | |
5547 (setq prompt "is a directory")) | |
5548 ((file-exists-p res) | |
5549 (ding) | |
5550 (setq prompt "exists") | |
5551 (not (y-or-n-p (format "File `%s' exists; overwrite? " | |
5552 res)))) | |
5553 (t nil)) | |
5554 (setq res (read-file-name | |
5555 (format "File %s; PostScript file: " prompt) | |
5556 (file-name-directory res) nil nil | |
5557 (file-name-nondirectory res)))) | |
5558 (pr-expand-file-name res))) | |
5559 | |
5560 | |
5561 (defun pr-ps-infile-preprint (&optional mess) | |
5562 (let* ((prompt (format "%sinput PostScript file name: " (or mess ""))) | |
5563 (res (read-file-name prompt default-directory "" nil))) | |
5564 (while (cond ((not (file-exists-p res)) | |
5565 (ding) | |
5566 (setq prompt "doesn't exist")) | |
5567 ((not (file-readable-p res)) | |
5568 (ding) | |
5569 (setq prompt "is unreadable")) | |
5570 ((file-directory-p res) | |
5571 (ding) | |
5572 (setq prompt "is a directory")) | |
5573 (t nil)) | |
5574 (setq res (read-file-name | |
5575 (format "File %s; PostScript file: " prompt) | |
5576 (file-name-directory res) nil nil | |
5577 (file-name-nondirectory res)))) | |
5578 (pr-expand-file-name res))) | |
5579 | |
5580 | |
5581 (defun pr-ps-utility-args (n-up-sym infile-sym outfile-sym prompt) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5582 ;; check arguments for PostScript file processing. |
49646 | 5583 ;; n-up |
5584 (or (symbol-value n-up-sym) | |
5585 (set n-up-sym (pr-interactive-n-up prompt))) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5586 ;; input file |
49646 | 5587 (and (eq (symbol-value infile-sym) t) |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5588 (set infile-sym (pr-ps-infile-preprint prompt))) |
49646 | 5589 (or (symbol-value infile-sym) |
5590 (error "%s: input PostScript file name is missing" prompt)) | |
56405
10b68aa88abe
Doc fix. Change name of some funs.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
56390
diff
changeset
|
5591 (set infile-sym (pr-dosify-file-name (symbol-value infile-sym))) |
49646 | 5592 ;; output file |
5593 (and (eq (symbol-value outfile-sym) t) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5594 (set outfile-sym (and current-prefix-arg |
49646 | 5595 (pr-ps-outfile-preprint prompt)))) |
5596 (and (symbol-value outfile-sym) | |
56405
10b68aa88abe
Doc fix. Change name of some funs.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
56390
diff
changeset
|
5597 (set outfile-sym (pr-dosify-file-name (symbol-value outfile-sym)))) |
49646 | 5598 (pr-ps-file (symbol-value outfile-sym))) |
5599 | |
5600 | |
5601 (defun pr-ps-utility-process (n-up infile outfile) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5602 ;; activate utility to process a PostScript file. |
49646 | 5603 (let (item) |
5604 (and (stringp infile) (file-exists-p infile) | |
5605 (setq item (cdr (assq pr-ps-utility pr-ps-utility-alist))) | |
56390
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
5606 (pr-call-process (nth 0 item) |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
5607 (pr-switches-string (nth 1 item) |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
5608 "pr-ps-utility-alist entry") |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
5609 (pr-switches-string (nth 8 item) |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
5610 "pr-ps-utility-alist entry") |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
5611 (and (nth 2 item) |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
5612 (format (nth 2 item) ps-paper-type)) |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
5613 (format (nth 3 item) n-up) |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
5614 (and pr-file-landscape (nth 4 item)) |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
5615 (and pr-file-duplex (nth 5 item)) |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
5616 (and pr-file-tumble (nth 6 item)) |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
5617 (pr-expand-file-name infile) |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
5618 (nth 7 item) |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
5619 (pr-expand-file-name outfile))))) |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
5620 |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
5621 |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
5622 (defun pr-remove-nil-from-list (lst) |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
5623 (while (and lst (null (car lst))) |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
5624 (setq lst (cdr lst))) |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
5625 (let ((b lst) |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
5626 (l (cdr lst))) |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
5627 (while l |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
5628 (if (car l) |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
5629 (setq b l |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
5630 l (cdr l)) |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
5631 (setq l (cdr l)) |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
5632 (setcdr b l)))) |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
5633 lst) |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
5634 |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
5635 |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
5636 (defun pr-call-process (command &rest args) |
58241
4aa6d60fc66c
Fix typos & pr-switches-string
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58218
diff
changeset
|
5637 (let ((buffer (get-buffer-create "*Printing Command Output*")) |
4aa6d60fc66c
Fix typos & pr-switches-string
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58218
diff
changeset
|
5638 (cmd (pr-command command)) |
4aa6d60fc66c
Fix typos & pr-switches-string
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58218
diff
changeset
|
5639 status) |
4aa6d60fc66c
Fix typos & pr-switches-string
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58218
diff
changeset
|
5640 (setq args (pr-remove-nil-from-list args)) |
4aa6d60fc66c
Fix typos & pr-switches-string
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58218
diff
changeset
|
5641 ;; *Printing Command Output* == show command & args |
4aa6d60fc66c
Fix typos & pr-switches-string
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58218
diff
changeset
|
5642 (save-excursion |
4aa6d60fc66c
Fix typos & pr-switches-string
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58218
diff
changeset
|
5643 (set-buffer buffer) |
4aa6d60fc66c
Fix typos & pr-switches-string
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58218
diff
changeset
|
5644 (goto-char (point-max)) |
4aa6d60fc66c
Fix typos & pr-switches-string
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58218
diff
changeset
|
5645 (insert (format "%s %S\n" cmd args))) |
4aa6d60fc66c
Fix typos & pr-switches-string
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58218
diff
changeset
|
5646 ;; *Printing Command Output* == show any return message from command |
4aa6d60fc66c
Fix typos & pr-switches-string
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58218
diff
changeset
|
5647 (pr-save-file-modes |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
5648 (setq status |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
5649 (condition-case data |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
5650 (apply 'call-process cmd nil buffer nil args) |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
5651 ((quit error) |
58241
4aa6d60fc66c
Fix typos & pr-switches-string
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58218
diff
changeset
|
5652 (error-message-string data))))) |
4aa6d60fc66c
Fix typos & pr-switches-string
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58218
diff
changeset
|
5653 ;; *Printing Command Output* == show exit status |
4aa6d60fc66c
Fix typos & pr-switches-string
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58218
diff
changeset
|
5654 (save-excursion |
4aa6d60fc66c
Fix typos & pr-switches-string
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58218
diff
changeset
|
5655 (set-buffer buffer) |
4aa6d60fc66c
Fix typos & pr-switches-string
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58218
diff
changeset
|
5656 (goto-char (point-max)) |
4aa6d60fc66c
Fix typos & pr-switches-string
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58218
diff
changeset
|
5657 (insert (format "Exit status: %s\n\n" status))) |
4aa6d60fc66c
Fix typos & pr-switches-string
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58218
diff
changeset
|
5658 ;; message if error status |
4aa6d60fc66c
Fix typos & pr-switches-string
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58218
diff
changeset
|
5659 (if (or (stringp status) |
4aa6d60fc66c
Fix typos & pr-switches-string
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58218
diff
changeset
|
5660 (and (integerp status) (/= status 0))) |
4aa6d60fc66c
Fix typos & pr-switches-string
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58218
diff
changeset
|
5661 (message |
4aa6d60fc66c
Fix typos & pr-switches-string
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58218
diff
changeset
|
5662 "Printing error status: %s (see *Printing Command Output* buffer)" |
4aa6d60fc66c
Fix typos & pr-switches-string
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58218
diff
changeset
|
5663 status)))) |
49646 | 5664 |
5665 | |
5666 (defun pr-txt-print (from to) | |
56405
10b68aa88abe
Doc fix. Change name of some funs.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
56390
diff
changeset
|
5667 (let ((lpr-command (pr-standard-file-name (pr-command pr-txt-command))) |
49646 | 5668 (lpr-switches (pr-switches pr-txt-switches "pr-txt-switches")) |
5669 (printer-name pr-txt-printer)) | |
5670 (lpr-region from to))) | |
5671 | |
5672 | |
5673 (defun pr-switches-string (switches mess) | |
58241
4aa6d60fc66c
Fix typos & pr-switches-string
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58218
diff
changeset
|
5674 ;; If SWITCHES is nil, return nil. |
4aa6d60fc66c
Fix typos & pr-switches-string
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58218
diff
changeset
|
5675 ;; Otherwise, return the list of string in a string. |
4aa6d60fc66c
Fix typos & pr-switches-string
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58218
diff
changeset
|
5676 (and switches |
4aa6d60fc66c
Fix typos & pr-switches-string
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58218
diff
changeset
|
5677 (mapconcat 'identity (pr-switches switches mess) " "))) |
49646 | 5678 |
5679 | |
5680 (defun pr-switches (switches mess) | |
5681 (or (listp switches) | |
56578
a36e2d80b510
(toplevel, pr-ps-fast-fire, pr-ps-set-utility)
John Paul Wallington <jpw@pobox.com>
parents:
56493
diff
changeset
|
5682 (error "%S should have a list of strings" mess)) |
49646 | 5683 (ps-flatten-list ; dynamic evaluation |
5684 (mapcar 'ps-eval-switch switches))) | |
5685 | |
5686 | |
5687 (defun pr-ps-preview (kind n-up filename mess) | |
5688 (pr-set-n-up-and-filename 'n-up 'filename mess) | |
5689 (let ((file (pr-ps-file filename))) | |
5690 (pr-text2ps kind n-up file) | |
5691 (or pr-spool-p (pr-ps-file-preview file)))) | |
5692 | |
5693 | |
5694 (defun pr-ps-using-ghostscript (kind n-up filename mess) | |
5695 (pr-set-n-up-and-filename 'n-up 'filename mess) | |
5696 (let ((file (pr-ps-file filename))) | |
5697 (pr-text2ps kind n-up file) | |
5698 (unless (or pr-spool-p filename) | |
5699 (pr-ps-file-using-ghostscript file) | |
5700 (pr-delete-file file)))) | |
5701 | |
5702 | |
5703 (defun pr-ps-print (kind n-up filename mess) | |
5704 (pr-set-n-up-and-filename 'n-up 'filename mess) | |
5705 (let ((file (pr-ps-file filename))) | |
5706 (pr-text2ps kind n-up file) | |
5707 (unless (or pr-spool-p filename) | |
5708 (pr-ps-file-print file) | |
5709 (pr-delete-file file)))) | |
5710 | |
5711 | |
5712 (defun pr-ps-file (&optional filename) | |
56405
10b68aa88abe
Doc fix. Change name of some funs.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
56390
diff
changeset
|
5713 (pr-dosify-file-name (or filename |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5714 (make-temp-file |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5715 (convert-standard-filename |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5716 (expand-file-name pr-ps-temp-file pr-temp-dir)) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5717 nil ".ps")))) |
49646 | 5718 |
5719 | |
5720 (defun pr-interactive-n-up (mess) | |
5721 (or (stringp mess) (setq mess "*")) | |
5722 (save-match-data | |
65680
ed770a0a7846
2005-09-24 Emilio C. Lopes <eclig@gmx.net>
Romain Francoise <romain@orebokech.com>
parents:
65582
diff
changeset
|
5723 (let* ((fmt-prompt "%s[%s] N-up printing (default 1): ") |
49646 | 5724 (prompt "") |
5725 (str (pr-f-read-string (format fmt-prompt prompt mess) "1" nil "1")) | |
5726 int) | |
5727 (while (if (string-match "^\\s *[0-9]+$" str) | |
62887
3d8c6d031cf0
(pr-interactive-n-up): Use string-to-number.
Richard M. Stallman <rms@gnu.org>
parents:
58408
diff
changeset
|
5728 (setq int (string-to-number str) |
49646 | 5729 prompt (cond ((< int 1) "Integer below 1; ") |
5730 ((> int 100) "Integer above 100; ") | |
5731 (t nil))) | |
5732 (setq prompt "Invalid integer syntax; ")) | |
5733 (ding) | |
5734 (setq str | |
5735 (pr-f-read-string (format fmt-prompt prompt mess) str nil "1"))) | |
5736 int))) | |
5737 | |
5738 | |
5739 (defun pr-interactive-dir (mess) | |
5740 (let* ((dir-name (file-name-directory (or (buffer-file-name) | |
5741 default-directory))) | |
5742 (fmt-prompt (concat "%s[" mess "] Directory to print: ")) | |
5743 (dir (read-file-name (format fmt-prompt "") | |
5744 "" dir-name nil dir-name)) | |
5745 prompt) | |
5746 (while (cond ((not (file-directory-p dir)) | |
5747 (ding) | |
5748 (setq prompt "It's not a directory! ")) | |
5749 ((not (file-readable-p dir)) | |
5750 (ding) | |
5751 (setq prompt "Directory is unreadable! ")) | |
5752 (t nil)) | |
5753 (setq dir-name (file-name-directory dir) | |
5754 dir (read-file-name (format fmt-prompt prompt) | |
5755 "" dir-name nil dir-name))) | |
5756 (file-name-as-directory dir))) | |
5757 | |
5758 | |
5759 (defun pr-interactive-regexp (mess) | |
5760 (pr-f-read-string (format "[%s] File regexp to print: " mess) "" nil "")) | |
5761 | |
5762 | |
5763 (defun pr-interactive-dir-args (mess) | |
5764 (list | |
5765 ;; get directory argument | |
5766 (pr-interactive-dir mess) | |
5767 ;; get file name regexp | |
5768 (pr-interactive-regexp mess))) | |
5769 | |
5770 | |
5771 (defun pr-interactive-ps-dir-args (mess) | |
5772 (list | |
5773 ;; get n-up argument | |
5774 (pr-interactive-n-up mess) | |
5775 ;; get directory argument | |
5776 (pr-interactive-dir mess) | |
5777 ;; get file name regexp | |
5778 (pr-interactive-regexp mess) | |
5779 ;; get output file name | |
5780 (and (not pr-spool-p) | |
5781 (ps-print-preprint current-prefix-arg)))) | |
5782 | |
5783 | |
5784 (defun pr-interactive-n-up-file (mess) | |
5785 (list | |
5786 ;; get n-up argument | |
5787 (pr-interactive-n-up mess) | |
5788 ;; get output file name | |
5789 (and (not pr-spool-p) | |
5790 (ps-print-preprint current-prefix-arg)))) | |
5791 | |
5792 | |
5793 (defun pr-interactive-n-up-inout (mess) | |
5794 (list | |
5795 ;; get n-up argument | |
5796 (pr-interactive-n-up mess) | |
5797 ;; get input file name | |
5798 (pr-ps-infile-preprint (concat mess " ")) | |
5799 ;; get output file name | |
5800 (ps-print-preprint current-prefix-arg))) | |
5801 | |
5802 | |
5803 (defun pr-set-outfilename (filename-sym) | |
5804 (and (not pr-spool-p) | |
5805 (eq (symbol-value filename-sym) t) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5806 (set filename-sym (and current-prefix-arg |
49646 | 5807 (ps-print-preprint current-prefix-arg)))) |
5808 (and (symbol-value filename-sym) | |
56405
10b68aa88abe
Doc fix. Change name of some funs.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
56390
diff
changeset
|
5809 (set filename-sym (pr-dosify-file-name (symbol-value filename-sym))))) |
49646 | 5810 |
5811 | |
5812 (defun pr-set-n-up-and-filename (n-up-sym filename-sym mess) | |
5813 ;; n-up | |
5814 (or (symbol-value n-up-sym) | |
5815 (set n-up-sym (pr-interactive-n-up mess))) | |
5816 ;; output file | |
5817 (pr-set-outfilename filename-sym)) | |
5818 | |
5819 | |
5820 (defun pr-set-dir-args (dir-sym regexp-sym mess) | |
5821 ;; directory | |
5822 (or (symbol-value dir-sym) | |
5823 (set dir-sym (pr-interactive-dir mess))) | |
5824 ;; file name regexp | |
5825 (or (symbol-value regexp-sym) | |
5826 (set regexp-sym (pr-interactive-regexp mess)))) | |
5827 | |
5828 | |
5829 (defun pr-set-ps-dir-args (n-up-sym dir-sym regexp-sym filename-sym mess) | |
5830 ;; n-up | |
5831 (or (symbol-value n-up-sym) | |
5832 (set n-up-sym (pr-interactive-n-up mess))) | |
5833 ;; directory & file name regexp | |
5834 (pr-set-dir-args dir-sym regexp-sym mess) | |
5835 ;; output file | |
5836 (pr-set-outfilename filename-sym)) | |
5837 | |
5838 | |
5839 (defun pr-find-buffer-visiting (file) | |
5840 (if (not (file-directory-p file)) | |
5841 (find-buffer-visiting (if ps-windows-system | |
5842 (downcase file) | |
5843 file)) | |
5844 (let ((truename (file-truename file)) | |
5845 (blist (buffer-list)) | |
5846 found) | |
5847 (while (and (not found) blist) | |
5848 (save-excursion | |
5849 (set-buffer (car blist)) | |
5850 (and (eq major-mode 'dired-mode) | |
5851 (save-excursion | |
5852 (goto-char (point-min)) | |
5853 (string= (buffer-substring-no-properties | |
5854 (+ (point-min) 2) | |
5855 (progn | |
5856 (end-of-line) | |
5857 (1- (point)))) | |
5858 truename)) | |
5859 (setq found (car blist)))) | |
5860 (setq blist (cdr blist))) | |
5861 found))) | |
5862 | |
5863 | |
5864 (defun pr-file-list (dir file-regexp fun) | |
5865 (mapcar #'(lambda (file) | |
5866 (and (or pr-list-directory | |
5867 (not (file-directory-p file))) | |
5868 (let ((buffer (pr-find-buffer-visiting file)) | |
5869 pop-up-windows | |
5870 pop-up-frames) | |
5871 (and (or buffer | |
5872 (file-readable-p file)) | |
5873 (save-excursion | |
5874 (set-buffer (or buffer | |
5875 (find-file-noselect file))) | |
5876 (funcall fun) | |
5877 (or buffer | |
5878 (kill-buffer (current-buffer)))))))) | |
5879 (directory-files dir t file-regexp))) | |
5880 | |
5881 | |
5882 (defun pr-delete-file-if-exists (filename) | |
5883 (and (not pr-spool-p) (stringp filename) (file-exists-p filename) | |
5884 (delete-file filename))) | |
5885 | |
5886 | |
5887 (defun pr-ps-file-list (n-up dir file-regexp filename) | |
5888 (pr-delete-file-if-exists (setq filename (pr-expand-file-name filename))) | |
5889 (let ((pr-spool-p t)) | |
5890 (pr-file-list dir file-regexp | |
5891 #'(lambda () | |
5892 (if (pr-auto-mode-p) | |
5893 (pr-ps-mode n-up filename) | |
5894 (pr-text2ps 'buffer n-up filename))))) | |
5895 (or pr-spool-p | |
5896 (pr-despool-print filename))) | |
5897 | |
5898 | |
5899 (defun pr-text2ps (kind n-up filename &optional from to) | |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
5900 (pr-save-file-modes |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
5901 (let ((ps-n-up-printing n-up) |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
5902 (ps-spool-config (and (eq ps-spool-config 'setpagedevice) |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
5903 'setpagedevice))) |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
5904 (pr-delete-file-if-exists filename) |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
5905 (cond (pr-faces-p |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
5906 (cond (pr-spool-p |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
5907 ;; pr-faces-p and pr-spool-p |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
5908 ;; here FILENAME arg is ignored |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
5909 (cond ((eq kind 'buffer) |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
5910 (ps-spool-buffer-with-faces)) |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
5911 ((eq kind 'region) |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
5912 (ps-spool-region-with-faces (or from (point)) |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
5913 (or to (mark)))) |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
5914 )) |
49646 | 5915 ;; pr-faces-p and not pr-spool-p |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
5916 ((eq kind 'buffer) |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
5917 (ps-print-buffer-with-faces filename)) |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
5918 ((eq kind 'region) |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
5919 (ps-print-region-with-faces (or from (point)) |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
5920 (or to (mark)) filename)) |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
5921 )) |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
5922 (pr-spool-p |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
5923 ;; not pr-faces-p and pr-spool-p |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
5924 ;; here FILENAME arg is ignored |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
5925 (cond ((eq kind 'buffer) |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
5926 (ps-spool-buffer)) |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
5927 ((eq kind 'region) |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
5928 (ps-spool-region (or from (point)) (or to (mark)))) |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
5929 )) |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
5930 ;; not pr-faces-p and not pr-spool-p |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
5931 ((eq kind 'buffer) |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
5932 (ps-print-buffer filename)) |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
5933 ((eq kind 'region) |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
5934 (ps-print-region (or from (point)) (or to (mark)) filename)) |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
5935 )))) |
49646 | 5936 |
5937 | |
5938 (defun pr-command (command) | |
5939 "Return absolute file name specification for COMMAND. | |
5940 | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
5941 If COMMAND is an empty string, return it. |
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
5942 |
49646 | 5943 If COMMAND is already an absolute file name specification, return it. |
5944 Else it uses `pr-path-alist' to find COMMAND, if find it then return it; | |
5945 otherwise, gives an error. | |
5946 | |
5947 When using `pr-path-alist' to find COMMAND, the entries `cygwin', `windows' and | |
5948 `unix' are used (see `pr-path-alist' for documentation). | |
5949 | |
5950 If Emacs is running on Windows 95/98/NT/2000, tries to find COMMAND, | |
5951 COMMAND.exe, COMMAND.bat and COMMAND.com in this order." | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
5952 (if (string= command "") |
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
5953 command |
56405
10b68aa88abe
Doc fix. Change name of some funs.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
56390
diff
changeset
|
5954 (pr-dosify-file-name |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
5955 (or (pr-find-command command) |
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
5956 (pr-path-command (cond (pr-cygwin-system 'cygwin) |
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
5957 (ps-windows-system 'windows) |
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
5958 (t 'unix)) |
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
5959 (file-name-nondirectory command) |
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
5960 nil) |
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
5961 (error "Command not found: %s" |
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
5962 (file-name-nondirectory command)))))) |
49646 | 5963 |
5964 | |
5965 (defun pr-path-command (symbol command sym-list) | |
5966 (let ((lpath (cdr (assq symbol pr-path-alist))) | |
5967 cmd) | |
5968 ;; PATH expansion | |
5969 (and (eq symbol 'PATH) (null lpath) | |
5970 (setq lpath (parse-colon-path (getenv "PATH")))) | |
5971 (while (and lpath | |
5972 (not | |
5973 (setq cmd | |
5974 (let ((path (car lpath))) | |
5975 (cond | |
5976 ;; symbol expansion | |
5977 ((symbolp path) | |
5978 (and (not (memq path sym-list)) | |
5979 (pr-path-command path command | |
5980 (cons path sym-list)))) | |
5981 ;; normal path | |
5982 ((stringp path) | |
5983 (pr-find-command | |
5984 (expand-file-name | |
5985 (substitute-in-file-name | |
5986 (concat (file-name-as-directory path) | |
5987 command))))) | |
5988 ))))) | |
5989 (setq lpath (cdr lpath))) | |
5990 cmd)) | |
5991 | |
5992 | |
5993 (defun pr-find-command (cmd) | |
5994 (if ps-windows-system | |
5995 ;; windows system | |
5996 (let ((ext (cons (file-name-extension cmd t) | |
5997 (list ".exe" ".bat" ".com"))) | |
5998 found) | |
5999 (setq cmd (file-name-sans-extension cmd)) | |
6000 (while (and ext | |
6001 (setq found (concat cmd (car ext))) | |
6002 (not (and (file-regular-p found) | |
6003 (file-executable-p found)))) | |
6004 (setq ext (cdr ext) | |
6005 found nil)) | |
6006 found) | |
6007 ;; non-windows systems | |
6008 (and (file-regular-p cmd) | |
6009 (file-executable-p cmd) | |
6010 cmd))) | |
6011 | |
6012 | |
6013 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
6014 ;; Printing Interface (inspired on ps-print-interface.el) | |
6015 | |
6016 | |
82253
e100ad942371
Evaluate require only during compilation
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
82140
diff
changeset
|
6017 (eval-when-compile |
e100ad942371
Evaluate require only during compilation
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
82140
diff
changeset
|
6018 (require 'cus-edit) |
e100ad942371
Evaluate require only during compilation
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
82140
diff
changeset
|
6019 (require 'wid-edit) |
e100ad942371
Evaluate require only during compilation
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
82140
diff
changeset
|
6020 (require 'widget)) |
49646 | 6021 |
6022 | |
6023 (defvar pr-i-window-configuration nil) | |
6024 | |
6025 (defvar pr-i-buffer nil) | |
6026 (defvar pr-i-region nil) | |
6027 (defvar pr-i-mode nil) | |
6028 (defvar pr-i-despool nil) | |
6029 (defvar pr-i-ps-as-is t) | |
6030 (defvar pr-i-n-up 1) | |
6031 (defvar pr-i-directory "./") | |
6032 (defvar pr-i-regexp "") | |
6033 (defvar pr-i-ps-file "") | |
6034 (defvar pr-i-out-file "") | |
6035 (defvar pr-i-answer-yes nil) | |
6036 (defvar pr-i-process 'buffer) | |
6037 (defvar pr-i-ps-send 'printer) | |
6038 | |
6039 | |
6040 (defvar pr-interface-map nil | |
6041 "Keymap for pr-interface.") | |
6042 | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
6043 (unless pr-interface-map |
49646 | 6044 (setq pr-interface-map (make-sparse-keymap)) |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
6045 (cond ((featurep 'xemacs) ; XEmacs |
49646 | 6046 (pr-f-set-keymap-parents pr-interface-map (list widget-keymap)) |
6047 (pr-f-set-keymap-name pr-interface-map 'pr-interface-map)) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
6048 (t ; GNU Emacs |
49646 | 6049 (pr-f-set-keymap-parents pr-interface-map widget-keymap))) |
6050 (define-key pr-interface-map "q" 'pr-interface-quit) | |
6051 (define-key pr-interface-map "?" 'pr-interface-help)) | |
6052 | |
6053 | |
6054 (defmacro pr-interface-save (&rest body) | |
6055 `(save-excursion | |
6056 (set-buffer pr-i-buffer) | |
6057 ,@body)) | |
6058 | |
6059 | |
6060 (defun pr-create-interface () | |
6061 "Create the front end for printing package." | |
6062 (setq pr-i-buffer (buffer-name (current-buffer)) | |
6063 pr-i-region (ps-mark-active-p) | |
6064 pr-i-mode (pr-mode-alist-p) | |
6065 pr-i-window-configuration (current-window-configuration)) | |
6066 | |
6067 (put 'pr-i-process 'pr-widget-list nil) | |
6068 (put 'pr-i-ps-send 'pr-widget-list nil) | |
6069 | |
6070 (delete-other-windows) | |
6071 (kill-buffer (get-buffer-create pr-buffer-name)) | |
6072 (switch-to-buffer (get-buffer-create pr-buffer-name)) | |
6073 | |
6074 ;; header | |
6075 (let ((versions (concat "printing v" pr-version | |
6076 " ps-print v" ps-print-version))) | |
73827
985f3831f360
Fix Print submenu creation
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
73770
diff
changeset
|
6077 ;; to keep compatibility with Emacs 20 & 21: |
985f3831f360
Fix Print submenu creation
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
73770
diff
changeset
|
6078 ;; DO NOT REPLACE `?\ ' BY `?\s' |
985f3831f360
Fix Print submenu creation
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
73770
diff
changeset
|
6079 (widget-insert (make-string (- 79 (length versions)) ?\ ) versions)) |
49646 | 6080 (pr-insert-italic "\nCurrent Directory : " 1) |
6081 (pr-insert-italic default-directory) | |
6082 | |
6083 (pr-insert-section-1) ; 1. Print | |
6084 (pr-insert-section-2) ; 2. PostScript Printer | |
6085 (pr-insert-section-3) ; 3. Text Printer | |
6086 | |
6087 ;; separator | |
6088 (widget-insert "\n\n " (make-string 77 ?-)) | |
6089 | |
6090 (pr-insert-section-4) ; 4. Settings | |
6091 (pr-insert-section-5) ; 5. Customize | |
6092 (pr-insert-section-6) ; 6. Show Settings | |
6093 (pr-insert-section-7) ; 7. Help | |
6094 | |
6095 (use-local-map pr-interface-map) | |
6096 (widget-setup) | |
6097 (goto-char (point-min)) | |
6098 | |
6099 (and pr-i-region ; let region activated | |
6100 (pr-keep-region-active))) | |
6101 | |
6102 | |
6103 (defun pr-insert-section-1 () | |
6104 ;; 1. Print: | |
6105 (pr-insert-italic "\nPrint :" 1) | |
6106 | |
6107 ;; 1a. Buffer: | |
6108 ;; 1a. Buffer: Buffer List | |
6109 (pr-insert-radio-button 'pr-i-process 'buffer) | |
6110 (pr-insert-menu "Buffer List" 'pr-i-buffer | |
6111 (let ((blist (buffer-list)) | |
6112 case-fold-search choices) | |
6113 (while blist | |
6114 (let ((name (buffer-name (car blist))) | |
6115 (ignore pr-buffer-name-ignore) | |
6116 found) | |
6117 (setq blist (cdr blist)) | |
6118 (while (and ignore (not found)) | |
6119 (setq found (string-match (car ignore) name) | |
6120 ignore (cdr ignore))) | |
6121 (or found | |
6122 (setq choices | |
6123 (cons (list 'quote | |
6124 (list 'choice-item | |
6125 :format "%[%t%]" | |
6126 name)) | |
6127 choices))))) | |
6128 (nreverse choices)) | |
6129 " Buffer : " nil | |
6130 '(progn | |
6131 (pr-interface-save | |
6132 (setq pr-i-region (ps-mark-active-p) | |
6133 pr-i-mode (pr-mode-alist-p))) | |
6134 (pr-update-checkbox 'pr-i-region) | |
6135 (pr-update-checkbox 'pr-i-mode))) | |
6136 ;; 1a. Buffer: Region | |
6137 (put 'pr-i-region 'pr-widget | |
6138 (pr-insert-checkbox | |
6139 "\n " | |
6140 'pr-i-region | |
6141 #'(lambda (widget &rest ignore) | |
6142 (let ((region-p (pr-interface-save | |
6143 (ps-mark-active-p)))) | |
6144 (cond ((null (widget-value widget)) ; widget is nil | |
6145 (setq pr-i-region nil)) | |
6146 (region-p ; widget is true and there is a region | |
6147 (setq pr-i-region t) | |
6148 (widget-value-set widget t) | |
6149 (widget-setup)) ; MUST be called after widget-value-set | |
6150 (t ; widget is true and there is no region | |
6151 (ding) | |
6152 (message "There is no region active") | |
6153 (setq pr-i-region nil) | |
6154 (widget-value-set widget nil) | |
6155 (widget-setup))))) ; MUST be called after widget-value-set | |
6156 " Region")) | |
6157 ;; 1a. Buffer: Mode | |
6158 (put 'pr-i-mode 'pr-widget | |
6159 (pr-insert-checkbox | |
6160 " " | |
6161 'pr-i-mode | |
6162 #'(lambda (widget &rest ignore) | |
6163 (let ((mode-p (pr-interface-save | |
6164 (pr-mode-alist-p)))) | |
6165 (cond | |
6166 ((null (widget-value widget)) ; widget is nil | |
6167 (setq pr-i-mode nil)) | |
6168 (mode-p ; widget is true and there is a `mode' | |
6169 (setq pr-i-mode t) | |
6170 (widget-value-set widget t) | |
6171 (widget-setup)) ; MUST be called after widget-value-set | |
6172 (t ; widget is true and there is no `mode' | |
6173 (ding) | |
6174 (message | |
6175 "This buffer isn't in a mode that printing treats specially.") | |
6176 (setq pr-i-mode nil) | |
6177 (widget-value-set widget nil) | |
6178 (widget-setup))))) ; MUST be called after widget-value-set | |
6179 " Mode\n")) | |
6180 | |
6181 ;; 1b. Directory: | |
6182 (pr-insert-radio-button 'pr-i-process 'directory) | |
6183 (widget-create | |
6184 'directory | |
6185 :size 58 | |
6186 :format " Directory : %v" | |
6187 :notify 'pr-interface-directory | |
6188 :action (lambda (widget &optional event) | |
6189 (if (pr-interface-directory widget) | |
6190 (pr-widget-field-action widget event) | |
6191 (ding) | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
6192 (message "Please specify a readable directory"))) |
49646 | 6193 pr-i-directory) |
6194 ;; 1b. Directory: File Regexp | |
6195 (widget-create 'regexp | |
6196 :size 58 | |
6197 :format "\n File Regexp : %v\n" | |
6198 :notify (lambda (widget &rest ignore) | |
6199 (setq pr-i-regexp (widget-value widget))) | |
6200 pr-i-regexp) | |
6201 ;; 1b. Directory: List Directory Entry | |
6202 (widget-insert " ") | |
6203 (pr-insert-toggle 'pr-list-directory " List Directory Entry\n") | |
6204 | |
6205 ;; 1c. PostScript File: | |
6206 (pr-insert-radio-button 'pr-i-process 'file) | |
6207 (widget-create | |
6208 'file | |
6209 :size 51 | |
6210 :format " PostScript File : %v" | |
6211 :notify 'pr-interface-infile | |
6212 :action (lambda (widget &rest event) | |
6213 (if (pr-interface-infile widget) | |
6214 (pr-widget-field-action widget event) | |
6215 (ding) | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
6216 (message "Please specify a readable PostScript file"))) |
49646 | 6217 pr-i-ps-file) |
6218 ;; 1c. PostScript File: PostScript Utility | |
6219 (pr-insert-menu "PostScript Utility" 'pr-ps-utility | |
6220 (pr-choice-alist pr-ps-utility-alist) | |
6221 "\n PostScript Utility : " | |
6222 " ") | |
54210
602769168263
Replace "As Is..." in PostScript file print/preview by "No Preprocessing...".
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54209
diff
changeset
|
6223 ;; 1c. PostScript File: No Preprocessing |
602769168263
Replace "As Is..." in PostScript file print/preview by "No Preprocessing...".
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54209
diff
changeset
|
6224 (pr-insert-toggle 'pr-i-ps-as-is " No Preprocessing")) |
49646 | 6225 |
6226 | |
6227 (defun pr-insert-section-2 () | |
6228 ;; 2. PostScript Printer: | |
6229 ;; 2. PostScript Printer: PostScript Printer List | |
6230 (pr-insert-italic "\n\nPostScript Printer : " 2 20) | |
6231 (pr-insert-menu "PostScript Printer" 'pr-ps-name | |
6232 (pr-choice-alist pr-ps-printer-alist)) | |
6233 ;; 2. PostScript Printer: Despool | |
6234 (put 'pr-i-despool 'pr-widget | |
6235 (pr-insert-checkbox | |
6236 " " | |
6237 'pr-i-despool | |
6238 #'(lambda (widget &rest ignore) | |
6239 (if pr-spool-p | |
6240 (setq pr-i-despool (not pr-i-despool)) | |
6241 (ding) | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
6242 (message "Can despool only when spooling is actually selected") |
49646 | 6243 (setq pr-i-despool nil)) |
6244 (widget-value-set widget pr-i-despool) | |
6245 (widget-setup)) ; MUST be called after widget-value-set | |
6246 " Despool ")) | |
6247 ;; 2. PostScript Printer: Preview Print Quit | |
6248 (pr-insert-button 'pr-interface-preview "Preview" " ") | |
6249 (pr-insert-button 'pr-interface-ps-print "Print" " ") | |
6250 (pr-insert-button 'pr-interface-quit "Quit") | |
6251 ;; 2. PostScript Printer: Send to Printer/Temporary File | |
6252 (pr-insert-radio-button 'pr-i-ps-send 'printer) | |
6253 (widget-insert " Send to Printer/Temporary File") | |
6254 ;; 2. PostScript Printer: Send to File | |
6255 (pr-insert-radio-button 'pr-i-ps-send 'file) | |
6256 (widget-create | |
6257 'file | |
6258 :size 57 | |
6259 :format " Send to File : %v" | |
6260 :notify 'pr-interface-outfile | |
6261 :action (lambda (widget &rest event) | |
6262 (if (and (pr-interface-outfile widget) | |
6263 (or (not (file-exists-p pr-i-out-file)) | |
6264 (setq pr-i-answer-yes | |
6265 (y-or-n-p "File exists; overwrite? ")))) | |
6266 (pr-widget-field-action widget event) | |
6267 (ding) | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
6268 (message "Please specify a writable PostScript file"))) |
49646 | 6269 pr-i-out-file) |
6270 ;; 2. PostScript Printer: N-Up | |
6271 (widget-create | |
6272 'integer | |
6273 :size 3 | |
6274 :format "\n N-Up : %v" | |
6275 :notify (lambda (widget &rest ignore) | |
6276 (let ((value (if (string= (widget-apply widget :value-get) "") | |
6277 0 | |
6278 (widget-value widget)))) | |
6279 (if (and (integerp value) | |
6280 (<= 1 value) (<= value 100)) | |
6281 (progn | |
6282 (message " ") | |
6283 (setq pr-i-n-up value)) | |
6284 (ding) | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
6285 (message "Please specify an integer between 1 and 100")))) |
49646 | 6286 pr-i-n-up)) |
6287 | |
6288 | |
6289 (defun pr-insert-section-3 () | |
6290 ;; 3. Text Printer: | |
6291 (pr-insert-italic "\n\nText Printer : " 2 14) | |
6292 (pr-insert-menu "Text Printer" 'pr-txt-name | |
6293 (pr-choice-alist pr-txt-printer-alist) | |
6294 nil " ") | |
6295 (pr-insert-button 'pr-interface-printify "Printify" " ") | |
6296 (pr-insert-button 'pr-interface-txt-print "Print" " ") | |
6297 (pr-insert-button 'pr-interface-quit "Quit")) | |
6298 | |
6299 | |
6300 (defun pr-insert-section-4 () | |
6301 ;; 4. Settings: | |
6302 ;; 4. Settings: Landscape Auto Region Verbose | |
6303 (pr-insert-checkbox "\n\n " 'ps-landscape-mode | |
6304 #'(lambda (&rest ignore) | |
6305 (setq ps-landscape-mode (not ps-landscape-mode) | |
6306 pr-file-landscape ps-landscape-mode)) | |
6307 " Landscape ") | |
6308 (pr-insert-toggle 'pr-auto-region " Auto Region ") | |
6309 (pr-insert-toggle 'pr-buffer-verbose " Verbose\n ") | |
6310 | |
6311 ;; 4. Settings: Print Header Auto Mode | |
6312 (pr-insert-toggle 'ps-print-header " Print Header ") | |
6313 (pr-insert-toggle 'pr-auto-mode " Auto Mode\n ") | |
6314 | |
6315 ;; 4. Settings: Print Header Frame Menu Lock | |
6316 (pr-insert-toggle 'ps-print-header-frame " Print Header Frame ") | |
6317 (pr-insert-toggle 'pr-menu-lock " Menu Lock\n ") | |
6318 | |
6319 ;; 4. Settings: Line Number | |
6320 (pr-insert-toggle 'ps-line-number " Line Number\n ") | |
6321 | |
6322 ;; 4. Settings: Zebra Stripes Spool Buffer | |
6323 (pr-insert-toggle 'ps-zebra-stripes " Zebra Stripes") | |
6324 (pr-insert-checkbox " " | |
6325 'pr-spool-p | |
6326 #'(lambda (&rest ignore) | |
6327 (setq pr-spool-p (not pr-spool-p)) | |
6328 (unless pr-spool-p | |
6329 (setq pr-i-despool nil) | |
6330 (pr-update-checkbox 'pr-i-despool))) | |
6331 " Spool Buffer") | |
6332 | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
6333 ;; 4. Settings: Duplex Print with faces |
49646 | 6334 (pr-insert-checkbox "\n " |
6335 'ps-spool-duplex | |
6336 #'(lambda (&rest ignore) | |
6337 (setq ps-spool-duplex (not ps-spool-duplex) | |
6338 pr-file-duplex ps-spool-duplex)) | |
6339 " Duplex ") | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
6340 (pr-insert-toggle 'pr-faces-p " Print with faces") |
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
6341 |
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
6342 ;; 4. Settings: Tumble Print via Ghostscript |
49646 | 6343 (pr-insert-checkbox "\n " |
6344 'ps-spool-tumble | |
6345 #'(lambda (&rest ignore) | |
6346 (setq ps-spool-tumble (not ps-spool-tumble) | |
6347 pr-file-tumble ps-spool-tumble)) | |
6348 " Tumble ") | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
6349 (pr-insert-toggle 'pr-print-using-ghostscript " Print via Ghostscript\n ") |
49646 | 6350 |
6351 ;; 4. Settings: Upside-Down Page Parity | |
54209
c312c950b64d
Adjust buffer interface.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54146
diff
changeset
|
6352 (pr-insert-toggle 'ps-print-upside-down " Upside-Down") |
c312c950b64d
Adjust buffer interface.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54146
diff
changeset
|
6353 (pr-insert-italic "\n\nSelect Pages : " 2 14) |
49646 | 6354 (pr-insert-menu "Page Parity" 'ps-even-or-odd-pages |
6355 (mapcar #'(lambda (alist) | |
6356 (list 'quote | |
6357 (list 'choice-item | |
6358 :format "%[%t%]" | |
6359 :tag (cdr alist) | |
6360 :value (car alist)))) | |
6361 pr-even-or-odd-alist))) | |
6362 | |
6363 | |
6364 (defun pr-insert-section-5 () | |
6365 ;; 5. Customize: | |
6366 (pr-insert-italic "\n\nCustomize : " 2 11) | |
6367 (pr-insert-button 'pr-customize "printing" " ") | |
6368 (pr-insert-button #'(lambda (&rest ignore) (ps-print-customize)) | |
6369 "ps-print" " ") | |
6370 (pr-insert-button 'lpr-customize "lpr")) | |
6371 | |
6372 | |
6373 (defun pr-insert-section-6 () | |
6374 ;; 6. Show Settings: | |
6375 (pr-insert-italic "\nShow Settings : " 1 14) | |
6376 (pr-insert-button 'pr-show-pr-setup "printing" " ") | |
6377 (pr-insert-button 'pr-show-ps-setup "ps-print" " ") | |
6378 (pr-insert-button 'pr-show-lpr-setup "lpr")) | |
6379 | |
6380 | |
6381 (defun pr-insert-section-7 () | |
6382 ;; 7. Help: | |
6383 (pr-insert-italic "\nHelp : " 1 5) | |
6384 (pr-insert-button 'pr-interface-help "Interface Help" " ") | |
6385 (pr-insert-button 'pr-help "Menu Help" " ") | |
6386 (pr-insert-button 'pr-interface-quit "Quit" "\n ") | |
6387 (pr-insert-button 'pr-kill-help "Kill All Printing Help Buffer")) | |
6388 | |
6389 | |
6390 (defun pr-kill-help (&rest ignore) | |
6391 "Kill all printing help buffer." | |
6392 (interactive) | |
6393 (let ((help '("*Printing Interface Help*" "*Printing Help*" | |
6394 "*LPR Setup*" "*PR Setup*" "*PS Setup*"))) | |
6395 (while help | |
6396 (let ((buffer (get-buffer (car help)))) | |
6397 (setq help (cdr help)) | |
6398 (when buffer | |
6399 (delete-windows-on buffer) | |
6400 (kill-buffer buffer))))) | |
6401 (recenter (- (window-height) 2))) | |
6402 | |
6403 | |
6404 (defun pr-interface-quit (&rest ignore) | |
6405 "Kill the printing buffer interface and quit." | |
6406 (interactive) | |
6407 (kill-buffer pr-buffer-name) | |
6408 (set-window-configuration pr-i-window-configuration)) | |
6409 | |
6410 | |
6411 (defun pr-interface-help (&rest ignore) | |
6412 "printing buffer interface help." | |
6413 (interactive) | |
6414 (pr-show-setup pr-interface-help-message "*Printing Interface Help*")) | |
6415 | |
6416 | |
6417 (defun pr-interface-txt-print (&rest ignore) | |
6418 "Print using lpr package." | |
6419 (interactive) | |
6420 (condition-case data | |
6421 (cond | |
6422 ((eq pr-i-process 'directory) | |
6423 (pr-i-directory) | |
6424 (pr-interface-save | |
6425 (pr-txt-directory pr-i-directory pr-i-regexp))) | |
6426 ((eq pr-i-process 'buffer) | |
6427 (pr-interface-save | |
6428 (cond (pr-i-region | |
6429 (let ((pr-auto-mode pr-i-mode)) | |
6430 (pr-txt-region))) | |
6431 (pr-i-mode | |
6432 (let (pr-auto-region) | |
6433 (pr-txt-mode))) | |
6434 (t | |
6435 (let (pr-auto-mode pr-auto-region) | |
6436 (pr-txt-buffer))) | |
6437 ))) | |
6438 ((eq pr-i-process 'file) | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
6439 (error "Please specify a text file")) |
49646 | 6440 (t |
6441 (error "Internal error: `pr-i-process' = %S" pr-i-process)) | |
6442 ) | |
6443 ;; handlers | |
6444 ((quit error) | |
6445 (ding) | |
65582
4d1085b02d64
Message format spec fixes (1)
Deepak Goel <deego@gnufans.org>
parents:
64762
diff
changeset
|
6446 (message "%s" (error-message-string data))))) |
49646 | 6447 |
6448 | |
6449 (defun pr-interface-printify (&rest ignore) | |
6450 "Printify a buffer." | |
6451 (interactive) | |
6452 (condition-case data | |
6453 (cond | |
6454 ((eq pr-i-process 'directory) | |
6455 (pr-i-directory) | |
6456 (pr-interface-save | |
6457 (pr-printify-directory pr-i-directory pr-i-regexp))) | |
6458 ((eq pr-i-process 'buffer) | |
6459 (pr-interface-save | |
6460 (if pr-i-region | |
6461 (pr-printify-region) | |
6462 (pr-printify-buffer)))) | |
6463 ((eq pr-i-process 'file) | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
6464 (error "Cannot printify a PostScript file")) |
49646 | 6465 (t |
6466 (error "Internal error: `pr-i-process' = %S" pr-i-process)) | |
6467 ) | |
6468 ;; handlers | |
6469 ((quit error) | |
6470 (ding) | |
65582
4d1085b02d64
Message format spec fixes (1)
Deepak Goel <deego@gnufans.org>
parents:
64762
diff
changeset
|
6471 (message "%s" (error-message-string data))))) |
49646 | 6472 |
6473 | |
6474 (defun pr-interface-ps-print (&rest ignore) | |
6475 "Print using ps-print package." | |
6476 (interactive) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
6477 (pr-interface-ps 'pr-despool-ps-print 'pr-ps-directory-ps-print |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
6478 'pr-ps-file-ps-print 'pr-ps-file-up-ps-print |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
6479 'pr-ps-region-ps-print 'pr-ps-mode-ps-print |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
6480 'pr-ps-buffer-ps-print)) |
49646 | 6481 |
6482 | |
6483 (defun pr-interface-preview (&rest ignore) | |
6484 "Preview a PostScript file." | |
6485 (interactive) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
6486 (pr-interface-ps 'pr-despool-preview 'pr-ps-directory-preview |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
6487 'pr-ps-file-preview 'pr-ps-file-up-preview |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
6488 'pr-ps-region-preview 'pr-ps-mode-preview |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
6489 'pr-ps-buffer-preview)) |
49646 | 6490 |
6491 | |
6492 (defun pr-interface-ps (ps-despool ps-directory ps-file ps-file-up ps-region | |
6493 ps-mode ps-buffer) | |
6494 (condition-case data | |
6495 (let ((outfile (or (and (eq pr-i-process 'file) pr-i-ps-as-is) | |
6496 (pr-i-ps-send)))) | |
6497 (cond | |
6498 ((and pr-i-despool pr-spool-p) | |
6499 (pr-interface-save | |
6500 (funcall ps-despool outfile)) | |
6501 (setq pr-i-despool nil) | |
6502 (pr-update-checkbox 'pr-i-despool)) | |
6503 ((eq pr-i-process 'directory) | |
6504 (pr-i-directory) | |
6505 (pr-interface-save | |
6506 (funcall ps-directory | |
6507 pr-i-n-up pr-i-directory pr-i-regexp outfile))) | |
6508 ((eq pr-i-process 'file) | |
6509 (cond ((or (file-directory-p pr-i-ps-file) | |
6510 (not (file-readable-p pr-i-ps-file))) | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
6511 (error "Please specify a readable PostScript file")) |
49646 | 6512 (pr-i-ps-as-is |
6513 (pr-interface-save | |
6514 (funcall ps-file pr-i-ps-file))) | |
6515 (t | |
6516 (pr-interface-save | |
6517 (funcall ps-file-up pr-i-n-up pr-i-ps-file outfile))) | |
6518 )) | |
6519 ((eq pr-i-process 'buffer) | |
6520 (pr-interface-save | |
6521 (cond (pr-i-region | |
6522 (let ((pr-auto-mode pr-i-mode)) | |
6523 (funcall ps-region pr-i-n-up outfile))) | |
6524 (pr-i-mode | |
6525 (let (pr-auto-region) | |
6526 (funcall ps-mode pr-i-n-up outfile))) | |
6527 (t | |
6528 (let (pr-auto-mode pr-auto-region) | |
6529 (funcall ps-buffer pr-i-n-up outfile))) | |
6530 ))) | |
6531 (t | |
6532 (error "Internal error: `pr-i-process' = %S" pr-i-process)) | |
6533 )) | |
6534 ;; handlers | |
6535 ((quit error) | |
6536 (ding) | |
65582
4d1085b02d64
Message format spec fixes (1)
Deepak Goel <deego@gnufans.org>
parents:
64762
diff
changeset
|
6537 (message "%s" (error-message-string data))))) |
49646 | 6538 |
6539 | |
6540 (defun pr-i-ps-send () | |
6541 (cond ((eq pr-i-ps-send 'printer) | |
6542 nil) | |
6543 ((not (eq pr-i-ps-send 'file)) | |
6544 (error "Internal error: `pr-i-ps-send' = %S" pr-i-ps-send)) | |
6545 ((or (file-directory-p pr-i-out-file) | |
6546 (not (file-writable-p pr-i-out-file))) | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
6547 (error "Please specify a writable PostScript file")) |
49646 | 6548 ((or (not (file-exists-p pr-i-out-file)) |
6549 pr-i-answer-yes | |
6550 (setq pr-i-answer-yes | |
6551 (y-or-n-p (format "File `%s' exists; overwrite? " | |
6552 pr-i-out-file)))) | |
6553 pr-i-out-file) | |
6554 (t | |
6555 (error "File already exists")))) | |
6556 | |
6557 | |
6558 (defun pr-i-directory () | |
6559 (or (and (file-directory-p pr-i-directory) | |
6560 (file-readable-p pr-i-directory)) | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
6561 (error "Please specify be a readable directory"))) |
49646 | 6562 |
6563 | |
6564 (defun pr-interface-directory (widget &rest ignore) | |
6565 (and pr-buffer-verbose | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
6566 (message "You can use M-TAB or ESC TAB for file completion")) |
49646 | 6567 (let ((dir (widget-value widget))) |
6568 (and (file-directory-p dir) | |
6569 (file-readable-p dir) | |
6570 (setq pr-i-directory dir)))) | |
6571 | |
6572 | |
6573 (defun pr-interface-infile (widget &rest ignore) | |
6574 (and pr-buffer-verbose | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
6575 (message "You can use M-TAB or ESC TAB for file completion")) |
49646 | 6576 (let ((file (widget-value widget))) |
6577 (and (not (file-directory-p file)) | |
6578 (file-readable-p file) | |
6579 (setq pr-i-ps-file file)))) | |
6580 | |
6581 | |
6582 (defun pr-interface-outfile (widget &rest ignore) | |
6583 (setq pr-i-answer-yes nil) | |
6584 (and pr-buffer-verbose | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
6585 (message "You can use M-TAB or ESC TAB for file completion")) |
49646 | 6586 (let ((file (widget-value widget))) |
6587 (and (not (file-directory-p file)) | |
6588 (file-writable-p file) | |
6589 (setq pr-i-out-file file)))) | |
6590 | |
6591 | |
6592 (defun pr-widget-field-action (widget event) | |
6593 (and (get-buffer "*Completions*") ; clean frame window | |
6594 (delete-windows-on "*Completions*")) | |
6595 (message " ") ; clean echo area | |
6596 (widget-field-action widget event)) | |
6597 | |
6598 | |
6599 (defun pr-insert-italic (str &optional from to) | |
6600 (let ((len (length str))) | |
6601 (put-text-property (if from (max from 0) 0) | |
6602 (if to (max to len) len) | |
6603 'face 'italic str) | |
6604 (widget-insert str))) | |
6605 | |
6606 | |
6607 (defun pr-insert-checkbox (before var-sym fun label) | |
6608 (widget-insert before) | |
6609 (prog1 | |
6610 (widget-create 'checkbox | |
6611 :notify fun | |
6612 (symbol-value var-sym)) | |
6613 (widget-insert label))) | |
6614 | |
6615 | |
6616 (defun pr-insert-toggle (var-sym label) | |
6617 (widget-create 'checkbox | |
6618 :notify `(lambda (&rest ignore) | |
6619 (setq ,var-sym (not ,var-sym))) | |
6620 (symbol-value var-sym)) | |
6621 (widget-insert label)) | |
6622 | |
6623 | |
6624 (defun pr-insert-button (fun label &optional separator) | |
6625 (widget-create 'push-button | |
6626 :notify fun | |
6627 label) | |
6628 (and separator | |
6629 (widget-insert separator))) | |
6630 | |
6631 | |
6632 (defun pr-insert-menu (tag var-sym choices &optional before after &rest body) | |
6633 (and before (widget-insert before)) | |
6634 (eval `(widget-create 'menu-choice | |
6635 :tag ,tag | |
6636 :format "%v" | |
6637 :inline t | |
6638 :value ,var-sym | |
6639 :notify (lambda (widget &rest ignore) | |
6640 (setq ,var-sym (widget-value widget)) | |
6641 ,@body) | |
6642 :void '(choice-item :format "%[%t%]" | |
6643 :tag "Can not display value!") | |
6644 ,@choices)) | |
6645 (and after (widget-insert after))) | |
6646 | |
6647 | |
6648 (defun pr-insert-radio-button (var-sym sym) | |
6649 (widget-insert "\n") | |
6650 (let ((wid-list (get var-sym 'pr-widget-list)) | |
6651 (wid (eval `(widget-create | |
6652 'radio-button | |
6653 :format " %[%v%]" | |
6654 :value (eq ,var-sym (quote ,sym)) | |
6655 :notify (lambda (&rest ignore) | |
6656 (setq ,var-sym (quote ,sym)) | |
6657 (pr-update-radio-button (quote ,var-sym))))))) | |
6658 (put var-sym 'pr-widget-list (cons (cons wid sym) wid-list)))) | |
6659 | |
6660 | |
6661 (defun pr-update-radio-button (var-sym) | |
6662 (let ((wid-list (get var-sym 'pr-widget-list))) | |
6663 (while wid-list | |
6664 (let ((wid (car (car wid-list))) | |
6665 (value (cdr (car wid-list)))) | |
6666 (setq wid-list (cdr wid-list)) | |
6667 (widget-value-set wid (eq (symbol-value var-sym) value)))) | |
6668 (widget-setup))) | |
6669 | |
6670 | |
6671 (defun pr-update-checkbox (var-sym) | |
6672 (let ((wid (get var-sym 'pr-widget))) | |
6673 (when wid | |
6674 (widget-value-set wid (symbol-value var-sym)) | |
6675 (widget-setup)))) | |
6676 | |
6677 | |
6678 (defun pr-choice-alist (alist) | |
6679 (let ((max (apply 'max (mapcar #'(lambda (alist) | |
6680 (length (symbol-name (car alist)))) | |
6681 alist)))) | |
6682 (mapcar #'(lambda (alist) | |
6683 (let* ((sym (car alist)) | |
6684 (name (symbol-name sym))) | |
6685 (list | |
6686 'quote | |
6687 (list | |
6688 'choice-item | |
6689 :format "%[%t%]" | |
6690 :tag (concat name | |
6691 (make-string (- max (length name)) ?_)) | |
6692 :value sym)))) | |
6693 alist))) | |
6694 | |
6695 | |
6696 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
6697 | |
6698 | |
6699 (provide 'printing) | |
6700 | |
6701 | |
58138
a93efc8bd56c
(pr-get-symbol): Don't downcase.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
57241
diff
changeset
|
6702 ;; arch-tag: 9ce9ac3f-0f60-4370-900b-1943215d9d18 |
49646 | 6703 ;;; printing.el ends here |