Mercurial > emacs
annotate lisp/printing.el @ 85660:7dd9ef0af1e0
(nil-blank-string): Doc fix.
author | Juanma Barranquero <lekktu@gmail.com> |
---|---|
date | Fri, 26 Oct 2007 08:53:45 +0000 |
parents | 6b689f2a0bdc |
children | 666ace46440f |
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 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
85574
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1098 ;; User Interface (I) |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1099 |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1100 |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1101 (defgroup printing nil |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1102 "Printing Utilities group." |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1103 :tag "Printing Utilities" |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1104 :link '(emacs-library-link :tag "Source Lisp File" "printing.el") |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1105 :prefix "pr-" |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1106 :version "20" |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1107 :group 'wp |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1108 :group 'postscript) |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1109 |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1110 |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1111 (defcustom pr-path-style |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1112 (if (and (not pr-cygwin-system) |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1113 ps-windows-system) |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1114 'windows |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1115 'unix) |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1116 "*Specify which path style to use for external commands. |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1117 |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1118 Valid values are: |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1119 |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1120 windows Windows 9x/NT style (\\) |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1121 |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1122 unix Unix style (/)" |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1123 :type '(choice :tag "Path style" |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1124 (const :tag "Windows 9x/NT Style (\\)" :value windows) |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1125 (const :tag "Unix Style (/)" :value unix)) |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1126 :version "20" |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1127 :group 'printing) |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1128 |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1129 |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1130 |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1131 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1132 ;; Customization Functions |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1133 |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1134 |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1135 (defun pr-alist-custom-set (symbol value) |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1136 "Set the value of custom variables for printer & utility selection." |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1137 (set symbol value) |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1138 (and (featurep 'printing) ; update only after printing is loaded |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1139 (pr-update-menus t))) |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1140 |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1141 |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1142 (defun pr-ps-utility-custom-set (symbol value) |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1143 "Update utility menu entry." |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1144 (set symbol value) |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1145 (and (featurep 'printing) ; update only after printing is loaded |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1146 (pr-menu-set-utility-title value))) |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1147 |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1148 |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1149 (defun pr-ps-name-custom-set (symbol value) |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1150 "Update `PostScript Printer:' menu entry." |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1151 (set symbol value) |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1152 (and (featurep 'printing) ; update only after printing is loaded |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1153 (pr-menu-set-ps-title value))) |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1154 |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1155 |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1156 (defun pr-txt-name-custom-set (symbol value) |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1157 "Update `Text Printer:' menu entry." |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1158 (set symbol value) |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1159 (and (featurep 'printing) ; update only after printing is loaded |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1160 (pr-menu-set-txt-title value))) |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1161 |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1162 |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1163 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1164 ;; Internal Functions (I) |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1165 |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1166 |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1167 (defun pr-dosify-file-name (path) |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1168 "Replace unix-style directory separator character with dos/windows one." |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1169 (interactive "sPath: ") |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1170 (if (eq pr-path-style 'windows) |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1171 (subst-char-in-string ?/ ?\\ path) |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1172 path)) |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1173 |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1174 |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1175 (defun pr-unixify-file-name (path) |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1176 "Replace dos/windows-style directory separator character with unix one." |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1177 (interactive "sPath: ") |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1178 (if (eq pr-path-style 'windows) |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1179 (subst-char-in-string ?\\ ?/ path) |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1180 path)) |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1181 |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1182 |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1183 (defun pr-standard-file-name (path) |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1184 "Ensure the proper directory separator depending on the OS. |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1185 That is, if Emacs is running on DOS/Windows, ensure dos/windows-style directory |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1186 separator; otherwise, ensure unix-style directory separator." |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1187 (if (or pr-cygwin-system ps-windows-system) |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1188 (subst-char-in-string ?/ ?\\ path) |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1189 (subst-char-in-string ?\\ ?/ path))) |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1190 |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1191 |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
1192 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
49646 | 1193 ;; User Interface (II) |
1194 | |
1195 | |
1196 (defcustom pr-path-alist | |
1197 '((unix PATH) | |
1198 (cygwin PATH) | |
1199 (windows PATH)) | |
1200 "*Specify an alist for command paths. | |
1201 | |
1202 It's used to find commands used for printing package, like gv, gs, gsview.exe, | |
1203 mpage, print.exe, etc. See also `pr-command' function. | |
1204 | |
1205 Each element has the form: | |
1206 | |
1207 (ENTRY DIRECTORY...) | |
1208 | |
1209 Where: | |
1210 | |
1211 ENTRY It's a symbol, used to identify this entry. | |
1212 There must exist at least one of the following entries: | |
1213 | |
1214 unix this entry is used when Emacs is running on GNU or | |
1215 Unix system. | |
1216 | |
1217 cygwin this entry is used when Emacs is running on Windows | |
1218 95/98/NT/2000 with Cygwin. | |
1219 | |
1220 windows this entry is used when Emacs is running on Windows | |
1221 95/98/NT/2000. | |
1222 | |
1223 DIRECTORY It should be a string or a symbol. If it's a symbol, it should | |
1224 exist an equal entry in `pr-path-alist'. If it's a string, | |
1225 it's considered a directory specification. | |
1226 | |
1227 The directory specification may contain: | |
1228 $var environment variable expansion | |
1229 ~/ tilde expansion | |
1230 ./ current directory | |
1231 ../ previous directory | |
1232 | |
1233 For example, let's say the home directory is /home/my and the | |
1234 current directory is /home/my/dir, so: | |
1235 | |
1236 THE ENTRY IS EXPANDED TO | |
1237 ~/entry /home/my/entry | |
1238 ./entry /home/my/dir/entry | |
1239 ../entry /home/my/entry | |
1240 $HOME/entry /home/my/entry | |
1241 $HOME/~/other/../my/entry /home/my/entry | |
1242 | |
1243 SPECIAL SYMBOL: If the symbol `PATH' is used in the directory | |
1244 list and there isn't a `PATH' entry in `pr-path-alist' or the | |
1245 `PATH' entry has a null directory list, the PATH environment | |
1246 variable is used. | |
1247 | |
1248 Examples: | |
1249 | |
1250 * On GNU or Unix system: | |
1251 | |
1252 '((unix \".\" \"~/bin\" ghostview mpage PATH) | |
1253 (ghostview \"$HOME/bin/gsview-dir\") | |
1254 (mpage \"$HOME/bin/mpage-dir\") | |
1255 ) | |
1256 | |
1257 * On Windows system: | |
1258 | |
1259 '((windows \"c:/applications/executables\" PATH ghostview mpage) | |
1260 (ghostview \"c:/gs/gsview-dir\") | |
1261 (mpage \"c:/mpage-dir\") | |
1262 )" | |
1263 :type '(repeat | |
1264 (cons :tag "" | |
1265 (symbol :tag "Identifier ") | |
1266 (repeat :tag "Directory List" | |
1267 (choice :menu-tag "Directory" | |
1268 :tag "Directory" | |
1269 (string :value "") | |
1270 (symbol :value symbol))))) | |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
1271 :version "20" |
49646 | 1272 :group 'printing) |
1273 | |
1274 | |
1275 (defcustom pr-txt-name 'default | |
1276 "*Specify a printer for printing a text file. | |
1277 | |
1278 The printer name symbol should be defined on `pr-txt-printer-alist' (see it for | |
1279 documentation). | |
1280 | |
1281 This variable should be modified by customization engine. If this variable is | |
1282 modified by other means (for example, a lisp function), use `pr-update-menus' | |
1283 function (see it for documentation) to update text printer menu." | |
1284 :type 'symbol | |
1285 :set 'pr-txt-name-custom-set | |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
1286 :version "20" |
49646 | 1287 :group 'printing) |
1288 | |
1289 | |
1290 (defcustom pr-txt-printer-alist | |
1291 (list (list 'default lpr-command nil | |
1292 (cond ((boundp 'printer-name) printer-name) | |
1293 (ps-windows-system "PRN") | |
1294 (t nil) | |
1295 ))) | |
1296 ;; Examples: | |
1297 ;; * On GNU or Unix system: | |
1298 ;; '((prt_06a "lpr" nil "prt_06a") | |
1299 ;; (prt_07c nil nil "prt_07c") | |
1300 ;; ) | |
1301 ;; * On Windows system: | |
1302 ;; '((prt_06a "print" nil "/D:\\\\printers\\prt_06a") | |
1303 ;; (prt_07c nil nil "/D:\\\\printers\\prt_07c") | |
1304 ;; (PRN "" nil "PRN") | |
1305 ;; (standard "redpr.exe" nil "") | |
1306 ;; ) | |
1307 "*Specify an alist of all text printers (text printer database). | |
1308 | |
1309 The alist element has the form: | |
1310 | |
1311 (SYMBOL COMMAND SWITCHES NAME) | |
1312 | |
1313 Where: | |
1314 | |
1315 SYMBOL It's a symbol to identify a text printer. It's for | |
1316 `pr-txt-name' variable setting and for menu selection. | |
1317 Examples: | |
1318 'prt_06a | |
1319 'my_printer | |
1320 | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
1321 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
|
1322 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
|
1323 will write directly to the printer port given by NAME (see text |
49646 | 1324 below), that is, the NAME should be something like \"PRN\" or |
1325 \"LPT1:\". | |
1326 If NAME is something like \"\\\\\\\\host\\\\share-name\" then | |
1327 COMMAND shouldn't be an empty string. | |
1328 The programs `print' and `nprint' (the standard print programs | |
1329 on Windows NT and Novell Netware respectively) are handled | |
1330 specially, using NAME as the destination for output; any other | |
1331 program is treated like `lpr' except that an explicit filename | |
1332 is given as the last argument. | |
1333 If COMMAND is nil, it's used the default printing program: | |
1334 `print' for Windows system, `lp' for lp system and `lpr' for | |
1335 all other systems. See also `pr-path-alist'. | |
1336 Examples: | |
1337 \"print\" | |
1338 \"lpr\" | |
1339 \"lp\" | |
1340 | |
1341 SWITCHES List of sexp's to pass as extra options for text printer | |
1342 program. It is recommended to set NAME (see text below) | |
1343 instead of including an explicit switch on this list. | |
1344 Example: | |
1345 . for lpr | |
1346 '(\"-#3\" \"-l\") | |
1347 nil | |
1348 | |
1349 NAME A string that specifies a text printer name. | |
1350 On Unix-like systems, a string value should be a name | |
1351 understood by lpr's -P option (or lp's -d option). | |
1352 On MS-DOS and MS-Windows systems, it is the name of a printer | |
1353 device or port. Typical non-default settings would be \"LPT1:\" | |
1354 to \"LPT3:\" for parallel printers, or \"COM1\" to \"COM4\" or | |
1355 \"AUX\" for serial printers, or \"\\\\\\\\hostname\\\\printer\" | |
1356 (or \"/D:\\\\\\\\hostname\\\\printer\") for a shared network | |
1357 printer. You can also set it to a name of a file, in which | |
1358 case the output gets appended to that file. If you want to | |
1359 discard the printed output, set this to \"NUL\". | |
1360 Examples: | |
1361 . for print.exe | |
1362 \"/D:\\\\\\\\host\\\\share-name\" | |
1363 \"LPT1:\" | |
1364 \"PRN\" | |
1365 | |
1366 . for lpr or lp | |
1367 \"share-name\" | |
1368 | |
1369 This variable should be modified by customization engine. If this variable is | |
1370 modified by other means (for example, a lisp function), use `pr-update-menus' | |
1371 function (see it for documentation) to update text printer menu. | |
1372 | |
1373 Examples: | |
1374 | |
1375 * On GNU or Unix system: | |
1376 | |
1377 '((prt_06a \"lpr\" nil \"prt_06a\") | |
1378 (prt_07c nil nil \"prt_07c\") | |
1379 ) | |
1380 | |
1381 * On Windows system: | |
1382 | |
1383 '((prt_06a \"print\" nil \"/D:\\\\\\\\printers\\\\prt_06a\") | |
1384 (prt_07c nil nil \"/D:\\\\\\\\printers\\\\prt_07c\") | |
1385 (PRN \"\" nil \"PRN\") | |
1386 (standard \"redpr.exe\" nil \"\") | |
63328
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1387 ) |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1388 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1389 Useful links: |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1390 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1391 * Information about the print command (print.exe) |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1392 `http://www.computerhope.com/printhlp.htm' |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1393 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1394 * RedMon - Redirection Port Monitor (redpr.exe) |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1395 `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
|
1396 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1397 * Redirection Port Monitor (redpr.exe on-line help) |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1398 `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
|
1399 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1400 * UNIX man pages: lpr (or type `man lpr') |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1401 `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
|
1402 `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
|
1403 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1404 * UNIX man pages: lp (or type `man lp') |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1405 `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
|
1406 `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
|
1407 " |
49646 | 1408 :type '(repeat |
1409 (list :tag "Text Printer" | |
1410 (symbol :tag "Printer Symbol Name") | |
1411 (string :tag "Printer Command") | |
1412 (repeat :tag "Printer Switches" | |
1413 (sexp :tag "Switch" :value "")) | |
1414 (choice :menu-tag "Printer Name" | |
1415 :tag "Printer Name" | |
1416 (const :tag "None" nil) | |
1417 string))) | |
1418 :set 'pr-alist-custom-set | |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
1419 :version "20" |
49646 | 1420 :group 'printing) |
1421 | |
1422 | |
1423 (defcustom pr-ps-name 'default | |
1424 "*Specify a printer for printing a PostScript file. | |
1425 | |
1426 This printer name symbol should be defined on `pr-ps-printer-alist' (see it for | |
1427 documentation). | |
1428 | |
1429 This variable should be modified by customization engine. If this variable is | |
1430 modified by other means (for example, a lisp function), use `pr-update-menus' | |
1431 function (see it for documentation) to update PostScript printer menu." | |
1432 :type 'symbol | |
1433 :set 'pr-ps-name-custom-set | |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
1434 :version "20" |
49646 | 1435 :group 'printing) |
1436 | |
1437 | |
1438 (defcustom pr-ps-printer-alist | |
1439 (list (list 'default lpr-command nil | |
1440 (cond (ps-windows-system nil) | |
1441 (ps-lp-system "-d") | |
1442 (t "-P")) | |
1443 (or (getenv "PRINTER") (getenv "LPDEST") ps-printer-name))) | |
1444 ;; Examples: | |
1445 ;; * On GNU or Unix system: | |
1446 ;; '((lps_06b "lpr" nil "-P" "lps_06b") | |
1447 ;; (lps_07c "lpr" nil nil "lps_07c") | |
1448 ;; (lps_08c nil nil nil "lps_08c") | |
1449 ;; ) | |
1450 ;; * On Windows system: | |
1451 ;; '((lps_06a "print" nil "/D:" "\\\\printers\\lps_06a") | |
1452 ;; (lps_06b "print" nil nil "\\\\printers\\lps_06b") | |
1453 ;; (lps_07c "print" nil "" "/D:\\\\printers\\lps_07c") | |
1454 ;; (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
|
1455 ;; (b/w "gsprint" ("-all" "-twoup") "-printer " "b/w-pr-name") |
49646 | 1456 ;; (LPT1 "" nil "" "LPT1:") |
1457 ;; (PRN "" nil "" "PRN") | |
1458 ;; (standard "redpr.exe" nil "" "") | |
1459 ;; ) | |
1460 "*Specify an alist for all PostScript printers (PostScript printer database). | |
1461 | |
1462 The alist element has the form: | |
1463 | |
1464 (SYMBOL COMMAND SWITCHES PRINTER-SWITCH NAME DEFAULT...) | |
1465 | |
1466 Where: | |
1467 | |
1468 SYMBOL It's a symbol to identify a PostScript printer. It's for | |
1469 `pr-ps-name' variable setting and for menu selection. | |
1470 Examples: | |
1471 'prt_06a | |
1472 'my_printer | |
1473 | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
1474 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
|
1475 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
|
1476 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
|
1477 (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
|
1478 \"PRN\" or \"LPT1:\". |
49646 | 1479 If NAME is something like \"\\\\\\\\host\\\\share-name\" then |
1480 COMMAND shouldn't be an empty string. | |
1481 The programs `print' and `nprint' (the standard print programs | |
1482 on Windows NT and Novell Netware respectively) are handled | |
1483 specially, using NAME as the destination for output; any other | |
1484 program is treated like `lpr' except that an explicit filename | |
1485 is given as the last argument. | |
1486 If COMMAND is nil, it's used the default printing program: | |
1487 `print' for Windows system, `lp' for lp system and `lpr' for | |
1488 all other systems. See also `pr-path-alist'. | |
1489 Examples: | |
1490 \"print\" | |
1491 \"lpr\" | |
1492 \"lp\" | |
1493 \"cp\" | |
63328
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1494 \"gsprint\" |
49646 | 1495 |
1496 SWITCHES List of sexp's to pass as extra options for PostScript printer | |
1497 program. It is recommended to set NAME (see text below) | |
1498 instead of including an explicit switch on this list. | |
1499 Example: | |
1500 . for lpr | |
1501 '(\"-#3\" \"-l\") | |
1502 nil | |
1503 | |
63328
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1504 . for gsprint.exe |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1505 '(\"-all\" \"-twoup\") |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1506 |
49646 | 1507 PRINTER-SWITCH A string that specifies PostScript printer name switch. If |
1508 it's necessary to have a space between PRINTER-SWITCH and NAME, | |
1509 it should be inserted at the end of PRINTER-SWITCH string. | |
1510 If PRINTER-SWITCH is nil, it's used the default printer name | |
1511 switch: `/D:' for Windows system, `-d' for lp system and `-P' | |
1512 for all other systems. | |
1513 Examples: | |
1514 . for lpr | |
1515 \"-P \" | |
1516 | |
1517 . for lp | |
1518 \"-d \" | |
1519 | |
1520 . for print.exe | |
1521 \"/D:\" | |
1522 | |
63328
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1523 . for gsprint.exe |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1524 \"-printer \" |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1525 |
49646 | 1526 NAME A string that specifies a PostScript printer name. |
1527 On Unix-like systems, a string value should be a name | |
1528 understood by lpr's -P option (or lp's -d option). | |
1529 On MS-DOS and MS-Windows systems, it is the name of a printer | |
1530 device or port. Typical non-default settings would be \"LPT1:\" | |
1531 to \"LPT3:\" for parallel printers, or \"COM1\" to \"COM4\" or | |
1532 \"AUX\" for serial printers, or \"\\\\\\\\hostname\\\\printer\" | |
1533 (or \"/D:\\\\\\\\hostname\\\\printer\") for a shared network | |
1534 printer. You can also set it to a name of a file, in which | |
1535 case the output gets appended to that file. If you want to | |
1536 discard the printed output, set this to \"NUL\". | |
1537 Examples: | |
1538 . for cp.exe | |
1539 \"\\\\\\\\host\\\\share-name\" | |
1540 | |
63328
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1541 . for print.exe or gsprint.exe |
49646 | 1542 \"/D:\\\\\\\\host\\\\share-name\" |
1543 \"\\\\\\\\host\\\\share-name\" | |
1544 \"LPT1:\" | |
1545 \"PRN\" | |
1546 | |
1547 . for lpr or lp | |
1548 \"share-name\" | |
1549 | |
1550 DEFAULT It's a way to set default values when this entry is selected. | |
1551 It's a cons like: | |
1552 | |
1553 (VARIABLE . VALUE) | |
1554 | |
80951 | 1555 Which associates VARIABLE with VALUE. When this entry is |
49646 | 1556 selected, it's executed the following command: |
1557 | |
1558 (set VARIABLE (eval VALUE)) | |
1559 | |
1560 Note that VALUE can be any valid lisp expression. So, don't | |
1561 forget to quote symbols and constant lists. | |
1562 If VARIABLE is the special keyword `inherits-from:', VALUE must | |
1563 be a symbol name setting defined in `pr-setting-database' from | |
1564 which the current setting inherits the context. Take care with | |
1565 circular inheritance. | |
1566 Examples: | |
1567 '(ps-landscape-mode . nil) | |
1568 '(ps-spool-duplex . t) | |
1569 '(pr-gs-device . (my-gs-device t)) | |
1570 | |
1571 This variable should be modified by customization engine. If this variable is | |
1572 modified by other means (for example, a lisp function), use `pr-update-menus' | |
1573 function (see it for documentation) to update PostScript printer menu. | |
1574 | |
1575 Examples: | |
1576 | |
1577 * On GNU or Unix system: | |
1578 | |
1579 '((lps_06b \"lpr\" nil \"-P\" \"lps_06b\") | |
1580 (lps_07c \"lpr\" nil nil \"lps_07c\") | |
1581 (lps_08c nil nil nil \"lps_08c\") | |
1582 ) | |
1583 | |
1584 * On Windows system: | |
1585 | |
1586 '((lps_06a \"print\" nil \"/D:\" \"\\\\\\\\printers\\\\lps_06a\") | |
1587 (lps_06b \"print\" nil nil \"\\\\\\\\printers\\\\lps_06b\") | |
1588 (lps_07c \"print\" nil \"\" \"/D:\\\\\\\\printers\\\\lps_07c\") | |
1589 (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
|
1590 (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
|
1591 (b/w2 \"gsprint\" (\"-all\" \"-twoup\") nil \"-printer \\\\\\\\printers\\\\lps_06a\") |
49646 | 1592 (LPT1 \"\" nil \"\" \"LPT1:\") |
1593 (PRN \"\" nil \"\" \"PRN\") | |
1594 (standard \"redpr.exe\" nil \"\" \"\") | |
63328
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1595 ) |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1596 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1597 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1598 gsprint: |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1599 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1600 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
|
1601 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
|
1602 than ghostscript to print monochrome PostScript. |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1603 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1604 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
|
1605 similar to gsprint. |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1606 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1607 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
|
1608 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1609 As an example of gsprint declaration: |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1610 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1611 (setq pr-ps-printer-alist |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1612 '((A \"gsprint\" (\"-all\" \"-twoup\") \"-printer \" \"lps_015\") |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1613 (B \"gsprint\" (\"-all\" \"-twoup\") nil \"-printer lps_015\") |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1614 ;; some other printer declaration |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1615 )) |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1616 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1617 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
|
1618 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
|
1619 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
|
1620 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1621 There are other command line options like: |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1622 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1623 -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
|
1624 -grey Render in greyscale as 8bits/pixel. |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1625 -color Render in color as 24bits/pixel. |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1626 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1627 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
|
1628 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
|
1629 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
|
1630 are not printed. |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1631 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1632 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1633 Useful links: |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1634 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1635 * GSPRINT - Ghostscript print to Windows printer |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1636 `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
|
1637 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1638 * Introduction to Ghostscript |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1639 `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
|
1640 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1641 * How to use Ghostscript |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1642 `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
|
1643 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1644 * Information about the print command (print.exe) |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1645 `http://www.computerhope.com/printhlp.htm' |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1646 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1647 * RedMon - Redirection Port Monitor (redpr.exe) |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1648 `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
|
1649 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1650 * Redirection Port Monitor (redpr.exe on-line help) |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1651 `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
|
1652 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1653 * UNIX man pages: lpr (or type `man lpr') |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1654 `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
|
1655 `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
|
1656 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1657 * UNIX man pages: lp (or type `man lp') |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1658 `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
|
1659 `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
|
1660 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1661 * GNU utilities for Win32 (cp.exe) |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1662 `http://unxutils.sourceforge.net/' |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1663 " |
49646 | 1664 :type '(repeat |
1665 (list | |
1666 :tag "PostScript Printer" | |
1667 (symbol :tag "Printer Symbol Name") | |
1668 (string :tag "Printer Command") | |
1669 (repeat :tag "Printer Switches" | |
1670 (sexp :tag "Switch" :value "")) | |
1671 (choice :menu-tag "Printer Name Switch" | |
1672 :tag "Printer Name Switch" | |
1673 (const :tag "None" nil) | |
1674 string) | |
1675 (choice :menu-tag "Printer Name" | |
1676 :tag "Printer Name" | |
1677 (const :tag "None" nil) | |
1678 string) | |
1679 (repeat | |
1680 :tag "Default Value List" | |
1681 :inline t | |
1682 (cons | |
1683 :tag "" | |
1684 (choice | |
1685 :menu-tag "Variable" | |
1686 :tag "Variable" | |
1687 (const :tag "Landscape" ps-landscape-mode) | |
1688 (const :tag "Print Header" ps-print-header) | |
1689 (const :tag "Print Header Frame" ps-print-header-frame) | |
1690 (const :tag "Line Number" ps-line-number) | |
1691 (const :tag "Zebra Stripes" ps-zebra-stripes) | |
1692 (const :tag "Duplex" ps-spool-duplex) | |
1693 (const :tag "Tumble" ps-spool-tumble) | |
1694 (const :tag "Upside-Down" ps-print-upside-down) | |
1695 (const :tag "PS File Landscape" pr-file-landscape) | |
1696 (const :tag "PS File Duplex" pr-file-duplex) | |
1697 (const :tag "PS File Tumble" pr-file-tumble) | |
1698 (const :tag "Auto Region" pr-auto-region) | |
1699 (const :tag "Auto Mode" pr-auto-mode) | |
1700 (const :tag "Ghostscript Device" pr-gs-device) | |
1701 (const :tag "Ghostscript Resolution" pr-gs-resolution) | |
1702 (const :tag "inherits-from:" inherits-from:) | |
1703 (variable :tag "Other")) | |
1704 (sexp :tag "Value"))) | |
1705 )) | |
1706 :set 'pr-alist-custom-set | |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
1707 :version "20" |
49646 | 1708 :group 'printing) |
1709 | |
1710 | |
1711 (defcustom pr-temp-dir | |
56405
10b68aa88abe
Doc fix. Change name of some funs.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
56390
diff
changeset
|
1712 (pr-dosify-file-name |
49646 | 1713 (if (boundp 'temporary-file-directory) |
1714 (symbol-value 'temporary-file-directory) | |
1715 ;; hacked from `temporary-file-directory' variable in files.el | |
1716 (file-name-as-directory | |
1717 (or (getenv "TMPDIR") (getenv "TMP") (getenv "TEMP") | |
1718 (cond (ps-windows-system "c:/temp") | |
1719 ((memq system-type '(vax-vms axp-vms)) "SYS$SCRATCH:") | |
1720 (t "/tmp") | |
1721 ))))) | |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
1722 "*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
|
1723 |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
1724 See also `pr-ps-temp-file' and `pr-file-modes'." |
49646 | 1725 :type '(directory :tag "Temporary Directory") |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
1726 :version "20" |
49646 | 1727 :group 'printing) |
1728 | |
1729 | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
1730 (defcustom pr-ps-temp-file "prspool-" |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
1731 "*Specify PostScript temporary file name prefix. |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
1732 |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
1733 See also `pr-temp-dir' and `pr-file-modes'." |
49646 | 1734 :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
|
1735 :version "21" |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
1736 :group 'printing) |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
1737 |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
1738 |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
1739 ;; 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
|
1740 ;; 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
|
1741 ;; generated by `printing'. |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
1742 (defcustom pr-file-modes ?\600 |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
1743 "*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
|
1744 |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
1745 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
|
1746 |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
1747 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
|
1748 :type '(integer :tag "File Permission Bits") |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
1749 :version "21.3" |
49646 | 1750 :group 'printing) |
1751 | |
1752 | |
1753 (defcustom pr-gv-command | |
1754 (if ps-windows-system | |
1755 "gsview32.exe" | |
1756 "gv") | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
1757 "*Specify path and name of the gsview/gv utility. |
49646 | 1758 |
63328
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1759 See also `pr-path-alist'. |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1760 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1761 Useful links: |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1762 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1763 * GNU gv manual |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1764 `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
|
1765 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1766 * GSview Help |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1767 `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
|
1768 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1769 * GSview Help - Common Problems |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1770 `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
|
1771 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1772 * GSview Readme (compilation & installation) |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1773 `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
|
1774 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1775 * GSview (main site) |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1776 `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
|
1777 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1778 * Ghostscript, Ghostview and GSview |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1779 `http://www.cs.wisc.edu/~ghost/' |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1780 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1781 * Ghostview |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1782 `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
|
1783 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1784 * gv 3.5, June 1997 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1785 `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
|
1786 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1787 * MacGSView (MacOS) |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1788 `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
|
1789 " |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
1790 :type '(string :tag "Ghostview Utility") |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
1791 :version "20" |
49646 | 1792 :group 'printing) |
1793 | |
1794 | |
1795 (defcustom pr-gs-command | |
1796 (if ps-windows-system | |
1797 "gswin32.exe" | |
1798 "gs") | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
1799 "*Specify path and name of the ghostscript utility. |
49646 | 1800 |
63328
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1801 See also `pr-path-alist'. |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1802 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1803 Useful links: |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1804 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1805 * Ghostscript, Ghostview and GSview |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1806 `http://www.cs.wisc.edu/~ghost/' |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1807 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1808 * Introduction to Ghostscript |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1809 `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
|
1810 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1811 * How to use Ghostscript |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1812 `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
|
1813 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1814 * Printer compatibility |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1815 `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
|
1816 " |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
1817 :type '(string :tag "Ghostscript Utility") |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
1818 :version "20" |
49646 | 1819 :group 'printing) |
1820 | |
1821 | |
1822 (defcustom pr-gs-switches | |
1823 (if ps-windows-system | |
1824 '("-q -dNOPAUSE -Ic:/gs/gs5.50;c:/gs/gs5.50/fonts") | |
1825 '("-q -dNOPAUSE -I/usr/share/ghostscript/5.10")) | |
1826 "*Specify ghostscript switches. See the documentation on GS for more info. | |
1827 | |
1828 It's a list of strings, where each string is one or more ghostscript switches. | |
1829 | |
1830 A note on the gs switches: | |
1831 | |
1832 -q quiet | |
1833 -dNOPAUSE don't wait for user intervention | |
1834 -Ic:/gs/gs5.50;c:/gs/gs5.50/fonts the directories needed for gs | |
1835 -c quit it's added at the end to terminate gs | |
1836 | |
1837 To see ghostscript documentation for more information: | |
1838 | |
1839 * On GNU or Unix system: | |
1840 - for full documentation, type: man gs | |
1841 - for brief documentation, type: gs -h | |
1842 | |
1843 * On Windows system: | |
1844 - for full documentation, see in a browser the file | |
1845 c:/gstools/gs5.50/index.html, that is, the file index.html which is | |
1846 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
|
1847 - for brief documentation, type: gswin32.exe -h |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1848 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1849 Useful links: |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1850 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1851 * Introduction to Ghostscript |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1852 `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
|
1853 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1854 * How to use Ghostscript |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1855 `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
|
1856 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1857 * Printer compatibility |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
1858 `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
|
1859 " |
49646 | 1860 :type '(repeat (string :tag "Ghostscript Switch")) |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
1861 :version "20" |
49646 | 1862 :group 'printing) |
1863 | |
1864 | |
1865 (defcustom pr-gs-device | |
1866 (if ps-windows-system | |
1867 "mswinpr2" | |
1868 "uniprint") | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
1869 "*Specify the ghostscript device switch value (-sDEVICE=). |
49646 | 1870 |
1871 A note on the gs switches: | |
1872 | |
1873 -sDEVICE=djet500 the printer - works with HP DeskJet 540 | |
1874 | |
1875 See `pr-gs-switches' for documentation. | |
1876 See also `pr-ps-printer-alist'." | |
1877 :type '(string :tag "Ghostscript Device") | |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
1878 :version "20" |
49646 | 1879 :group 'printing) |
1880 | |
1881 | |
1882 (defcustom pr-gs-resolution 300 | |
1883 "*Specify ghostscript resolution switch value (-r). | |
1884 | |
1885 A note on the gs switches: | |
1886 | |
1887 -r300 resolution 300x300 | |
1888 | |
1889 See `pr-gs-switches' for documentation. | |
1890 See also `pr-ps-printer-alist'." | |
1891 :type '(integer :tag "Ghostscript Resolution") | |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
1892 :version "20" |
49646 | 1893 :group 'printing) |
1894 | |
1895 | |
1896 (defcustom pr-print-using-ghostscript nil | |
1897 "*Non-nil means print using ghostscript. | |
1898 | |
1899 This is useful if you don't have a PostScript printer, so you could use the | |
1900 ghostscript to print a PostScript file. | |
1901 | |
1902 In GNU or Unix system, if ghostscript is set as a PostScript filter, this | |
1903 variable should be nil." | |
1904 :type 'boolean | |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
1905 :version "20" |
49646 | 1906 :group 'printing) |
1907 | |
1908 | |
1909 (defcustom pr-faces-p nil | |
1910 "*Non-nil means print with face attributes." | |
1911 :type 'boolean | |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
1912 :version "20" |
49646 | 1913 :group 'printing) |
1914 | |
1915 | |
1916 (defcustom pr-spool-p nil | |
1917 "*Non-nil means spool printing in a buffer." | |
1918 :type 'boolean | |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
1919 :version "20" |
49646 | 1920 :group 'printing) |
1921 | |
1922 | |
1923 (defcustom pr-file-landscape nil | |
1924 "*Non-nil means print PostScript file in landscape orientation." | |
1925 :type 'boolean | |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
1926 :version "20" |
49646 | 1927 :group 'printing) |
1928 | |
1929 | |
1930 (defcustom pr-file-duplex nil | |
1931 "*Non-nil means print PostScript file in duplex mode." | |
1932 :type 'boolean | |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
1933 :version "20" |
49646 | 1934 :group 'printing) |
1935 | |
1936 | |
1937 (defcustom pr-file-tumble nil | |
1938 "*Non-nil means print PostScript file in tumble mode. | |
1939 | |
1940 If tumble is off, produces a printing suitable for binding on the left or | |
1941 right. | |
1942 If tumble is on, produces a printing suitable for binding at the top or | |
1943 bottom." | |
1944 :type 'boolean | |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
1945 :version "20" |
49646 | 1946 :group 'printing) |
1947 | |
1948 | |
1949 (defcustom pr-auto-region t | |
1950 "*Non-nil means region is automagically detected. | |
1951 | |
1952 Note that this will only work if you're using transient mark mode. | |
1953 | |
1954 When this variable is non-nil, the `*-buffer*' commands will behave like | |
1955 `*-region*' commands, that is, `*-buffer*' commands will print only the region | |
1956 marked instead of all buffer." | |
1957 :type 'boolean | |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
1958 :version "20" |
49646 | 1959 :group 'printing) |
1960 | |
1961 | |
1962 (defcustom pr-auto-mode t | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
1963 "*Non-nil means major-mode specific printing is prefered over normal printing. |
49646 | 1964 |
1965 That is, if current major-mode is declared in `pr-mode-alist', the `*-buffer*' | |
1966 and `*-region*' commands will behave like `*-mode*' commands; otherwise, | |
1967 `*-buffer*' commands will print the current buffer and `*-region*' commands | |
1968 will print the current region." | |
1969 :type 'boolean | |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
1970 :version "20" |
49646 | 1971 :group 'printing) |
1972 | |
1973 | |
1974 (defcustom pr-mode-alist | |
1975 '((mh-folder-mode ; mh summary buffer | |
1976 pr-mh-lpr-1 pr-mh-print-1 | |
1977 2 | |
1978 (ps-article-author ps-article-subject) | |
1979 ("/pagenumberstring load" pr-article-date) | |
1980 nil | |
1981 ) | |
1982 (mh-letter-mode ; mh letter buffer | |
1983 pr-mh-lpr-2 pr-mh-print-2 | |
1984 2 | |
1985 (ps-article-author ps-article-subject) | |
1986 ("/pagenumberstring load" pr-article-date) | |
1987 nil | |
1988 ) | |
1989 (rmail-summary-mode ; rmail summary buffer | |
1990 pr-rmail-lpr pr-rmail-print | |
1991 3 | |
1992 (ps-article-subject ps-article-author buffer-name) | |
1993 nil | |
1994 nil | |
1995 ) | |
1996 (rmail-mode ; rmail buffer | |
1997 pr-rmail-lpr pr-rmail-print | |
1998 3 | |
1999 (ps-article-subject ps-article-author buffer-name) | |
2000 nil | |
2001 nil | |
2002 ) | |
2003 (gnus-summary-mode ; gnus summary buffer | |
2004 pr-gnus-lpr pr-gnus-print | |
2005 3 | |
2006 (ps-article-subject ps-article-author gnus-newsgroup-name) | |
2007 nil | |
2008 nil | |
2009 ) | |
2010 (gnus-article-mode ; gnus article buffer | |
2011 pr-gnus-lpr pr-gnus-print | |
2012 3 | |
2013 (ps-article-subject ps-article-author gnus-newsgroup-name) | |
2014 nil | |
2015 nil | |
2016 ) | |
2017 (Info-mode ; Info buffer | |
2018 pr-mode-lpr pr-mode-print | |
2019 2 | |
2020 (ps-info-node ps-info-file) | |
2021 nil | |
2022 nil | |
2023 ) | |
2024 (vm-mode ; vm mode | |
2025 pr-vm-lpr pr-vm-print | |
2026 3 | |
2027 (ps-article-subject ps-article-author buffer-name) | |
2028 nil | |
2029 nil | |
2030 ) | |
2031 ) | |
2032 "*Specify an alist for a major-mode and printing functions. | |
2033 | |
2034 To customize a major mode printing, just declare the customization in | |
2035 `pr-mode-alist' and invoke some of `*-mode*' commands. An example for major | |
2036 mode usage is when you're using gnus (or mh, or rmail, etc.) and you're in the | |
2037 *Summary* buffer, if you forget to switch to the *Article* buffer before | |
2038 printing, you'll get a nicely formatted list of article subjects shows up at | |
2039 the printer. With major mode printing you don't need to switch from gnus | |
2040 *Summary* buffer first. | |
2041 | |
2042 The elements have the following form: | |
2043 | |
2044 (MAJOR-MODE | |
2045 LPR-PRINT PS-PRINT | |
2046 HEADER-LINES | |
2047 LEFT-HEADER | |
2048 RIGHT-HEADER | |
2049 KILL-LOCAL-VARIABLE | |
2050 DEFAULT...) | |
2051 | |
2052 Where: | |
2053 | |
2054 MAJOR-MODE It's the major mode symbol. | |
2055 | |
2056 LPR-PRINT It's a symbol function for text printing. It's invoked with | |
2057 one argument: | |
2058 (HEADER-LINES LEFT-HEADER RIGHT-HEADER DEFAULT...). | |
2059 | |
2060 Usually LPR-PRINT function prepares the environment or buffer | |
2061 and then call the function `pr-mode-lpr' which it's used to | |
2062 process the buffer and send it to text printer. | |
2063 | |
2064 The `pr-mode-lpr' definition is: | |
2065 | |
2066 (pr-mode-lpr HEADER-LIST &optional FROM TO) | |
2067 | |
2068 Where HEADER-LIST is like the argument passed to LPR-PRINT. | |
2069 FROM and TO are the beginning and end markers, respectively, | |
2070 for a region. If FROM is nil, it's used (point-min); if TO is | |
2071 nil, it's used (point-max). | |
2072 | |
2073 PS-PRINT It's a symbol function for PostScript printing. It's invoked | |
2074 with 3 arguments: n-up printing, file name and the list: | |
2075 (HEADER-LINES LEFT-HEADER RIGHT-HEADER DEFAULT...). | |
2076 | |
2077 Usually PS-PRINT function prepares the environment or buffer | |
2078 and then call the function `pr-mode-print' which it's used to | |
2079 process the buffer and send it to PostScript printer. | |
2080 | |
2081 The `pr-mode-print' definition is: | |
2082 | |
2083 (pr-mode-print N-UP FILENAME HEADER-LIST &optional FROM TO) | |
2084 | |
2085 Where N-UP, FILENAME and HEADER-LIST are like the arguments | |
2086 passed to PS-PRINT. FROM and TO are the beginning and end | |
2087 markers, respectively, for a region. If TO is nil, it's used | |
2088 (point-max). | |
2089 | |
2090 HEADER-LINES It's the number of header lines; if is nil, it uses | |
2091 `ps-header-lines' value. | |
2092 | |
2093 LEFT-HEADER It's the left header part, it's a list of string, variable | |
2094 symbol or function symbol (with no argument); if is nil, it | |
2095 uses `ps-left-header' value. | |
2096 | |
2097 RIGHT-HEADER It's the right header part, it's a list of string, variable | |
2098 symbol or function symbol (with no argument); if is nil, it | |
2099 uses `ps-right-header' value. | |
2100 | |
2101 KILL-LOCAL-VARIABLE | |
2102 Non-nil means to kill all buffer local variable declared in | |
2103 DEFAULT (see below). | |
2104 | |
2105 DEFAULT It's a way to set default values when this entry is selected. | |
2106 It's a cons like: | |
2107 | |
2108 (VARIABLE-SYM . VALUE) | |
2109 | |
80951 | 2110 Which associates VARIABLE-SYM with VALUE. When this entry is |
49646 | 2111 selected, it's executed the following command: |
2112 | |
2113 (set (make-local-variable VARIABLE-SYM) (eval VALUE)) | |
2114 | |
2115 Note that VALUE can be any valid lisp expression. So, don't | |
2116 forget to quote symbols and constant lists. | |
2117 If VARIABLE is the special keyword `inherits-from:', VALUE must | |
2118 be a symbol name setting defined in `pr-setting-database' from | |
2119 which the current setting inherits the context. Take care with | |
2120 circular inheritance. | |
2121 Examples: | |
2122 '(ps-landscape-mode . nil) | |
2123 '(ps-spool-duplex . t) | |
2124 '(pr-gs-device . (my-gs-device t))" | |
2125 :type '(repeat | |
2126 (list | |
2127 :tag "" | |
2128 (symbol :tag "Major Mode") | |
2129 (function :tag "Text Printing Function") | |
2130 (function :tag "PS Printing Function") | |
2131 (choice :menu-tag "Number of Header Lines" | |
2132 :tag "Number of Header Lines" | |
2133 (integer :tag "Number") | |
2134 (const :tag "Default Number" nil)) | |
2135 (repeat :tag "Left Header List" | |
2136 (choice :menu-tag "Left Header" | |
2137 :tag "Left Header" | |
2138 string symbol)) | |
2139 (repeat :tag "Right Header List" | |
2140 (choice :menu-tag "Right Header" | |
2141 :tag "Right Header" | |
2142 string symbol)) | |
2143 (boolean :tag "Kill Local Variable At End") | |
2144 (repeat | |
2145 :tag "Default Value List" | |
2146 :inline t | |
2147 (cons | |
2148 :tag "" | |
2149 (choice | |
2150 :menu-tag "Variable" | |
2151 :tag "Variable" | |
2152 (const :tag "Landscape" ps-landscape-mode) | |
2153 (const :tag "Print Header" ps-print-header) | |
2154 (const :tag "Print Header Frame" ps-print-header-frame) | |
2155 (const :tag "Line Number" ps-line-number) | |
2156 (const :tag "Zebra Stripes" ps-zebra-stripes) | |
2157 (const :tag "Duplex" ps-spool-duplex) | |
2158 (const :tag "Tumble" ps-spool-tumble) | |
2159 (const :tag "Upside-Down" ps-print-upside-down) | |
2160 (const :tag "PS File Landscape" pr-file-landscape) | |
2161 (const :tag "PS File Duplex" pr-file-duplex) | |
2162 (const :tag "PS File Tumble" pr-file-tumble) | |
2163 (const :tag "Auto Region" pr-auto-region) | |
2164 (const :tag "Auto Mode" pr-auto-mode) | |
2165 (const :tag "Ghostscript Device" pr-gs-device) | |
2166 (const :tag "Ghostscript Resolution" pr-gs-resolution) | |
2167 (const :tag "inherits-from:" inherits-from:) | |
2168 (variable :tag "Other")) | |
2169 (sexp :tag "Value"))) | |
2170 )) | |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
2171 :version "20" |
49646 | 2172 :group 'printing) |
2173 | |
2174 | |
2175 (defcustom pr-ps-utility 'mpage | |
2176 "*Specify PostScript utility symbol. | |
2177 | |
2178 This utility symbol should be defined on `pr-ps-utility-alist' (see it for | |
2179 documentation). | |
2180 | |
2181 This variable should be modified by customization engine. If this variable is | |
2182 modified by other means (for example, a lisp function), use `pr-update-menus' | |
2183 function (see it for documentation) to update PostScript utility menu. | |
2184 | |
2185 NOTE: Don't forget to download and install the utilities declared on | |
2186 `pr-ps-utility-alist'." | |
2187 :type '(symbol :tag "PS File Utility") | |
2188 :set 'pr-ps-utility-custom-set | |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
2189 :version "20" |
49646 | 2190 :group 'printing) |
2191 | |
2192 | |
2193 (defcustom pr-ps-utility-alist | |
2194 '((mpage "mpage" nil "-b%s" "-%d" "-l" "-t" "-T" ">" nil) | |
2195 (psnup "psnup" ("-q") "-P%s" "-%d" "-l" nil nil " " nil | |
2196 (inherits-from: . no-duplex)) | |
2197 ) | |
2198 ;; Examples: | |
2199 ;; * On GNU or Unix system: | |
2200 ;; '((mpage "mpage" nil "-b%s" "-%d" "-l" "-t" "-T" ">" nil) | |
2201 ;; (psnup "psnup" ("-q") "-P%s" "-%d" "-l" nil nil " " nil | |
2202 ;; (pr-file-duplex . nil) (pr-file-tumble . nil)) | |
2203 ;; ) | |
2204 ;; * On Windows system: | |
2205 ;; '((psnup "c:/psutils/psnup" ("-q") "-P%s" "-%d" "-l" nil nil " " nil | |
2206 ;; (pr-file-duplex . nil) (pr-file-tumble . nil)) | |
2207 ;; ) | |
2208 "*Specify an alist for PostScript utility processing (PS utility database). | |
2209 | |
2210 The alist element has the form: | |
2211 | |
2212 (SYMBOL UTILITY MUST-SWITCHES PAPERSIZE N-UP LANDSCAPE DUPLEX TUMBLE OUTPUT | |
2213 SWITCHES DEFAULT...) | |
2214 | |
2215 Where: | |
2216 | |
2217 SYMBOL It's a symbol to identify a PostScript utility. It's for | |
2218 `pr-ps-utility' variable setting and for menu selection. | |
2219 Examples: | |
2220 'mpage | |
2221 'psnup | |
2222 | |
2223 UTILITY Name of utility for processing a PostScript file. | |
2224 See also `pr-path-alist'. | |
2225 Examples: | |
2226 . for GNU or Unix system: | |
2227 \"mpage\" | |
2228 \"psnup -q\" | |
2229 | |
2230 . for Windows system: | |
2231 \"c:/psutils/psnup -q\" | |
2232 | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
2233 MUST-SWITCHES List of sexp's to pass as options to the PostScript utility |
49646 | 2234 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
|
2235 program and must be placed before any other switches. |
49646 | 2236 Example: |
2237 . for psnup: | |
2238 '(\"-q\") | |
2239 | |
2240 PAPERSIZE It's a format string to specify paper size switch. | |
2241 Example: | |
2242 . for mpage | |
2243 \"-b%s\" | |
2244 | |
2245 N-UP It's a format string to specify n-up switch. | |
2246 Example: | |
2247 . for psnup | |
2248 \"-%d\" | |
2249 | |
2250 LANDSCAPE It's a string to specify landscape switch. If the utility | |
2251 doesn't have landscape switch, set to nil. | |
2252 Example: | |
2253 . for psnup | |
2254 \"-l\" | |
2255 | |
2256 DUPLEX It's a string to specify duplex switch. If the utility doesn't | |
2257 have duplex switch, set to nil. | |
2258 Example: | |
2259 . for psnup | |
2260 nil | |
2261 | |
2262 TUMBLE It's a string to specify tumble switch. If the utility doesn't | |
2263 have tumble switch, set to nil. | |
2264 Example: | |
2265 . for psnup | |
2266 nil | |
2267 | |
2268 OUTPUT It's a string to specify how to generate an output file. Some | |
2269 utilities accept an output file option, but some others need | |
2270 output redirection or some other way to specify an output file. | |
2271 Example: | |
2272 . for psnup | |
2273 \" \" ; psnup ... input output | |
2274 | |
2275 . for mpage | |
2276 \">\" ; mpage ... input > output | |
2277 | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
2278 SWITCHES List of sexp's to pass as extra options to the PostScript utility |
49646 | 2279 program. |
2280 Example: | |
2281 . for psnup | |
2282 '(\"-q\") | |
2283 nil | |
2284 | |
2285 DEFAULT It's a way to set default values when this entry is selected. | |
2286 It's a cons like: | |
2287 | |
2288 (VARIABLE . VALUE) | |
2289 | |
80951 | 2290 Which associates VARIABLE with VALUE. When this entry is |
49646 | 2291 selected, it's executed the following command: |
2292 | |
2293 (set VARIABLE (eval VALUE)) | |
2294 | |
2295 Note that VALUE can be any valid lisp expression. So, don't | |
2296 forget to quote symbols and constant lists. | |
2297 If VARIABLE is the special keyword `inherits-from:', VALUE must | |
2298 be a symbol name setting defined in `pr-setting-database' from | |
2299 which the current setting inherits the context. Take care with | |
2300 circular inheritance. | |
2301 Examples: | |
2302 '(pr-file-landscape . nil) | |
2303 '(pr-file-duplex . t) | |
2304 '(pr-gs-device . (my-gs-device t)) | |
2305 | |
2306 This variable should be modified by customization engine. If this variable is | |
2307 modified by other means (for example, a lisp function), use `pr-update-menus' | |
2308 function (see it for documentation) to update PostScript utility menu. | |
2309 | |
2310 NOTE: Don't forget to download and install the utilities declared on | |
2311 `pr-ps-utility-alist'. | |
2312 | |
2313 Examples: | |
2314 | |
2315 * On GNU or Unix system: | |
2316 | |
2317 '((mpage \"mpage\" nil \"-b%s\" \"-%d\" \"-l\" \"-t\" \"-T\" \">\" nil) | |
2318 (psnup \"psnup\" (\"-q\") \"-P%s\" \"-%d\" \"-l\" nil nil \" \" nil | |
2319 (pr-file-duplex . nil) (pr-file-tumble . nil)) | |
2320 ) | |
2321 | |
2322 * On Windows system: | |
2323 | |
2324 '((psnup \"c:/psutils/psnup\" (\"-q\") \"-P%s\" \"-%d\" \"-l\" nil nil \" \" | |
2325 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
|
2326 ) |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
2327 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
2328 Useful links: |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
2329 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
2330 * mpage download (GNU or Unix) |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
2331 `http://www.mesa.nl/pub/mpage/' |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
2332 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
2333 * 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
|
2334 `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
|
2335 `http://www.rt.com/man/mpage.1.html' |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
2336 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
2337 * psnup (Windows, GNU or Unix) |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
2338 `http://www.knackered.org/angus/psutils/' |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
2339 `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
|
2340 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
2341 * psnup (PsUtils for Windows) |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
2342 `http://gnuwin32.sourceforge.net/packages/psutils.htm' |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
2343 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
2344 * 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
|
2345 `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
|
2346 `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
|
2347 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
2348 * GNU Enscript (Windows, GNU or Unix) |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
2349 `http://people.ssh.com/mtr/genscript/' |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
2350 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
2351 * GNU Enscript documentation (Windows, GNU or Unix) |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
2352 `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
|
2353 (on GNU or Unix, type `man enscript') |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
2354 " |
49646 | 2355 :type '(repeat |
2356 (list :tag "PS File Utility" | |
2357 (symbol :tag "Utility Symbol") | |
2358 (string :tag "Utility Name") | |
2359 (repeat :tag "Must Utility Switches" | |
2360 (sexp :tag "Switch" :value "")) | |
2361 (choice :menu-tag "Paper Size" | |
2362 :tag "Paper Size" | |
2363 (const :tag "No Paper Size" nil) | |
2364 (string :tag "Paper Size Format")) | |
2365 (choice :menu-tag "N-Up" | |
2366 :tag "N-Up" | |
2367 (const :tag "No N-Up" nil) | |
2368 (string :tag "N-Up Format")) | |
2369 (choice :menu-tag "Landscape" | |
2370 :tag "Landscape" | |
2371 (const :tag "No Landscape" nil) | |
2372 (string :tag "Landscape Switch")) | |
2373 (choice :menu-tag "Duplex" | |
2374 :tag "Duplex" | |
2375 (const :tag "No Duplex" nil) | |
2376 (string :tag "Duplex Switch")) | |
2377 (choice :menu-tag "Tumble" | |
2378 :tag "Tumble" | |
2379 (const :tag "No Tumble" nil) | |
2380 (string :tag "Tumble Switch")) | |
2381 (string :tag "Output Separator") | |
2382 (repeat :tag "Utility Switches" | |
2383 (sexp :tag "Switch" :value "")) | |
2384 (repeat | |
2385 :tag "Default Value List" | |
2386 :inline t | |
2387 (cons | |
2388 :tag "" | |
2389 (choice | |
2390 :menu-tag "Variable" | |
2391 :tag "Variable" | |
2392 (const :tag "PS File Landscape" pr-file-landscape) | |
2393 (const :tag "PS File Duplex" pr-file-duplex) | |
2394 (const :tag "PS File Tumble" pr-file-tumble) | |
2395 (const :tag "Ghostscript Device" pr-gs-device) | |
2396 (const :tag "Ghostscript Resolution" pr-gs-resolution) | |
2397 (const :tag "inherits-from:" inherits-from:) | |
2398 (variable :tag "Other")) | |
2399 (sexp :tag "Value"))) | |
2400 )) | |
2401 :set 'pr-alist-custom-set | |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
2402 :version "20" |
49646 | 2403 :group 'printing) |
2404 | |
2405 | |
2406 (defcustom pr-menu-lock t | |
2407 "*Non-nil means menu is locked while selecting toggle options. | |
2408 | |
2409 See also `pr-menu-char-height' and `pr-menu-char-width'." | |
2410 :type 'boolean | |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
2411 :version "20" |
49646 | 2412 :group 'printing) |
2413 | |
2414 | |
2415 (defcustom pr-setting-database | |
2416 '((no-duplex ; setting symbol name | |
2417 nil nil nil ; inherits local kill-local | |
2418 (pr-file-duplex . nil) ; settings | |
2419 (pr-file-tumble . nil)) | |
2420 ) | |
2421 "*Specify an alist for settings in general. | |
2422 | |
2423 The elements have the following form: | |
2424 | |
2425 (SYMBOL INHERITS LOCAL KILL-LOCAL SETTING...) | |
2426 | |
2427 Where: | |
2428 | |
2429 SYMBOL It's a symbol to identify the setting group. | |
2430 | |
2431 INHERITS Specify the inheritance for SYMBOL group. It's a symbol name | |
2432 setting from which the current setting inherits the context. | |
2433 If INHERITS is nil, means that there is no inheritance. | |
2434 This is a simple inheritance mechanism. | |
2435 | |
2436 Let's see an example to illustrate the inheritance mechanism: | |
2437 | |
2438 (setq pr-setting-database | |
2439 '((no-duplex ; setting symbol name | |
2440 nil ; inherits | |
2441 nil nil ; local kill-local | |
2442 (pr-file-duplex . nil) ; settings | |
2443 (pr-file-tumble . nil) | |
2444 ) | |
2445 (no-duplex-and-landscape ; setting symbol name | |
2446 no-duplex ; inherits | |
2447 nil nil ; local kill-local | |
2448 (pr-file-landscape . nil) ; settings | |
2449 ))) | |
2450 | |
2451 The example above has two setting groups: no-duplex and | |
2452 no-duplex-and-landscape. When setting no-duplex is activated | |
2453 through `inherits-from:' (see `pr-ps-utility', `pr-mode-alist' | |
2454 and `pr-ps-printer-alist'), the variables pr-file-duplex and | |
2455 pr-file-tumble are both set to nil. | |
2456 | |
2457 Now when setting no-duplex-and-landscape is activated through | |
2458 `inherits-from:', the variable pr-file-landscape is set to nil | |
2459 and also the settings for no-duplex are done, because | |
2460 no-duplex-and-landscape inherits settings from no-duplex. | |
2461 | |
2462 Take care with circular inheritance. It's an error if circular | |
2463 inheritance happens. | |
2464 | |
2465 LOCAL Non-nil means that all settings for SYMBOL group will be | |
2466 declared local buffer. | |
2467 | |
2468 KILL-LOCAL Non-nil means that all settings for SYMBOL group will be | |
2469 killed at end. It has effect only when LOCAL is non-nil. | |
2470 | |
2471 SETTING It's a cons like: | |
2472 | |
2473 (VARIABLE . VALUE) | |
2474 | |
80951 | 2475 Which associates VARIABLE with VALUE. When this entry is |
49646 | 2476 selected, it's executed the following command: |
2477 | |
2478 * If LOCAL is non-nil: | |
2479 (set (make-local-variable VARIABLE) (eval VALUE)) | |
2480 | |
2481 * If LOCAL is nil: | |
2482 (set VARIABLE (eval VALUE)) | |
2483 | |
2484 Note that VALUE can be any valid lisp expression. So, don't | |
2485 forget to quote symbols and constant lists. | |
2486 This setting is ignored if VARIABLE is equal to keyword | |
2487 `inherits-from:'. | |
2488 Examples: | |
2489 '(ps-landscape-mode . nil) | |
2490 '(ps-spool-duplex . t) | |
2491 '(pr-gs-device . (my-gs-device t))" | |
2492 :type '(repeat | |
2493 (list | |
2494 :tag "" | |
2495 (symbol :tag "Setting Name") | |
2496 (choice :menu-tag "Inheritance" | |
2497 :tag "Inheritance" | |
2498 (const :tag "No Inheritance" nil) | |
2499 (symbol :tag "Inherits From")) | |
2500 (boolean :tag "Local Buffer Setting") | |
2501 (boolean :tag "Kill Local Variable At End") | |
2502 (repeat | |
2503 :tag "Setting List" | |
2504 :inline t | |
2505 (cons | |
2506 :tag "" | |
2507 (choice | |
2508 :menu-tag "Variable" | |
2509 :tag "Variable" | |
2510 (const :tag "Landscape" ps-landscape-mode) | |
2511 (const :tag "Print Header" ps-print-header) | |
2512 (const :tag "Print Header Frame" ps-print-header-frame) | |
2513 (const :tag "Line Number" ps-line-number) | |
2514 (const :tag "Zebra Stripes" ps-zebra-stripes) | |
2515 (const :tag "Duplex" ps-spool-duplex) | |
2516 (const :tag "Tumble" ps-spool-tumble) | |
2517 (const :tag "Upside-Down" ps-print-upside-down) | |
2518 (const :tag "PS File Landscape" pr-file-landscape) | |
2519 (const :tag "PS File Duplex" pr-file-duplex) | |
2520 (const :tag "PS File Tumble" pr-file-tumble) | |
2521 (const :tag "Auto Region" pr-auto-region) | |
2522 (const :tag "Auto Mode" pr-auto-mode) | |
2523 (const :tag "Ghostscript Device" pr-gs-device) | |
2524 (const :tag "Ghostscript Resolution" pr-gs-resolution) | |
2525 (variable :tag "Other")) | |
2526 (sexp :tag "Value"))) | |
2527 )) | |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
2528 :version "20" |
49646 | 2529 :group 'printing) |
2530 | |
2531 | |
2532 (defcustom pr-visible-entry-list | |
2533 '(postscript text postscript-options postscript-process printing help) | |
2534 "*Specify a list of Printing menu visible entries. | |
2535 | |
2536 Valid values with the corresponding menu parts are: | |
2537 | |
2538 +------------------------------+ | |
2539 | Printing Interface | | |
2540 +------------------------------+ | |
2541 `postscript' | PostScript Preview >| | |
2542 | PostScript Print >| | |
2543 | PostScript Printer: name >| | |
2544 +------------------------------+ | |
2545 `text' | Printify >| | |
2546 | Print >| | |
2547 | Text Printer: name >| | |
2548 +------------------------------+ | |
2549 `postscript-options' |[ ] Landscape | | |
2550 |[ ] Print Header | | |
2551 |[ ] Print Header Frame | | |
2552 |[ ] Line Number | | |
2553 |[ ] Zebra Stripes | | |
2554 |[ ] Duplex | | |
2555 |[ ] Tumble | | |
2556 |[ ] Upside-Down | | |
2557 | Print All Pages >| | |
2558 +------------------------------+ | |
2559 `postscript-process' |[ ] Spool Buffer | | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
2560 |[ ] Print with faces | |
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
2561 |[ ] Print via Ghostscript | |
49646 | 2562 +------------------------------+ |
2563 `printing' |[ ] Auto Region | | |
2564 |[ ] Auto Mode | | |
2565 |[ ] Menu Lock | | |
2566 +------------------------------+ | |
2567 `help' | Customize >| | |
2568 | Show Settings >| | |
2569 | Help | | |
2570 +------------------------------+ | |
2571 | |
2572 Any other value is ignored." | |
2573 :type '(repeat :tag "Menu Visible Part" | |
2574 (choice :menu-tag "Menu Part" | |
2575 :tag "Menu Part" | |
2576 (const postscript) | |
2577 (const text) | |
2578 (const postscript-options) | |
2579 (const postscript-process) | |
2580 (const printing) | |
2581 (const help))) | |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
2582 :version "20" |
49646 | 2583 :group 'printing) |
2584 | |
2585 | |
2586 (defcustom pr-delete-temp-file t | |
2587 "*Non-nil means delete temporary files. | |
2588 | |
2589 Set `pr-delete-temp-file' to nil, if the following message (or a similar) | |
2590 happens when printing: | |
2591 | |
2592 Error: could not open \"c:\\temp\\prspool.ps\" for reading." | |
2593 :type 'boolean | |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
2594 :version "20" |
49646 | 2595 :group 'printing) |
2596 | |
2597 | |
2598 (defcustom pr-list-directory nil | |
2599 "*Non-nil means list directory when processing a directory. | |
2600 | |
2601 That is, any subdirectories (and the superdirectory) of the directory (given as | |
2602 argument of functions below) are also printed (as dired-mode listings). | |
2603 | |
2604 It's used by `pr-ps-directory-preview', `pr-ps-directory-using-ghostscript', | |
2605 `pr-ps-directory-print', `pr-ps-directory-ps-print', `pr-printify-directory' | |
2606 and `pr-txt-directory'." | |
2607 :type 'boolean | |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
2608 :version "20" |
49646 | 2609 :group 'printing) |
2610 | |
2611 | |
2612 (defcustom pr-buffer-name "*Printing Interface*" | |
2613 "*Specify the name of the buffer interface for printing package. | |
2614 | |
2615 It's used by `pr-interface'." | |
2616 :type 'string | |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
2617 :version "20" |
49646 | 2618 :group 'printing) |
2619 | |
2620 | |
2621 (defcustom pr-buffer-name-ignore | |
2622 (list (regexp-quote pr-buffer-name) ; ignore printing interface buffer | |
2623 "^ .*$") ; ignore invisible buffers | |
2624 "*Specify a regexp list for buffer names to be ignored in interface buffer. | |
2625 | |
2626 NOTE: Case is important for matching, that is, `case-fold-search' is always | |
2627 nil. | |
2628 | |
2629 It's used by `pr-interface'." | |
2630 :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
|
2631 :version "20" |
49646 | 2632 :group 'printing) |
2633 | |
2634 | |
2635 (defcustom pr-buffer-verbose t | |
2636 "*Non-nil means to be verbose when editing a field in interface buffer. | |
2637 | |
2638 It's used by `pr-interface'." | |
2639 :type 'boolean | |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
2640 :version "20" |
49646 | 2641 :group 'printing) |
2642 | |
85529
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2643 (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
|
2644 '((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
|
2645 (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
|
2646 (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
|
2647 (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
|
2648 (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
|
2649 |
49646 | 2650 |
2651 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
2652 ;; Internal Variables | |
2653 | |
2654 | |
2655 (defvar pr-txt-command nil | |
2656 "Name of program for printing a text file. | |
2657 See `pr-txt-printer-alist'.") | |
2658 | |
2659 | |
2660 (defvar pr-txt-switches nil | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
2661 "List of sexp's to pass as extra options to the text printer program. |
49646 | 2662 See `pr-txt-printer-alist'.") |
2663 | |
2664 | |
2665 (defvar pr-txt-printer nil | |
2666 "Specify text printer name. | |
2667 See `pr-txt-printer-alist'.") | |
2668 | |
2669 | |
2670 (defvar pr-ps-command nil | |
2671 "Name of program for printing a PostScript file. | |
2672 See `pr-ps-printer-alist'.") | |
2673 | |
2674 | |
2675 (defvar pr-ps-switches nil | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
2676 "List of sexp's to pass as extra options to the PostScript printer program. |
49646 | 2677 See `pr-ps-printer-alist'.") |
2678 | |
2679 | |
2680 (defvar pr-ps-printer-switch nil | |
2681 "Specify PostScript printer name switch. | |
2682 See `pr-ps-printer-alist'.") | |
2683 | |
2684 | |
2685 (defvar pr-ps-printer nil | |
2686 "Specify PostScript printer name. | |
2687 See `pr-ps-printer-alist'.") | |
2688 | |
2689 | |
2690 (defvar pr-menu-bar nil | |
2691 "Specify Printing menu-bar entry.") | |
2692 | |
85529
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2693 (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
|
2694 "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
|
2695 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2696 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
|
2697 |
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-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
|
2700 "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
|
2701 (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
|
2702 "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
|
2703 (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
|
2704 "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
|
2705 |
85574
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
2706 (defvar pr-menu-char-width) ;; Pacify the byte compiler. |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
2707 (defvar pr-menu-char-height) |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
2708 |
85529
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2709 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2710 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2711 ;; 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
|
2712 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2713 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2714 (cond |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2715 ((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
|
2716 ;; XEmacs |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2717 (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
|
2718 (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
|
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 (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
|
2722 (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
|
2723 (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
|
2724 str |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2725 default))) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2726 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2727 ;; XEmacs |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2728 (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
|
2729 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2730 ;; XEmacs |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2731 (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
|
2732 (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
|
2733 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2734 ;; XEmacs |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2735 (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
|
2736 (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
|
2737 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2738 ;; XEmacs |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2739 (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
|
2740 (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
|
2741 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2742 ;; XEmacs |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2743 (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
|
2744 (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
|
2745 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2746 ;; XEmacs |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2747 (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
|
2748 `(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
|
2749 (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
|
2750 ;; 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
|
2751 (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
|
2752 ,@body |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2753 (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
|
2754 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2755 ;; XEmacs |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2756 (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
|
2757 ;; 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
|
2758 (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
|
2759 (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
|
2760 (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
|
2761 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2762 ;; XEmacs |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2763 (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
|
2764 (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
|
2765 (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
|
2766 '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
|
2767 (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
|
2768 '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
|
2769 (* 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
|
2770 '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
|
2771 (* (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
|
2772 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2773 (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
|
2774 (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
|
2775 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2776 ;; XEmacs |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2777 (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
|
2778 (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
|
2779 (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
|
2780 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2781 ;; XEmacs |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2782 (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
|
2783 (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
|
2784 (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
|
2785 (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
|
2786 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
|
2787 (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
|
2788 (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
|
2789 (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
|
2790 (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
|
2791 (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
|
2792 (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
|
2793 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2794 ;; XEmacs |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2795 (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
|
2796 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2797 ;; XEmacs |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2798 (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
|
2799 (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
|
2800 (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
|
2801 (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
|
2802 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2803 ;; XEmacs |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2804 (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
|
2805 (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
|
2806 '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
|
2807 '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
|
2808 '("Printing") |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2809 '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
|
2810 force |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2811 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
|
2812 '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
|
2813 (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
|
2814 '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
|
2815 '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
|
2816 '("Printing") |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2817 '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
|
2818 force |
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-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
|
2820 '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
|
2821 (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
|
2822 (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
|
2823 '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
|
2824 '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
|
2825 '("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
|
2826 '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
|
2827 force |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2828 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
|
2829 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
|
2830 (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
|
2831 '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
|
2832 '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
|
2833 '("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
|
2834 '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
|
2835 force |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2836 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
|
2837 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
|
2838 (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
|
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 ;; XEmacs |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2841 (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
|
2842 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
|
2843 (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
|
2844 (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
|
2845 (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
|
2846 (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
|
2847 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
|
2848 (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
|
2849 (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
|
2850 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2851 ;; XEmacs |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2852 (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
|
2853 (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
|
2854 (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
|
2855 (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
|
2856 newname) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2857 (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
|
2858 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2859 ;; XEmacs |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2860 (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
|
2861 (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
|
2862 '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
|
2863 (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
|
2864 (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
|
2865 (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
|
2866 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2867 ;; XEmacs |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2868 (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
|
2869 (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
|
2870 '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
|
2871 (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
|
2872 (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
|
2873 (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
|
2874 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2875 ;; XEmacs |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2876 (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
|
2877 (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
|
2878 (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
|
2879 (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
|
2880 (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
|
2881 newname) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2882 (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
|
2883 (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
|
2884 newname) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2885 (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
|
2886 (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
|
2887 (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
|
2888 (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
|
2889 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2890 ;; XEmacs |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2891 (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
|
2892 (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
|
2893 '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
|
2894 (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
|
2895 (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
|
2896 (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
|
2897 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2898 ) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2899 (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
|
2900 ;; 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
|
2901 )) ; 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
|
2902 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2903 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2904 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2905 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
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 ;; 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
|
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 |
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 ((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
|
2912 ;; 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
|
2913 ) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2914 (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
|
2915 ;; 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
|
2916 (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
|
2917 (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
|
2918 (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
|
2919 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2920 ;; 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
|
2921 (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
|
2922 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2923 ;; 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
|
2924 (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
|
2925 (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
|
2926 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2927 ;; 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
|
2928 (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
|
2929 (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
|
2930 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2931 ;; 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
|
2932 (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
|
2933 (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
|
2934 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2935 ;; 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
|
2936 (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
|
2937 (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
|
2938 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2939 ;; 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
|
2940 ;; 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
|
2941 ;; 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
|
2942 ;; 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
|
2943 ;; 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
|
2944 (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
|
2945 (cond |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2946 ;; 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
|
2947 ((< 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
|
2948 (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
|
2949 (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
|
2950 (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
|
2951 (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
|
2952 (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
|
2953 (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
|
2954 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
|
2955 (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
|
2956 ) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2957 ;; 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
|
2958 (t |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2959 (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
|
2960 (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
|
2961 (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
|
2962 '("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
|
2963 '("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
|
2964 (cond |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2965 (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
|
2966 (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
|
2967 (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
|
2968 "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
|
2969 (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
|
2970 "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
|
2971 "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
|
2972 (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
|
2973 (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
|
2974 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
|
2975 (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
|
2976 (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
|
2977 (t |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2978 (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
|
2979 (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
|
2980 ))) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2981 ))) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2982 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2983 (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
|
2984 (cond |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2985 (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
|
2986 ;; 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
|
2987 (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
|
2988 (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
|
2989 (list |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2990 (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
|
2991 (- (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
|
2992 (* (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
|
2993 (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
|
2994 ) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2995 (t |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
2996 ;; 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
|
2997 (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
|
2998 (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
|
2999 (list |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3000 (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
|
3001 (* 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
|
3002 (- (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
|
3003 (* (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
|
3004 (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
|
3005 ))) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3006 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3007 (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
|
3008 (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
|
3009 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3010 ;; 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
|
3011 (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
|
3012 (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
|
3013 (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
|
3014 (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
|
3015 (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
|
3016 (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
|
3017 path |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3018 (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
|
3019 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
|
3020 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3021 ;; 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
|
3022 (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
|
3023 (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
|
3024 (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
|
3025 (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
|
3026 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
|
3027 (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
|
3028 (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
|
3029 (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
|
3030 (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
|
3031 (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
|
3032 (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
|
3033 (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
|
3034 (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
|
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 (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
|
3038 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3039 ;; 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
|
3040 (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
|
3041 (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
|
3042 '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
|
3043 '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
|
3044 "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 '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
|
3046 force |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3047 "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
|
3048 '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
|
3049 (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
|
3050 '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
|
3051 '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
|
3052 "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
|
3053 '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
|
3054 force |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3055 "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
|
3056 '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
|
3057 (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
|
3058 (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
|
3059 '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
|
3060 '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
|
3061 '("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
|
3062 '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
|
3063 force |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3064 "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
|
3065 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
|
3066 (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
|
3067 '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
|
3068 '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
|
3069 '("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
|
3070 '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
|
3071 force |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3072 "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
|
3073 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
|
3074 (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
|
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-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
|
3078 ;; 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
|
3079 (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
|
3080 (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
|
3081 (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
|
3082 (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
|
3083 (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
|
3084 (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
|
3085 (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
|
3086 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
|
3087 (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
|
3088 (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
|
3089 (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
|
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 ;; 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
|
3092 (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
|
3093 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3094 ;; 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
|
3095 (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
|
3096 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
|
3097 (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
|
3098 (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
|
3099 (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
|
3100 (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
|
3101 (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
|
3102 (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
|
3103 (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
|
3104 (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
|
3105 (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
|
3106 (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
|
3107 (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
|
3108 (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
|
3109 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3110 ;; 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
|
3111 (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
|
3112 (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
|
3113 (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
|
3114 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3115 ;; 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
|
3116 (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
|
3117 (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
|
3118 (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
|
3119 (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
|
3120 (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
|
3121 (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
|
3122 (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
|
3123 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3124 ;; 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
|
3125 (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
|
3126 (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
|
3127 (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
|
3128 (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
|
3129 (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
|
3130 (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
|
3131 (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
|
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 ;; 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
|
3134 (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
|
3135 (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
|
3136 (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
|
3137 (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
|
3138 (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
|
3139 (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
|
3140 '("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
|
3141 name) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3142 (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
|
3143 (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
|
3144 '("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
|
3145 name))) |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3146 (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
|
3147 (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
|
3148 (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
|
3149 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3150 ;; 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
|
3151 (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
|
3152 (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
|
3153 (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
|
3154 (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
|
3155 (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
|
3156 (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
|
3157 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3158 )) ; 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
|
3159 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3160 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3161 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
85574
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
3162 ;; User Interface (III) |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
3163 |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
3164 (defcustom pr-menu-char-height (pr-menu-char-height) |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
3165 "*Specify menu char height in pixels. |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
3166 |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
3167 This variable is used to guess which vertical position should be locked the |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
3168 menu, so don't forget to adjust it if menu position is not ok. |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
3169 |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
3170 See also `pr-menu-lock' and `pr-menu-char-width'." |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
3171 :type 'integer |
85529
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3172 :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
|
3173 :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
|
3174 |
84efd7d3c35e
* mail/vms-pmail.el (insert-signature): Don't use end-of-buffer.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
84876
diff
changeset
|
3175 |
85574
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
3176 (defcustom pr-menu-char-width (pr-menu-char-width) |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
3177 "*Specify menu char width in pixels. |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
3178 |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
3179 This variable is used to guess which horizontal position should be locked the |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
3180 menu, so don't forget to adjust it if menu position is not ok. |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
3181 |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
3182 See also `pr-menu-lock' and `pr-menu-char-height'." |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
3183 :type 'integer |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
3184 :version "20" |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
3185 :group 'printing) |
6b689f2a0bdc
Move variable definitions before use.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85529
diff
changeset
|
3186 |
49646 | 3187 |
3188 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
3189 ;; Macros |
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 (defmacro pr-save-file-modes (&rest body) |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
3193 "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
|
3194 `(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
|
3195 (set-default-file-modes pr-file-modes) |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
3196 ,@body |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
3197 (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
|
3198 |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
3199 |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
3200 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
49646 | 3201 ;; Keys & Menus |
3202 | |
3203 | |
3204 (defsubst pr-visible-p (key) | |
3205 (memq key pr-visible-entry-list)) | |
3206 | |
3207 | |
3208 (defsubst pr-mode-alist-p () | |
3209 (cdr (assq major-mode pr-mode-alist))) | |
3210 | |
3211 | |
3212 (defsubst pr-auto-mode-p () | |
3213 (and pr-auto-mode (pr-mode-alist-p))) | |
3214 | |
3215 | |
3216 (defsubst pr-using-ghostscript-p () | |
3217 (and pr-print-using-ghostscript (not pr-spool-p))) | |
3218 | |
3219 | |
66951
e21a70dc8958
(easy-menu-intern): Don't define.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
65680
diff
changeset
|
3220 (defalias 'pr-get-symbol |
73027
575850f5bd53
Adjust X-URL
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
68651
diff
changeset
|
3221 (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
|
3222 'easy-menu-intern |
e21a70dc8958
(easy-menu-intern): Don't define.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
65680
diff
changeset
|
3223 (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
|
3224 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3225 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3226 (defconst pr-menu-spec |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3227 ;; Menu mapping: |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3228 ;; 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
|
3229 ;; only for items. |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3230 ;; So, it uses :included instead of :active. |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3231 ;; Also, XEmacs doesn't support :help tag. |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3232 (let ((pr-:active (if (featurep 'xemacs) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3233 :included ; XEmacs |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3234 :active)) ; GNU Emacs |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3235 (pr-:help (if (featurep 'xemacs) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3236 'ignore ; XEmacs |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3237 #'(lambda (text) (list :help text))))) ; GNU Emacs |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3238 `( |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3239 ["Printing Interface" pr-interface |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3240 ,@(funcall |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3241 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
|
3242 "--" |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3243 ("PostScript Preview" :included (pr-visible-p 'postscript) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3244 ,@(funcall |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3245 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
|
3246 ("Directory" ,pr-:active (not pr-spool-p) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3247 ["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
|
3248 ["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
|
3249 ["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
|
3250 ["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
|
3251 :keys "\\[pr-ps-buffer-preview]"]) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3252 ("Buffer" ,pr-:active (not pr-spool-p) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3253 ["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
|
3254 ["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
|
3255 ["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
|
3256 ["Other..." (pr-ps-buffer-preview nil t) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3257 :keys "\\[pr-ps-buffer-preview]"]) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3258 ("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
|
3259 ["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
|
3260 ["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
|
3261 ["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
|
3262 ["Other..." (pr-ps-region-preview nil t) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3263 :keys "\\[pr-ps-region-preview]"]) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3264 ("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
|
3265 ["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
|
3266 ["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
|
3267 ["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
|
3268 ["Other..." (pr-ps-mode-preview nil t) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3269 :keys "\\[pr-ps-mode-preview]"]) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3270 ("File" |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3271 ["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
|
3272 :keys "\\[pr-ps-file-preview]" |
58218
63c796a99b3e
adjust pr-menu-spec
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58204
diff
changeset
|
3273 ,@(funcall |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3274 pr-:help "Preview PostScript file")] |
49646 | 3275 "--" |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3276 ["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
|
3277 ,@(funcall |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3278 pr-:help "Select PostScript utility")] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3279 "--" |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3280 ["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
|
3281 ["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
|
3282 ["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
|
3283 ["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
|
3284 :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
|
3285 "--" |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3286 ["Landscape" pr-toggle-file-landscape-menu |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3287 :style toggle :selected pr-file-landscape |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3288 ,@(funcall |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3289 pr-:help "Toggle landscape for PostScript file") |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3290 :active pr-ps-utility-alist] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3291 ["Duplex" pr-toggle-file-duplex-menu |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3292 :style toggle :selected pr-file-duplex |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3293 ,@(funcall |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3294 pr-:help "Toggle duplex for PostScript file") |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3295 :active pr-ps-utility-alist] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3296 ["Tumble" pr-toggle-file-tumble-menu |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3297 :style toggle :selected pr-file-tumble |
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 "Toggle tumble for PostScript file") |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3300 :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
|
3301 ["Despool..." (call-interactively 'pr-despool-preview) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3302 :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
|
3303 ,@(funcall |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3304 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
|
3305 ("PostScript Print" :included (pr-visible-p 'postscript) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3306 ,@(funcall |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3307 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
|
3308 ("Directory" |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3309 ["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
|
3310 ["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
|
3311 ["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
|
3312 ["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
|
3313 :keys "\\[pr-ps-buffer-ps-print]"]) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3314 ("Buffer" |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3315 ["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
|
3316 ["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
|
3317 ["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
|
3318 ["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
|
3319 :keys "\\[pr-ps-buffer-ps-print]"]) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3320 ("Region" ,pr-:active (ps-mark-active-p) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3321 ["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
|
3322 ["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
|
3323 ["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
|
3324 ["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
|
3325 :keys "\\[pr-ps-region-ps-print]"]) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3326 ("Mode" ,pr-:active (pr-mode-alist-p) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3327 ["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
|
3328 ["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
|
3329 ["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
|
3330 ["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
|
3331 :keys "\\[pr-ps-mode-ps-print]"]) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3332 ("File" |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3333 ["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
|
3334 :keys "\\[pr-ps-file-ps-print]" |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3335 ,@(funcall |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3336 pr-:help "Send PostScript file to printer")] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3337 "--" |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3338 ["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
|
3339 ,@(funcall |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3340 pr-:help "Select PostScript utility")] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3341 "--" |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3342 ["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
|
3343 ["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
|
3344 ["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
|
3345 ["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
|
3346 :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
|
3347 "--" |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3348 ["Landscape" pr-toggle-file-landscape-menu |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3349 :style toggle :selected pr-file-landscape |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3350 ,@(funcall |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3351 pr-:help "Toggle landscape for PostScript file") |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3352 :active pr-ps-utility-alist] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3353 ["Duplex" pr-toggle-file-duplex-menu |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3354 :style toggle :selected pr-file-duplex |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3355 ,@(funcall |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3356 pr-:help "Toggle duplex for PostScript file") |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3357 :active pr-ps-utility-alist] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3358 ["Tumble" pr-toggle-file-tumble-menu |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3359 :style toggle :selected pr-file-tumble |
58218
63c796a99b3e
adjust pr-menu-spec
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58204
diff
changeset
|
3360 ,@(funcall |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3361 pr-:help "Toggle tumble for PostScript file") |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3362 :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
|
3363 ["Despool..." (call-interactively 'pr-despool-ps-print) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3364 :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
|
3365 ,@(funcall |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3366 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
|
3367 ["PostScript Printers" pr-update-menus |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3368 :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
|
3369 ,@(funcall |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3370 pr-:help "Select PostScript printer")] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3371 "--" |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3372 ("Printify" :included (pr-visible-p 'text) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3373 ,@(funcall |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3374 pr-:help |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3375 "Replace non-printing chars with printable representations.") |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3376 ["Directory" pr-printify-directory t] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3377 ["Buffer" pr-printify-buffer t] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3378 ["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
|
3379 ("Print" :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 "Send text to printer") |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3382 ["Directory" pr-txt-directory t] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3383 ["Buffer" pr-txt-buffer t] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3384 ["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
|
3385 ["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
|
3386 ["Text Printers" pr-update-menus |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3387 :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
|
3388 ,@(funcall |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3389 pr-:help "Select text printer")] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3390 "--" |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3391 ["Landscape" pr-toggle-landscape-menu |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3392 :style toggle :selected ps-landscape-mode |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3393 :included (pr-visible-p 'postscript-options)] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3394 ["Print Header" pr-toggle-header-menu |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3395 :style toggle :selected ps-print-header |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3396 :included (pr-visible-p 'postscript-options)] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3397 ["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
|
3398 :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
|
3399 :included (pr-visible-p 'postscript-options)] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3400 ["Line Number" pr-toggle-line-menu |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3401 :style toggle :selected ps-line-number |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3402 :included (pr-visible-p 'postscript-options)] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3403 ["Zebra Stripes" pr-toggle-zebra-menu |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3404 :style toggle :selected ps-zebra-stripes |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3405 :included (pr-visible-p 'postscript-options)] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3406 ["Duplex" pr-toggle-duplex-menu |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3407 :style toggle :selected ps-spool-duplex |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3408 :included (pr-visible-p 'postscript-options)] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3409 ["Tumble" pr-toggle-tumble-menu |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3410 :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
|
3411 :included (pr-visible-p 'postscript-options)] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3412 ["Upside-Down" pr-toggle-upside-down-menu |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3413 :style toggle :selected ps-print-upside-down |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3414 :included (pr-visible-p 'postscript-options)] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3415 ("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
|
3416 ,@(funcall |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3417 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
|
3418 ["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
|
3419 :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
|
3420 ["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
|
3421 :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
|
3422 ["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
|
3423 :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
|
3424 ["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
|
3425 :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
|
3426 ["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
|
3427 :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
|
3428 "--" |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3429 ["Spool Buffer" pr-toggle-spool-menu |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3430 :style toggle :selected pr-spool-p |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3431 :included (pr-visible-p 'postscript-process) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3432 ,@(funcall |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3433 pr-:help "Toggle PostScript spooling")] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3434 ["Print with faces" pr-toggle-faces-menu |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3435 :style toggle :selected pr-faces-p |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3436 :included (pr-visible-p 'postscript-process) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3437 ,@(funcall |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3438 pr-:help "Toggle PostScript printing with faces")] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3439 ["Print via Ghostscript" pr-toggle-ghostscript-menu |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3440 :style toggle :selected pr-print-using-ghostscript |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3441 :included (pr-visible-p 'postscript-process) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3442 ,@(funcall |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3443 pr-:help "Toggle PostScript generation using ghostscript")] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3444 "--" |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3445 ["Auto Region" pr-toggle-region-menu |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3446 :style toggle :selected pr-auto-region |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3447 :included (pr-visible-p 'printing)] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3448 ["Auto Mode" pr-toggle-mode-menu |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3449 :style toggle :selected pr-auto-mode |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3450 :included (pr-visible-p 'printing)] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3451 ["Menu Lock" pr-toggle-lock-menu |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3452 :style toggle :selected pr-menu-lock |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3453 :included (pr-visible-p 'printing)] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3454 "--" |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3455 ("Customize" :included (pr-visible-p 'help) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3456 ["printing" pr-customize t] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3457 ["ps-print" ps-print-customize t] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3458 ["lpr" lpr-customize t]) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3459 ("Show Settings" :included (pr-visible-p 'help) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3460 ["printing" pr-show-pr-setup t] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3461 ["ps-print" pr-show-ps-setup t] |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3462 ["lpr" pr-show-lpr-setup t]) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3463 ["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
|
3464 ))) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3465 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3466 |
63328
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
3467 (defun pr-menu-bind () |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
3468 "Install `printing' menu in the menubar. |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
3469 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
3470 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
|
3471 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
3472 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
|
3473 menu. |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
3474 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
3475 Calls `pr-update-menus' to adjust menus." |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
3476 (interactive) |
80951 | 3477 (pr-global-menubar pr-menu-spec) |
63328
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
3478 (pr-update-menus t)) |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3479 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3480 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3481 ;; Key binding |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3482 (let ((pr-print-key (if (featurep 'xemacs) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3483 'f22 ; XEmacs |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3484 'print))) ; GNU Emacs |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3485 (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
|
3486 ;; 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
|
3487 ;; 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
|
3488 (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
|
3489 (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
|
3490 ;; 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
|
3491 ;; 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
|
3492 (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
|
3493 (global-set-key `[(control meta ,pr-print-key)] 'pr-txt-fast-fire)) |
49646 | 3494 |
3495 | |
3496 ;;; You can also use something like: | |
3497 ;;;(global-set-key "\C-ci" 'pr-interface) | |
3498 ;;;(global-set-key "\C-cbp" 'pr-ps-buffer-print) | |
3499 ;;;(global-set-key "\C-cbx" 'pr-ps-buffer-preview) | |
3500 ;;;(global-set-key "\C-cbb" 'pr-ps-buffer-using-ghostscript) | |
3501 ;;;(global-set-key "\C-crp" 'pr-ps-region-print) | |
3502 ;;;(global-set-key "\C-crx" 'pr-ps-region-preview) | |
3503 ;;;(global-set-key "\C-crr" 'pr-ps-region-using-ghostscript) | |
3504 | |
3505 | |
3506 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
3507 ;; Help Message | |
3508 | |
3509 | |
3510 (defconst pr-help-message | |
3511 (concat "printing.el version " pr-version | |
3512 " ps-print.el version " ps-print-version | |
3513 "\n\n | |
3514 Menu Layout | |
3515 ----------- | |
3516 | |
3517 The `printing' menu (Tools/Printing or File/Print) has the following layout: | |
3518 | |
3519 +-----------------------------+ | |
3520 A 0 | Printing Interface | | |
3521 +-----------------------------+ +-A---------+ +-B------+ | |
3522 I 1 | PostScript Preview >|-------|Directory >|-----|1-up | | |
3523 2 | PostScript Print >|---- A |Buffer >|-- B |2-up | | |
3524 3 | PostScript Printer: name >|---- C |Region >|-- B |4-up | | |
3525 +-----------------------------+ |Mode >|-- B |Other...| | |
3526 II 4 | Printify >|-----\\ |File >|--\\ +--------+ | |
3527 5 | Print >|---\\ | |Despool... | | | |
3528 6 | Text Printer: name >|-\\ | | +-----------+ | | |
3529 +-----------------------------+ | | | +---------+ +------------+ | |
54210
602769168263
Replace "As Is..." in PostScript file print/preview by "No Preprocessing...".
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54209
diff
changeset
|
3530 III 7 |[ ]Landscape | | | \\-|Directory| | No Prep... | Ia |
49646 | 3531 8 |[ ]Print Header | | | |Buffer | +------------+ Ib |
3532 9 |[ ]Print Header Frame | | | |Region | | name >|- C | |
3533 10 |[ ]Line Number | | | +---------+ +------------+ | |
3534 11 |[ ]Zebra Stripes | | | +---------+ | 1-up... | Ic | |
3535 12 |[ ]Duplex | | \\---|Directory| | 2-up... | | |
3536 13 |[ ]Tumble | \\--\\ |Buffer | | 4-up... | | |
3537 14 |[ ]Upside-Down | | |Region | | Other... | | |
3538 15 | Print All Pages >|--\\ | |Mode | +------------+ | |
3539 +-----------------------------+ | | +---------+ |[ ]Landscape| Id | |
3540 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
|
3541 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
|
3542 18 |[ ]Print via Ghostscript | | |( )name B| +------------+ |
49646 | 3543 +-----------------------------+ | |... | |
3544 V 19 |[ ]Auto Region | | |(*)name | | |
3545 20 |[ ]Auto Mode | | |... | | |
3546 21 |[ ]Menu Lock | | +---------+ +--------------+ | |
3547 +-----------------------------+ \\------------------|(*)All Pages | | |
3548 VI 22 | Customize >|--- D +-D------+ |( )Even Pages | | |
3549 23 | Show Settings >|-------|printing| |( )Odd Pages | | |
3550 24 | Help | |ps-print| |( )Even Sheets| | |
3551 +-----------------------------+ |lpr | |( )Odd Sheets | | |
3552 +--------+ +--------------+ | |
3553 | |
3554 See `pr-visible-entry-list' for hiding some parts of the menu. | |
3555 | |
3556 The menu has the following sections: | |
3557 | |
3558 A. Interface: | |
3559 | |
3560 0. You can use a buffer interface instead of menus. It looks like the | |
3561 customization buffer. Basically, it has the same options found in the | |
3562 menu and some extra options, all this on a buffer. | |
3563 | |
3564 I. PostScript printing: | |
3565 | |
3566 1. You can generate a PostScript file (if you type C-u before activating | |
3567 menu) or PostScript temporary file for a directory, a buffer, a region | |
3568 or a major mode, choosing 1-up, 2-up, 4-up or any other n-up printing; | |
3569 after file generation, ghostview is activated using the file generated | |
3570 as argument. This option is disabled if spooling is on (option 16). | |
3571 Also, if you already have a PostScript file you can preview it. | |
3572 Instead of previewing each buffer, region or major mode at once, you | |
3573 can save temporarily the PostScript code generated in a buffer and | |
3574 preview it later. The option `Despool...' despools the PostScript | |
3575 spooling buffer in a temporary file and uses ghostview to preview it. | |
3576 If you type C-u before choosing this option, the PostScript code | |
3577 generated is saved in a file instead of saving in a temporary file. To | |
3578 spool the PostScript code generated you need to turn on the option 16. | |
3579 The option `Despool...' is enabled if spooling is on (option 16). | |
3580 | |
3581 NOTE 1: It's possible to customize a major mode printing, just declare | |
3582 the customization in `pr-mode-alist' and invoke some of | |
3583 `*-mode*' commands or select Mode option in Printing menu. An | |
3584 example for major mode usage is when you're using gnus (or mh, | |
3585 or rmail, etc.) and you're in the *Summary* buffer, if you | |
3586 forget to switch to the *Article* buffer before printing, | |
3587 you'll get a nicely formatted list of article subjects shows | |
3588 up at the printer. With major mode printing you don't need to | |
3589 switch from gnus *Summary* buffer first. | |
3590 | |
3591 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
|
3592 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
|
3593 directly to PostScript printer. |
49646 | 3594 Ib. PostScript utility processing selection. |
3595 See `pr-ps-utility-alist' and `pr-setting-database' for | |
3596 documentation. | |
3597 Ic. Do n-up processing before printing. | |
3598 Id. Toggle on/off landscape for PostScript file processing. | |
3599 Ie. Toggle on/off duplex for PostScript file processing. | |
3600 If. Toggle on/off tumble for PostScript file processing. | |
3601 | |
3602 NOTE 3: Don't forget to download and install the utilities declared on | |
3603 `pr-ps-utility-alist'. | |
3604 | |
3605 2. Operate the same way as option 1, but it sends directly the PostScript | |
3606 code (or put in a file, if you've typed C-u) or it uses ghostscript to | |
3607 print the PostScript file generated. It depends on option 18, if it's | |
3608 turned on, it uses ghostscript; otherwise, it sends directly to | |
3609 printer. If spooling is on (option 16), the PostScript code is saved | |
3610 temporarily in a buffer instead of printing it or saving it in a file. | |
3611 Also, if you already have a PostScript file you can print it. | |
3612 Instead of printing each buffer, region or major mode at once, you can | |
3613 save temporarily the PostScript code generated in a buffer and print it | |
3614 later. The option `Despool...' despools the PostScript spooling buffer | |
3615 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
|
3616 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
|
3617 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
|
3618 option 16. This option is enabled if spooling is on (option 16). |
49646 | 3619 See also the NOTE 1, NOTE 2 and NOTE 3 on option 1. |
3620 | |
3621 3. You can select a new PostScript printer to send PostScript code | |
3622 generated. For selection it's used all PostScript printers defined | |
3623 in `pr-ps-printer-alist' variable (see it for documentation). | |
3624 See also `pr-setting-database'. | |
3625 | |
3626 II. Text printing: | |
3627 | |
3628 4. If you have control characters (character code from \\000 to \\037) in a | |
3629 buffer and you want to print them in a text printer, select this | |
3630 option. All control characters in your buffer or region will be | |
3631 replaced by a printable representation. The printable representations | |
3632 use ^ (for ASCII control characters) or hex. The characters tab, | |
3633 linefeed, space, return and formfeed are not affected. | |
3634 You don't need to select this option if you use any option of section | |
3635 I, the PostScript engine treats control characters properly. | |
3636 | |
3637 5. If you want to print a directory, buffer, region or major mode in a | |
3638 text printer, select this option. See also the NOTE 1 on option 1. | |
3639 | |
3640 6. You can select a new text printer to send text generated. For | |
3641 selection it's used all text printers defined in `pr-txt-printer-alist' | |
3642 variable (see it for documentation). | |
3643 See also `pr-setting-database'. | |
3644 | |
3645 III. PostScript page toggle options: | |
3646 | |
3647 7. If you want a PostScript landscape printing, turn on this option. | |
3648 | |
3649 8. If you want to have a header in each page in your PostScript code, | |
3650 turn on this option. | |
3651 | |
3652 9. If you want to draw a gaudy frame around the header, turn on this | |
3653 option. This option is enabled if print header is on (option 8). | |
3654 | |
3655 10. If you want that the line number is printed in your PostScript code, | |
3656 turn on this option. | |
3657 | |
3658 11. If you want background zebra stripes in your PostScript code, turn on | |
3659 this option. | |
3660 | |
3661 12. If you want a duplex printing and your PostScript printer has this | |
3662 feature, turn on this option. | |
3663 | |
3664 13. If you turned on duplex printing, you can choose if you want to have a | |
3665 printing suitable for binding on the left or right (tumble off), or to | |
3666 have a printing suitable for binding at top or bottom (tumble on). | |
3667 This option is enabled if duplex is on (option 12). | |
3668 | |
3669 14. If you want a PostScript upside-down printing, turn on this option. | |
3670 | |
3671 15. With this option, you can choose if you want to print all pages, odd | |
3672 pages, even pages, odd sheets or even sheets. | |
3673 See also `ps-even-or-odd-pages'. | |
3674 | |
3675 IV. PostScript processing toggle options: | |
3676 | |
3677 16. If you want to spool the PostScript code generated, turn on this | |
3678 option. To spool the PostScript code generated use option 2. You can | |
3679 despool later by choosing option 1 or 2, sub-option `Despool...'. | |
3680 | |
3681 17. If you use colors in your buffers and want to see these colors on your | |
3682 PostScript code generated, turn on this option. If you have a | |
3683 black/white PostScript printer, these colors are displayed in gray | |
3684 scale by PostScript printer interpreter. | |
3685 | |
3686 18. If you don't have a PostScript printer to send PostScript files, turn | |
3687 on this option. When this option is on, the ghostscript is used to | |
3688 print PostScript files. In GNU or Unix system, if ghostscript is set | |
3689 as a PostScript filter, you don't need to turn on this option. | |
3690 | |
3691 V. Printing customization: | |
3692 | |
3693 19. If you want that region is automagically detected, turn on this | |
3694 option. Note that this will only work if you're using transient mark | |
3695 mode. When this option is on, the `*-buffer*' commands will behave | |
3696 like `*-region*' commands, that is, `*-buffer*' commands will print | |
3697 only the region marked instead of all buffer. | |
3698 | |
3699 20. Turn this option on if you want that when current major-mode is | |
3700 declared in `pr-mode-alist', the `*-buffer*' and `*-region*' commands | |
3701 behave like `*-mode*' commands. | |
3702 | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
3703 21. If you want that Printing menu stays open while you are setting |
49646 | 3704 toggle options, turn on this option. The variables |
3705 `pr-menu-char-height' and `pr-menu-char-width' are used to guess the | |
3706 menu position, so don't forget to adjust these variables if menu | |
3707 position is not ok. | |
3708 | |
3709 VI. Customization: | |
3710 | |
3711 22. Besides all options in section III, IV and V, you can customize much | |
3712 more PostScript options in `ps-print' option. Or you can customize | |
3713 some `lpr' options for text printing. Or customize `printing' | |
3714 options. | |
3715 | |
3716 23. Show current settings for `printing', `ps-print' or `lpr'. | |
3717 | |
3718 24. Quick help for printing menu layout. | |
3719 ") | |
3720 "Printing help message.") | |
3721 | |
3722 | |
3723 (defconst pr-interface-help-message | |
3724 (concat "printing.el version " pr-version | |
3725 " ps-print.el version " ps-print-version | |
3726 "\n\n | |
3727 The printing interface buffer has the same functionality as the printing menu. | |
3728 The major difference is that the states (like sending PostScript generated to a | |
3729 file, n-up printing, etc.) are set and saved between priting buffer | |
3730 activation. Also, the landscape, duplex and tumble values are the same for | |
3731 PostScript file and directory/buffer/region/mode processing; using menu, there | |
3732 are different value sets for PostScript file and directory/buffer/region/mode | |
3733 processing. | |
3734 | |
3735 The printing interface buffer has the following sections: | |
3736 | |
3737 1. Print: | |
3738 | |
3739 Here you can choose to print/preview a buffer, a directory or a PostScript | |
3740 file: | |
3741 | |
3742 1a. Buffer: | |
3743 | |
3744 * Buffer List: | |
3745 Select a buffer from the current buffer list. | |
3746 | |
3747 * Region: | |
3748 If it's on, this means that the selected buffer has an active region, | |
3749 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 has no active region, so it'll not be possible to turn it on. | |
3752 If you want to process the region, let this option on. | |
3753 If you want to process the whole buffer, let this option off. | |
3754 | |
3755 * Mode: | |
3756 If it's on, this means that the selected buffer major mode is declared | |
3757 for major mode processing, so you can turn on/off, as you wish. | |
3758 If it's off when a buffer is selected, this means that the selected | |
3759 buffer major mode isn't declared for major mode processing, so it'll | |
3760 not be possible to turn it on. | |
3761 If you want the major mode processing, let this option on. | |
3762 If you don't want the major mode processing, let this option off. | |
3763 | |
3764 NOTE 1: It's possible to customize a major mode printing, just declare | |
3765 the customization in `pr-mode-alist' and invoke some of | |
3766 `*-mode*' commands or select Mode option in Printing menu. An | |
3767 example for major mode usage is when you're using gnus (or mh, | |
3768 or rmail, etc.) and you're in the *Summary* buffer, if you | |
3769 forget to switch to the *Article* buffer before printing, | |
3770 you'll get a nicely formatted list of article subjects shows | |
3771 up at the printer. With major mode printing you don't need to | |
3772 switch from gnus *Summary* buffer first. | |
3773 | |
3774 1b. Directory: | |
3775 | |
3776 * Directory: | |
3777 Specify a valid directory path. | |
3778 | |
3779 * File Regexp: | |
3780 Specify a file name regexp. All file names in the directory that | |
3781 match with regexp will be printed/previewed. An empty file name | |
3782 regexp means to print/preview all files in the directory. | |
3783 | |
3784 * List Directory Entry: | |
3785 If it's turned on, list directory entries besides file entries. | |
3786 | |
3787 1c. PostScript file: | |
3788 | |
3789 * PostScript File: | |
3790 Specify an existent PostScript file to print/preview. | |
3791 | |
3792 * PostScript Utility: | |
3793 Select a PostScript utility. | |
3794 See `pr-ps-utility-alist' and `pr-setting-database' for documentation. | |
3795 | |
3796 NOTE 2: Don't forget to download and install the utilities declared on | |
3797 `pr-ps-utility-alist'. | |
3798 | |
54210
602769168263
Replace "As Is..." in PostScript file print/preview by "No Preprocessing...".
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54209
diff
changeset
|
3799 * No Preprocessing: |
49646 | 3800 If it's turned on, don't use the PostScript utility to preprocess the |
3801 PostScript file before printing/previewing. | |
3802 | |
3803 2. PostScript printer: | |
3804 | |
3805 * PostScript Printer: | |
3806 You can select a new PostScript printer to send PostScript code | |
3807 generated. For selection it's used all PostScript printers defined | |
3808 in `pr-ps-printer-alist' variable (see it for documentation). | |
3809 See also `pr-setting-database'. | |
3810 | |
3811 * Despool: | |
3812 If spooling is on, you can turn it on/off, as you wish. | |
3813 If spooling is off, it'll not be possible to turn it on. | |
3814 If it's turned on, specify to despools the PostScript spooling buffer in | |
3815 a temporary file or in the selected PostScript file when | |
3816 printing/previewing. | |
3817 | |
3818 * Preview: | |
3819 Preview the PostScript generated. | |
3820 | |
3821 * Print: | |
3822 Print the PostScript generated. | |
3823 | |
3824 * Quit: | |
3825 Quit from printing interface buffer. | |
3826 | |
3827 * Send to Printer/Temporary File: | |
3828 If it's turned on, the PostScript generated is sent directly to | |
3829 PostScript printer or, for previewing, to a temporary file. | |
3830 | |
3831 * Send to File: | |
3832 Specify a file name to send the PostScript generated. | |
3833 | |
3834 * N-Up: | |
3835 Specify n-up printing. | |
3836 | |
3837 3. Text printer: | |
3838 | |
3839 * Text Printer: | |
3840 Select a new text printer to send text generated. For selection it's used | |
3841 all text printers defined in `pr-txt-printer-alist' variable (see it for | |
3842 documentation). See also `pr-setting-database'. | |
3843 | |
3844 * Printify: | |
3845 If you have control characters (character code from \\000 to \\037) in a | |
3846 buffer and you want to print them in a text printer, select this | |
3847 option. All control characters in your buffer or region will be | |
3848 replaced by a printable representation. The printable representations | |
3849 use ^ (for ASCII control characters) or hex. The characters tab, | |
3850 linefeed, space, return and formfeed are not affected. | |
3851 You don't need to select this option if you use any option of section | |
3852 I, the PostScript engine treats control characters properly. | |
3853 | |
3854 * Print: | |
3855 To print a directory, buffer, region or major mode in a | |
3856 text printer, select this option. See also the NOTE 1 on section 1. | |
3857 | |
3858 * Quit: | |
3859 Quit from printing interface buffer. | |
3860 | |
3861 4. Settings: | |
3862 | |
3863 There are 3 setting columns: | |
3864 | |
3865 4a. First column (left column): | |
3866 | |
3867 * Landscape: | |
3868 PostScript landscape printing. | |
3869 | |
3870 * Print Header: | |
3871 To have a header in each page in your PostScript code. | |
3872 | |
3873 * Print Header Frame: | |
3874 To draw a gaudy frame around the header. | |
3875 | |
3876 * Line Number: | |
3877 The line number is printed in your PostScript code. | |
3878 | |
3879 * Zebra Stripes: | |
3880 Background zebra stripes in your PostScript code. | |
3881 | |
3882 * Duplex: | |
3883 Duplex printing (if your PostScript printer has this feature). | |
3884 | |
3885 * Tumble: | |
3886 If duplex printing is on, you can choose if you want to have a | |
3887 printing suitable for binding on the left or right (tumble off), or to | |
3888 have a printing suitable for binding at top or bottom (tumble on). | |
3889 | |
3890 * Upside-Down: | |
3891 PostScript upside-down printing. | |
3892 | |
3893 4b. Second column (middle column): | |
3894 | |
3895 * Auto Region: | |
3896 If you want that region is automagically detected, turn on this | |
3897 option. Note that this will only work if you're using transient mark | |
3898 mode. When this option is on, the `*-buffer*' commands will behave | |
3899 like `*-region*' commands, that is, `*-buffer*' commands will print | |
3900 only the region marked instead of all buffer. | |
3901 | |
3902 * Auto Mode: | |
3903 Turn this option on if you want that when current major-mode is | |
3904 declared in `pr-mode-alist', the `*-buffer*' and `*-region*' commands | |
3905 behave like `*-mode*' commands. | |
3906 | |
3907 * Menu Lock: | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
3908 If you want that Printing menu stays open while you are setting |
49646 | 3909 toggle options, turn on this option. The variables |
3910 `pr-menu-char-height' and `pr-menu-char-width' are used to guess the | |
3911 menu position, so don't forget to adjust these variables if menu | |
3912 position is not ok. | |
3913 | |
3914 * Spool Buffer: | |
3915 To spool the PostScript code generated. You can despool later by | |
3916 setting Despool option on PostScript printer section. | |
3917 | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
3918 * Print with faces: |
49646 | 3919 If you use colors in your buffers and want to see these colors on your |
3920 PostScript code generated, turn on this option. If you have a | |
3921 black/white PostScript printer, these colors are displayed in gray | |
3922 scale by PostScript printer interpreter. | |
3923 | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
3924 * Print via Ghostscript: |
49646 | 3925 If you don't have a PostScript printer to send PostScript files, turn |
3926 on this option. When this option is on, the ghostscript is used to | |
3927 print PostScript files. In GNU or Unix system, if ghostscript is set | |
3928 as a PostScript filter, you don't need to turn on this option. | |
3929 | |
3930 * Parity Page Menu: | |
3931 To print all pages, odd pages, even pages, odd sheets or even sheets. | |
3932 See also `ps-even-or-odd-pages'. | |
3933 | |
3934 4c. Third column (right column): | |
3935 | |
3936 * Verbose: | |
3937 That is, to be verbose when editing a field in interface buffer. | |
3938 | |
3939 5. Customize: | |
3940 | |
3941 Besides all options in section 4, you can customize much more PostScript | |
3942 options in `ps-print' option. Or you can customize some `lpr' options for | |
3943 text printing. Or customize `printing' options. | |
3944 | |
3945 6. Show settings: | |
3946 | |
3947 Show current settings for `printing', `ps-print' or `lpr'. | |
3948 | |
3949 7. Help: | |
3950 | |
3951 Quick help for printing interface buffer and printing menu layout. You can | |
3952 also quit the printing interface buffer or kill all printing help buffer. | |
3953 ") | |
3954 "Printing buffer interface help message.") | |
3955 | |
3956 | |
3957 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
3958 ;; Commands | |
3959 | |
3960 | |
3961 ;;;###autoload | |
3962 (defun pr-interface (&optional buffer) | |
3963 "Activate the printing interface buffer. | |
3964 | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
3965 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
|
3966 |
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
3967 For more information, type \\[pr-interface-help]." |
49646 | 3968 (interactive) |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3969 (save-excursion |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3970 (set-buffer (or buffer (current-buffer))) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3971 (pr-create-interface))) |
49646 | 3972 |
3973 | |
3974 ;;;###autoload | |
3975 (defun pr-ps-directory-preview (n-up dir file-regexp &optional filename) | |
3976 "Preview directory using ghostview. | |
3977 | |
3978 Interactively, the command prompts for N-UP printing number, a directory, a | |
3979 file name regexp for matching and, when you use a prefix argument (C-u), the | |
3980 command prompts the user for a file name, and saves the PostScript image in | |
3981 that file instead of saving it in a temporary file. | |
3982 | |
3983 Noninteractively, if N-UP is nil, prompts for N-UP printing number. If DIR is | |
3984 nil, prompts for DIRectory. If FILE-REGEXP is nil, prompts for | |
3985 FILE(name)-REGEXP. The argument FILENAME is treated as follows: if it's nil, | |
3986 save the image in a temporary file. If FILENAME is a string, save the | |
3987 PostScript image in a file with that name. If FILENAME is t, prompts for a | |
3988 file name. | |
3989 | |
3990 See also documentation for `pr-list-directory'." | |
3991 (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
|
3992 (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
|
3993 (pr-prompt "PS preview dir")) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3994 (setq filename (pr-ps-file filename)) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3995 (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
|
3996 (or pr-spool-p |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
3997 (pr-ps-file-preview filename))) |
49646 | 3998 |
3999 | |
4000 ;;;###autoload | |
4001 (defun pr-ps-directory-using-ghostscript (n-up dir file-regexp &optional filename) | |
4002 "Print directory using PostScript through ghostscript. | |
4003 | |
4004 Interactively, the command prompts for N-UP printing number, a directory, a | |
4005 file name regexp for matching and, when you use a prefix argument (C-u), the | |
4006 command prompts the user for a file name, and saves the PostScript image in | |
4007 that file instead of saving it in a temporary file. | |
4008 | |
4009 Noninteractively, if N-UP is nil, prompts for N-UP printing number. If DIR is | |
4010 nil, prompts for DIRectory. If FILE-REGEXP is nil, prompts for | |
4011 FILE(name)-REGEXP. The argument FILENAME is treated as follows: if it's nil, | |
4012 save the image in a temporary file. If FILENAME is a string, save the | |
4013 PostScript image in a file with that name. If FILENAME is t, prompts for a | |
4014 file name. | |
4015 | |
4016 See also documentation for `pr-list-directory'." | |
4017 (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
|
4018 (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
|
4019 (pr-prompt "PS print dir GS")) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4020 (let ((file (pr-ps-file filename))) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4021 (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
|
4022 (pr-ps-file-using-ghostscript file) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4023 (or filename (pr-delete-file file)))) |
49646 | 4024 |
4025 | |
4026 ;;;###autoload | |
4027 (defun pr-ps-directory-print (n-up dir file-regexp &optional filename) | |
4028 "Print directory using PostScript printer. | |
4029 | |
4030 Interactively, the command prompts for N-UP printing number, a directory, a | |
4031 file name regexp for matching and, when you use a prefix argument (C-u), the | |
4032 command prompts the user for a file name, and saves the PostScript image in | |
4033 that file instead of saving it in a temporary file. | |
4034 | |
4035 Noninteractively, if N-UP is nil, prompts for N-UP printing number. If DIR is | |
4036 nil, prompts for DIRectory. If FILE-REGEXP is nil, prompts for | |
4037 FILE(name)-REGEXP. The argument FILENAME is treated as follows: if it's nil, | |
4038 save the image in a temporary file. If FILENAME is a string, save the | |
4039 PostScript image in a file with that name. If FILENAME is t, prompts for a | |
4040 file name. | |
4041 | |
4042 See also documentation for `pr-list-directory'." | |
4043 (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
|
4044 (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
|
4045 (pr-prompt "PS print dir")) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4046 (let ((file (pr-ps-file filename))) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4047 (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
|
4048 (pr-ps-file-print file) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4049 (or filename (pr-delete-file file)))) |
49646 | 4050 |
4051 | |
4052 ;;;###autoload | |
4053 (defun pr-ps-directory-ps-print (n-up dir file-regexp &optional filename) | |
4054 "Print directory using PostScript printer or through ghostscript. | |
4055 | |
4056 It depends on `pr-print-using-ghostscript'. | |
4057 | |
4058 Interactively, the command prompts for N-UP printing number, a directory, a | |
4059 file name regexp for matching and, when you use a prefix argument (C-u), the | |
4060 command prompts the user for a file name, and saves the PostScript image in | |
4061 that file instead of saving it in a temporary file. | |
4062 | |
4063 Noninteractively, if N-UP is nil, prompts for N-UP printing number. If DIR is | |
4064 nil, prompts for DIRectory. If FILE-REGEXP is nil, prompts for | |
4065 FILE(name)-REGEXP. The argument FILENAME is treated as follows: if it's nil, | |
4066 save the image in a temporary file. If FILENAME is a string, save the | |
4067 PostScript image in a file with that name. If FILENAME is t, prompts for a | |
4068 file name. | |
4069 | |
4070 See also documentation for `pr-list-directory'." | |
4071 (interactive (pr-interactive-ps-dir-args | |
4072 (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
|
4073 (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
|
4074 (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
|
4075 (if (pr-using-ghostscript-p) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4076 (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
|
4077 (pr-ps-directory-print n-up dir file-regexp filename))) |
49646 | 4078 |
4079 | |
4080 ;;;###autoload | |
4081 (defun pr-ps-buffer-preview (n-up &optional filename) | |
4082 "Preview buffer using ghostview. | |
4083 | |
4084 Interactively, the command prompts for N-UP printing number and, when you use a | |
4085 prefix argument (C-u), the command prompts the user for a file name, and saves | |
4086 the PostScript image in that file instead of saving it in a temporary file. | |
4087 | |
4088 Noninteractively, if N-UP is nil, prompts for N-UP printing number. The | |
4089 argument FILENAME is treated as follows: if it's nil, save the image in a | |
4090 temporary file. If FILENAME is a string, save the PostScript image in a file | |
4091 with that name. If FILENAME is t, prompts for a file name." | |
4092 (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
|
4093 (if (pr-auto-mode-p) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4094 (pr-ps-mode-preview n-up filename) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4095 (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
|
4096 (pr-region-active-string "PS preview")))) |
49646 | 4097 |
4098 | |
4099 ;;;###autoload | |
4100 (defun pr-ps-buffer-using-ghostscript (n-up &optional filename) | |
4101 "Print buffer using PostScript through ghostscript. | |
4102 | |
4103 Interactively, the command prompts for N-UP printing number and, when you use a | |
4104 prefix argument (C-u), the command prompts the user for a file name, and saves | |
4105 the PostScript image in that file instead of sending it to the printer. | |
4106 | |
4107 Noninteractively, if N-UP is nil, prompts for N-UP printing number. The | |
4108 argument FILENAME is treated as follows: if it's nil, send the image to the | |
4109 printer. If FILENAME is a string, save the PostScript image in a file with | |
4110 that name. If FILENAME is t, prompts for a file name." | |
4111 (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
|
4112 (if (pr-auto-mode-p) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4113 (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
|
4114 (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
|
4115 (pr-region-active-string "PS print GS")))) |
49646 | 4116 |
4117 | |
4118 ;;;###autoload | |
4119 (defun pr-ps-buffer-print (n-up &optional filename) | |
4120 "Print buffer using PostScript printer. | |
4121 | |
4122 Interactively, the command prompts for N-UP printing number and, when you use a | |
4123 prefix argument (C-u), the command prompts the user for a file name, and saves | |
4124 the PostScript image in that file instead of sending it to the printer. | |
4125 | |
4126 Noninteractively, if N-UP is nil, prompts for N-UP printing number. The | |
4127 argument FILENAME is treated as follows: if it's nil, send the image to the | |
4128 printer. If FILENAME is a string, save the PostScript image in a file with | |
4129 that name. If FILENAME is t, prompts for a file name." | |
4130 (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
|
4131 (if (pr-auto-mode-p) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4132 (pr-ps-mode-print n-up filename) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4133 (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
|
4134 (pr-region-active-string "PS print")))) |
49646 | 4135 |
4136 | |
4137 ;;;###autoload | |
4138 (defun pr-ps-buffer-ps-print (n-up &optional filename) | |
4139 "Print buffer using PostScript printer or through ghostscript. | |
4140 | |
4141 It depends on `pr-print-using-ghostscript'. | |
4142 | |
4143 Interactively, the command prompts for N-UP printing number and, when you use a | |
4144 prefix argument (C-u), the command prompts the user for a file name, and saves | |
4145 the PostScript image in that file instead of sending it to the printer. | |
4146 | |
4147 Noninteractively, if N-UP is nil, prompts for N-UP printing number. The | |
4148 argument FILENAME is treated as follows: if it's nil, send the image to the | |
4149 printer. If FILENAME is a string, save the PostScript image in a file with | |
4150 that name. If FILENAME is t, prompts for a file name." | |
4151 (interactive (pr-interactive-n-up-file | |
4152 (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
|
4153 (cond ((pr-auto-mode-p) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4154 (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
|
4155 ((pr-using-ghostscript-p) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4156 (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
|
4157 (pr-region-active-string "PS print GS"))) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4158 (t |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4159 (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
|
4160 (pr-region-active-string "PS print"))))) |
49646 | 4161 |
4162 | |
4163 ;;;###autoload | |
4164 (defun pr-ps-region-preview (n-up &optional filename) | |
4165 "Preview region using ghostview. | |
4166 | |
4167 See also `pr-ps-buffer-preview'." | |
4168 (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
|
4169 (if (pr-auto-mode-p) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4170 (let ((pr-auto-region t)) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4171 (pr-ps-mode-preview n-up filename)) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4172 (pr-ps-preview 'region n-up filename "PS preview region"))) |
49646 | 4173 |
4174 | |
4175 ;;;###autoload | |
4176 (defun pr-ps-region-using-ghostscript (n-up &optional filename) | |
4177 "Print region using PostScript through ghostscript. | |
4178 | |
4179 See also `pr-ps-buffer-using-ghostscript'." | |
4180 (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
|
4181 (if (pr-auto-mode-p) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4182 (let ((pr-auto-region t)) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4183 (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
|
4184 (pr-ps-using-ghostscript 'region n-up filename "PS print GS region"))) |
49646 | 4185 |
4186 | |
4187 ;;;###autoload | |
4188 (defun pr-ps-region-print (n-up &optional filename) | |
4189 "Print region using PostScript printer. | |
4190 | |
4191 See also `pr-ps-buffer-print'." | |
4192 (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
|
4193 (if (pr-auto-mode-p) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4194 (let ((pr-auto-region t)) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4195 (pr-ps-mode-print n-up filename)) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4196 (pr-ps-print 'region n-up filename "PS print region"))) |
49646 | 4197 |
4198 | |
4199 ;;;###autoload | |
4200 (defun pr-ps-region-ps-print (n-up &optional filename) | |
4201 "Print region using PostScript printer or through ghostscript. | |
4202 | |
4203 See also `pr-ps-buffer-ps-print'." | |
4204 (interactive (pr-interactive-n-up-file | |
4205 (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
|
4206 (cond ((pr-auto-mode-p) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4207 (let ((pr-auto-region t)) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4208 (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
|
4209 ((pr-using-ghostscript-p) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4210 (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
|
4211 (t |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4212 (pr-ps-print 'region n-up filename "PS print region")))) |
49646 | 4213 |
4214 | |
4215 ;;;###autoload | |
4216 (defun pr-ps-mode-preview (n-up &optional filename) | |
4217 "Preview major mode using ghostview. | |
4218 | |
4219 See also `pr-ps-buffer-preview'." | |
4220 (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
|
4221 (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
|
4222 (let ((file (pr-ps-file filename))) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4223 (and (pr-ps-mode n-up file) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4224 (not pr-spool-p) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4225 (pr-ps-file-preview file)))) |
49646 | 4226 |
4227 | |
4228 ;;;###autoload | |
4229 (defun pr-ps-mode-using-ghostscript (n-up &optional filename) | |
4230 "Print major mode using PostScript through ghostscript. | |
4231 | |
4232 See also `pr-ps-buffer-using-ghostscript'." | |
4233 (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
|
4234 (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
|
4235 (let ((file (pr-ps-file filename))) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4236 (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
|
4237 (not pr-spool-p)) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4238 (pr-ps-file-using-ghostscript file) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4239 (or filename (pr-delete-file file))))) |
49646 | 4240 |
4241 | |
4242 ;;;###autoload | |
4243 (defun pr-ps-mode-print (n-up &optional filename) | |
4244 "Print major mode using PostScript printer. | |
4245 | |
4246 See also `pr-ps-buffer-print'." | |
4247 (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
|
4248 (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
|
4249 (pr-ps-mode n-up filename)) |
49646 | 4250 |
4251 | |
4252 ;;;###autoload | |
4253 (defun pr-ps-mode-ps-print (n-up &optional filename) | |
4254 "Print major mode using PostScript or through ghostscript. | |
4255 | |
4256 See also `pr-ps-buffer-ps-print'." | |
4257 (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
|
4258 (if (pr-using-ghostscript-p) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4259 (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
|
4260 (pr-ps-mode-print n-up filename))) |
49646 | 4261 |
4262 | |
4263 ;;;###autoload | |
4264 (defun pr-printify-directory (&optional dir file-regexp) | |
4265 "Replace nonprinting characters in directory with printable representations. | |
4266 The printable representations use ^ (for ASCII control characters) or hex. | |
4267 The characters tab, linefeed, space, return and formfeed are not affected. | |
4268 | |
4269 Interactively, the command prompts for a directory and a file name regexp for | |
4270 matching. | |
4271 | |
4272 Noninteractively, if DIR is nil, prompts for DIRectory. If FILE-REGEXP is nil, | |
4273 prompts for FILE(name)-REGEXP. | |
4274 | |
4275 See also documentation for `pr-list-directory'." | |
4276 (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
|
4277 (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
|
4278 (pr-file-list dir file-regexp 'pr-printify-buffer)) |
49646 | 4279 |
4280 | |
4281 ;;;###autoload | |
4282 (defun pr-printify-buffer () | |
4283 "Replace nonprinting characters in buffer with printable representations. | |
4284 The printable representations use ^ (for ASCII control characters) or hex. | |
4285 The characters tab, linefeed, space, return and formfeed are not affected." | |
4286 (interactive "*") | |
4287 (if (pr-region-active-p) | |
4288 (pr-printify-region) | |
4289 (printify-region (point-min) (point-max)))) | |
4290 | |
4291 | |
4292 ;;;###autoload | |
4293 (defun pr-printify-region () | |
4294 "Replace nonprinting characters in region with printable representations. | |
4295 The printable representations use ^ (for ASCII control characters) or hex. | |
4296 The characters tab, linefeed, space, return and formfeed are not affected." | |
4297 (interactive "*") | |
4298 (printify-region (point) (mark))) | |
4299 | |
4300 | |
4301 ;;;###autoload | |
4302 (defun pr-txt-directory (&optional dir file-regexp) | |
4303 "Print directory using text printer. | |
4304 | |
4305 Interactively, the command prompts for a directory and a file name regexp for | |
4306 matching. | |
4307 | |
4308 Noninteractively, if DIR is nil, prompts for DIRectory. If FILE-REGEXP is nil, | |
4309 prompts for FILE(name)-REGEXP. | |
4310 | |
4311 See also documentation for `pr-list-directory'." | |
4312 (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
|
4313 (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
|
4314 (pr-file-list dir file-regexp 'pr-txt-buffer)) |
49646 | 4315 |
4316 | |
4317 ;;;###autoload | |
4318 (defun pr-txt-buffer () | |
4319 "Print buffer using text printer." | |
4320 (interactive) | |
4321 (cond ((pr-auto-mode-p) | |
4322 (pr-txt-mode)) | |
4323 ((pr-region-active-p) | |
4324 (pr-txt-region)) | |
4325 (t | |
4326 (pr-txt-print (point-min) (point-max))))) | |
4327 | |
4328 | |
4329 ;;;###autoload | |
4330 (defun pr-txt-region () | |
4331 "Print region using text printer." | |
4332 (interactive) | |
4333 (if (pr-auto-mode-p) | |
4334 (let ((pr-auto-region t)) | |
4335 (pr-txt-mode)) | |
4336 (pr-txt-print (point) (mark)))) | |
4337 | |
4338 | |
4339 ;;;###autoload | |
4340 (defun pr-txt-mode () | |
4341 "Print major mode using text printer." | |
4342 (interactive) | |
4343 (let ((args (pr-mode-alist-p))) | |
4344 (if args | |
4345 (funcall (car args) (nthcdr 2 args)) | |
4346 (ding) | |
4347 (message "`%s' major mode not declared." major-mode)))) | |
4348 | |
4349 | |
4350 ;;;###autoload | |
4351 (defun pr-despool-preview (&optional filename) | |
4352 "Preview spooled PostScript. | |
4353 | |
4354 Interactively, when you use a prefix argument (C-u), the command prompts the | |
4355 user for a file name, and saves the spooled PostScript image in that file | |
4356 instead of saving it in a temporary file. | |
4357 | |
4358 Noninteractively, the argument FILENAME is treated as follows: if it is nil, | |
4359 save the image in a temporary file. If FILENAME is a string, save the | |
4360 PostScript image in a file with that name." | |
4361 (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
|
4362 (let ((file (pr-ps-file filename))) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4363 (when (stringp file) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4364 (pr-despool-print file) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4365 (pr-ps-file-preview file)))) |
49646 | 4366 |
4367 | |
4368 ;;;###autoload | |
4369 (defun pr-despool-using-ghostscript (&optional filename) | |
4370 "Print spooled PostScript using ghostscript. | |
4371 | |
4372 Interactively, when you use a prefix argument (C-u), the command prompts the | |
4373 user for a file name, and saves the spooled PostScript image in that file | |
4374 instead of sending it to the printer. | |
4375 | |
4376 Noninteractively, the argument FILENAME is treated as follows: if it is nil, | |
4377 send the image to the printer. If FILENAME is a string, save the PostScript | |
4378 image in a file with that name." | |
4379 (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
|
4380 (let ((file (pr-ps-file filename))) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4381 (when (stringp file) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4382 (pr-despool-print file) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4383 (pr-ps-file-using-ghostscript file) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4384 (or filename (pr-delete-file file))))) |
49646 | 4385 |
4386 | |
4387 ;;;###autoload | |
4388 (defun pr-despool-print (&optional filename) | |
4389 "Send the spooled PostScript to the printer. | |
4390 | |
4391 Interactively, when you use a prefix argument (C-u), the command prompts the | |
4392 user for a file name, and saves the spooled PostScript image in that file | |
4393 instead of sending it to the printer. | |
4394 | |
4395 Noninteractively, the argument FILENAME is treated as follows: if it is nil, | |
4396 send the image to the printer. If FILENAME is a string, save the PostScript | |
4397 image in a file with that name." | |
4398 (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
|
4399 (pr-save-file-modes |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4400 (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
|
4401 (ps-lpr-switches pr-ps-switches) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4402 (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
|
4403 (ps-printer-name pr-ps-printer)) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4404 (ps-despool filename)))) |
49646 | 4405 |
4406 | |
4407 ;;;###autoload | |
4408 (defun pr-despool-ps-print (&optional filename) | |
4409 "Send the spooled PostScript to the printer or use ghostscript to print it. | |
4410 | |
4411 Interactively, when you use a prefix argument (C-u), the command prompts the | |
4412 user for a file name, and saves the spooled PostScript image in that file | |
4413 instead of sending it to the printer. | |
4414 | |
4415 Noninteractively, the argument FILENAME is treated as follows: if it is nil, | |
4416 send the image to the printer. If FILENAME is a string, save the PostScript | |
4417 image in a file with that name." | |
4418 (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
|
4419 (if pr-print-using-ghostscript |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4420 (pr-despool-using-ghostscript filename) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4421 (pr-despool-print filename))) |
49646 | 4422 |
4423 | |
4424 ;;;###autoload | |
4425 (defun pr-ps-file-preview (filename) | |
4426 "Preview PostScript file FILENAME." | |
4427 (interactive (list (pr-ps-infile-preprint "Preview "))) | |
4428 (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
|
4429 (pr-call-process pr-gv-command filename))) |
49646 | 4430 |
4431 | |
4432 ;;;###autoload | |
4433 (defun pr-ps-file-up-preview (n-up ifilename &optional ofilename) | |
4434 "Preview PostScript file FILENAME." | |
4435 (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
|
4436 (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
|
4437 "PS preview "))) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4438 (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
|
4439 (pr-ps-file-preview outfile))) |
49646 | 4440 |
4441 | |
4442 ;;;###autoload | |
4443 (defun pr-ps-file-using-ghostscript (filename) | |
4444 "Print PostScript file FILENAME using ghostscript." | |
4445 (interactive (list (pr-ps-infile-preprint "Print preview "))) | |
4446 (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
|
4447 (let* ((file (pr-expand-file-name filename)) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4448 (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
|
4449 ;; gs use |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4450 (pr-call-process pr-gs-command |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4451 (format "-sDEVICE=%s" pr-gs-device) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4452 (format "-r%d" pr-gs-resolution) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4453 (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
|
4454 (format "-sOutputFile=\"%s\"" tempfile) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4455 file |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4456 "-c quit") |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4457 ;; printing |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4458 (pr-ps-file-print tempfile) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4459 ;; deleting |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4460 (pr-delete-file tempfile)))) |
49646 | 4461 |
4462 | |
4463 ;;;###autoload | |
4464 (defun pr-ps-file-print (filename) | |
4465 "Print PostScript file FILENAME." | |
4466 (interactive (list (pr-ps-infile-preprint "Print "))) | |
4467 (and (stringp filename) (file-exists-p filename) | |
4468 ;; printing | |
4469 (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
|
4470 (if (string= pr-ps-command "") |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
4471 ;; default action |
49646 | 4472 (let ((ps-spool-buffer (get-buffer-create ps-spool-buffer-name))) |
4473 (save-excursion | |
4474 (set-buffer ps-spool-buffer) | |
4475 (erase-buffer) | |
4476 (insert-file-contents-literally file)) | |
4477 (pr-despool-print)) | |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
4478 ;; 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
|
4479 (apply 'pr-call-process |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
4480 pr-ps-command |
58241
4aa6d60fc66c
Fix typos & pr-switches-string
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58218
diff
changeset
|
4481 (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
|
4482 (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
|
4483 ;; for "cp" (cmd in out) |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
4484 (list file |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
4485 (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
|
4486 ;; 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
|
4487 (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
|
4488 file))))))) |
49646 | 4489 |
4490 | |
4491 ;;;###autoload | |
4492 (defun pr-ps-file-ps-print (filename) | |
4493 "Send PostScript file FILENAME to printer or use ghostscript to print it." | |
4494 (interactive (list (pr-ps-infile-preprint | |
4495 (if pr-print-using-ghostscript | |
4496 "Print preview " | |
4497 "Print ")))) | |
4498 (if pr-print-using-ghostscript | |
4499 (pr-ps-file-using-ghostscript filename) | |
4500 (pr-ps-file-print filename))) | |
4501 | |
4502 | |
4503 ;;;###autoload | |
4504 (defun pr-ps-file-up-ps-print (n-up ifilename &optional ofilename) | |
4505 "Process a PostScript file IFILENAME and send it to printer. | |
4506 | |
4507 Interactively, the command prompts for N-UP printing number, for an input | |
4508 PostScript file IFILENAME and, when you use a prefix argument (C-u), the | |
4509 command prompts the user for an output PostScript file name OFILENAME, and | |
4510 saves the PostScript image in that file instead of sending it to the printer. | |
4511 | |
4512 Noninteractively, if N-UP is nil, prompts for N-UP printing number. The | |
4513 argument IFILENAME is treated as follows: if it's t, prompts for an input | |
4514 PostScript file name; otherwise, it *must* be a string that it's an input | |
4515 PostScript file name. The argument OFILENAME is treated as follows: if it's | |
4516 nil, send the image to the printer. If OFILENAME is a string, save the | |
4517 PostScript image in a file with that name. If OFILENAME is t, prompts for a | |
4518 file name." | |
4519 (interactive (pr-interactive-n-up-inout | |
4520 (if pr-print-using-ghostscript | |
4521 "PS print GS" | |
4522 "PS print"))) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4523 (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
|
4524 (if pr-print-using-ghostscript |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4525 "PS print GS " |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4526 "PS print ")))) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4527 (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
|
4528 (unless ofilename |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4529 (pr-ps-file-ps-print outfile) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4530 (pr-delete-file outfile)))) |
49646 | 4531 |
4532 | |
4533 ;;;###autoload | |
4534 (defun pr-toggle-file-duplex () | |
4535 "Toggle duplex for PostScript file." | |
4536 (interactive) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4537 (pr-toggle-file-duplex-menu t)) |
49646 | 4538 |
4539 | |
4540 ;;;###autoload | |
4541 (defun pr-toggle-file-tumble () | |
4542 "Toggle tumble for PostScript file. | |
4543 | |
4544 If tumble is off, produces a printing suitable for binding on the left or | |
4545 right. | |
4546 If tumble is on, produces a printing suitable for binding at the top or | |
4547 bottom." | |
4548 (interactive) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4549 (pr-toggle-file-tumble-menu t)) |
49646 | 4550 |
4551 | |
4552 ;;;###autoload | |
4553 (defun pr-toggle-file-landscape () | |
4554 "Toggle landscape for PostScript file." | |
4555 (interactive) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4556 (pr-toggle-file-landscape-menu t)) |
49646 | 4557 |
4558 | |
4559 ;;;###autoload | |
4560 (defun pr-toggle-ghostscript () | |
4561 "Toggle printing using ghostscript." | |
4562 (interactive) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4563 (pr-toggle-ghostscript-menu t)) |
49646 | 4564 |
4565 | |
4566 ;;;###autoload | |
4567 (defun pr-toggle-faces () | |
4568 "Toggle printing with faces." | |
4569 (interactive) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4570 (pr-toggle-faces-menu t)) |
49646 | 4571 |
4572 | |
4573 ;;;###autoload | |
4574 (defun pr-toggle-spool () | |
4575 "Toggle spooling." | |
4576 (interactive) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4577 (pr-toggle-spool-menu t)) |
49646 | 4578 |
4579 | |
4580 ;;;###autoload | |
4581 (defun pr-toggle-duplex () | |
4582 "Toggle duplex." | |
4583 (interactive) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4584 (pr-toggle-duplex-menu t)) |
49646 | 4585 |
4586 | |
4587 ;;;###autoload | |
4588 (defun pr-toggle-tumble () | |
4589 "Toggle tumble. | |
4590 | |
4591 If tumble is off, produces a printing suitable for binding on the left or | |
4592 right. | |
4593 If tumble is on, produces a printing suitable for binding at the top or | |
4594 bottom." | |
4595 (interactive) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4596 (pr-toggle-tumble-menu t)) |
49646 | 4597 |
4598 | |
4599 ;;;###autoload | |
4600 (defun pr-toggle-landscape () | |
4601 "Toggle landscape." | |
4602 (interactive) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4603 (pr-toggle-landscape-menu t)) |
49646 | 4604 |
4605 | |
4606 ;;;###autoload | |
4607 (defun pr-toggle-upside-down () | |
4608 "Toggle upside-down." | |
4609 (interactive) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4610 (pr-toggle-upside-down-menu t)) |
49646 | 4611 |
4612 | |
4613 ;;;###autoload | |
4614 (defun pr-toggle-line () | |
4615 "Toggle line number." | |
4616 (interactive) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4617 (pr-toggle-line-menu t)) |
49646 | 4618 |
4619 | |
4620 ;;;###autoload | |
4621 (defun pr-toggle-zebra () | |
4622 "Toggle zebra stripes." | |
4623 (interactive) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4624 (pr-toggle-zebra-menu t)) |
49646 | 4625 |
4626 | |
4627 ;;;###autoload | |
4628 (defun pr-toggle-header () | |
4629 "Toggle printing header." | |
4630 (interactive) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4631 (pr-toggle-header-menu t)) |
49646 | 4632 |
4633 | |
4634 ;;;###autoload | |
4635 (defun pr-toggle-header-frame () | |
4636 "Toggle printing header frame." | |
4637 (interactive) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4638 (pr-toggle-header-frame-menu t)) |
49646 | 4639 |
4640 | |
4641 ;;;###autoload | |
4642 (defun pr-toggle-lock () | |
4643 "Toggle menu lock." | |
4644 (interactive) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4645 (pr-toggle-lock-menu t)) |
49646 | 4646 |
4647 | |
4648 ;;;###autoload | |
4649 (defun pr-toggle-region () | |
4650 "Toggle auto region." | |
4651 (interactive) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4652 (pr-toggle-region-menu t)) |
49646 | 4653 |
4654 | |
4655 ;;;###autoload | |
4656 (defun pr-toggle-mode () | |
4657 "Toggle auto mode." | |
4658 (interactive) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4659 (pr-toggle-mode-menu t)) |
49646 | 4660 |
4661 | |
4662 ;;;###autoload | |
4663 (defun pr-customize (&rest ignore) | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
4664 "Customization of the `printing' group." |
49646 | 4665 (interactive) |
4666 (customize-group 'printing)) | |
4667 | |
4668 | |
4669 ;;;###autoload | |
4670 (defun lpr-customize (&rest ignore) | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
4671 "Customization of the `lpr' group." |
49646 | 4672 (interactive) |
4673 (customize-group 'lpr)) | |
4674 | |
4675 | |
4676 ;;;###autoload | |
4677 (defun pr-help (&rest ignore) | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
4678 "Help for the printing package." |
49646 | 4679 (interactive) |
4680 (pr-show-setup pr-help-message "*Printing Help*")) | |
4681 | |
4682 | |
4683 ;;;###autoload | |
4684 (defun pr-ps-name () | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
4685 "Interactively select a PostScript printer." |
49646 | 4686 (interactive) |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4687 (pr-menu-set-ps-title |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4688 (pr-complete-alist "PostScript printer" |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4689 pr-ps-printer-alist pr-ps-name))) |
49646 | 4690 |
4691 | |
4692 ;;;###autoload | |
4693 (defun pr-txt-name () | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
4694 "Interactively select a text printer." |
49646 | 4695 (interactive) |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4696 (pr-menu-set-txt-title |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4697 (pr-complete-alist "Text printer" |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4698 pr-txt-printer-alist pr-txt-name))) |
49646 | 4699 |
4700 | |
4701 ;;;###autoload | |
4702 (defun pr-ps-utility () | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
4703 "Interactively select a PostScript utility." |
49646 | 4704 (interactive) |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4705 (pr-menu-set-utility-title |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4706 (pr-complete-alist "Postscript utility" |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4707 pr-ps-utility-alist pr-ps-utility))) |
49646 | 4708 |
4709 | |
4710 ;;;###autoload | |
4711 (defun pr-show-ps-setup (&rest ignore) | |
4712 "Show current ps-print settings." | |
4713 (interactive) | |
4714 (pr-show-setup (ps-setup) "*PS Setup*")) | |
4715 | |
4716 | |
4717 ;;;###autoload | |
4718 (defun pr-show-pr-setup (&rest ignore) | |
4719 "Show current printing settings." | |
4720 (interactive) | |
4721 (pr-show-setup (pr-setup) "*PR Setup*")) | |
4722 | |
4723 | |
4724 ;;;###autoload | |
4725 (defun pr-show-lpr-setup (&rest ignore) | |
4726 "Show current lpr settings." | |
4727 (interactive) | |
4728 (pr-show-setup (lpr-setup) "*LPR Setup*")) | |
4729 | |
4730 | |
4731 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
4732 ;; Fast Commands | |
4733 | |
4734 | |
4735 ;;;###autoload | |
4736 (defun pr-ps-fast-fire (n-up &optional select) | |
4737 "Fast fire function for PostScript printing. | |
4738 | |
4739 If a region is active, the region will be printed instead of the whole buffer. | |
4740 Also if the current major-mode is defined in `pr-mode-alist', the settings in | |
4741 `pr-mode-alist' will be used, that is, the current buffer or region will be | |
4742 printed using `pr-ps-mode-ps-print'. | |
4743 | |
4744 | |
4745 Interactively, you have the following situations: | |
4746 | |
4747 M-x pr-ps-fast-fire RET | |
4748 The command prompts the user for a N-UP value and printing will | |
4749 immediatelly be done using the current active printer. | |
4750 | |
4751 C-u M-x pr-ps-fast-fire RET | |
4752 C-u 0 M-x pr-ps-fast-fire RET | |
4753 The command prompts the user for a N-UP value and also for a current | |
4754 PostScript printer, then printing will immediatelly be done using the new | |
4755 current active printer. | |
4756 | |
4757 C-u 1 M-x pr-ps-fast-fire RET | |
4758 The command prompts the user for a N-UP value and also for a file name, | |
4759 and saves the PostScript image in that file instead of sending it to the | |
4760 printer. | |
4761 | |
4762 C-u 2 M-x pr-ps-fast-fire RET | |
4763 The command prompts the user for a N-UP value, then for a current | |
4764 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
|
4765 printer to that chosen by user and saves the PostScript image in |
49646 | 4766 that file instead of sending it to the printer. |
4767 | |
4768 | |
4769 Noninteractively, the argument N-UP should be a positive integer greater than | |
4770 zero and the argument SELECT is treated as follows: | |
4771 | |
4772 If it's nil, send the image to the printer. | |
4773 | |
4774 If it's a list or an integer lesser or equal to zero, the command prompts | |
4775 the user for a current PostScript printer, then printing will immediatelly | |
4776 be done using the new current active printer. | |
4777 | |
4778 If it's an integer equal to 1, the command prompts the user for a file name | |
4779 and saves the PostScript image in that file instead of sending it to the | |
4780 printer. | |
4781 | |
4782 If it's an integer greater or equal to 2, the command prompts the user for a | |
4783 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
|
4784 printer to that chosen by user and saves the PostScript image in that file |
49646 | 4785 instead of sending it to the printer. |
4786 | |
4787 If it's a symbol which it's defined in `pr-ps-printer-alist', it's the new | |
4788 active printer and printing will immediatelly be done using the new active | |
4789 printer. | |
4790 | |
4791 Otherwise, send the image to the printer. | |
4792 | |
4793 | |
4794 Note that this command always behaves as if `pr-auto-region' and `pr-auto-mode' | |
4795 are both set to t." | |
4796 (interactive (list (pr-interactive-n-up (pr-prompt-gs "PS print fast")) | |
4797 current-prefix-arg)) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4798 (let ((pr-auto-region t) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4799 (pr-auto-mode t) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4800 filename) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4801 (cond ((null select)) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4802 ((listp select) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4803 (pr-ps-name)) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4804 ((and (symbolp select) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4805 (assq select pr-ps-printer-alist)) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4806 (pr-menu-set-ps-title select)) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4807 ((integerp select) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4808 (and (/= select 1) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4809 (pr-ps-name)) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4810 (and (>= select 1) (not pr-spool-p) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4811 (setq filename (pr-ps-outfile-preprint |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4812 (if pr-print-using-ghostscript |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4813 "Fast GS " |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4814 "Fast ")))))) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4815 (pr-ps-buffer-ps-print |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4816 (if (integerp n-up) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4817 (min (max n-up 1) 100) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4818 (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
|
4819 filename))) |
49646 | 4820 |
4821 | |
4822 ;;;###autoload | |
4823 (defun pr-txt-fast-fire (&optional select-printer) | |
4824 "Fast fire function for text printing. | |
4825 | |
4826 If a region is active, the region will be printed instead of the whole buffer. | |
4827 Also if the current major-mode is defined in `pr-mode-alist', the settings in | |
4828 `pr-mode-alist' will be used, that is, the current buffer or region will be | |
4829 printed using `pr-txt-mode'. | |
4830 | |
4831 Interactively, when you use a prefix argument (C-u), the command prompts the | |
4832 user for a new active text printer. | |
4833 | |
4834 Noninteractively, the argument SELECT-PRINTER is treated as follows: | |
4835 | |
4836 If it's nil, the printing is sent to the current active text printer. | |
4837 | |
4838 If it's a symbol which it's defined in `pr-txt-printer-alist', it's the new | |
4839 active printer and printing will immediatelly be done using the new active | |
4840 printer. | |
4841 | |
4842 If it's non-nil, the command prompts the user for a new active text printer. | |
4843 | |
4844 Note that this command always behaves as if `pr-auto-region' and `pr-auto-mode' | |
4845 are both set to t." | |
4846 (interactive (list current-prefix-arg)) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4847 (cond ((null select-printer)) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4848 ((and (symbolp select-printer) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4849 (assq select-printer pr-txt-printer-alist)) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4850 (pr-menu-set-txt-title select-printer)) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4851 (t |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4852 (pr-txt-name))) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4853 (let ((pr-auto-region t) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4854 (pr-auto-mode t)) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
4855 (pr-txt-buffer))) |
49646 | 4856 |
4857 | |
4858 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
4859 ;; Utilities | |
4860 | |
4861 | |
4862 (defun pr-setup () | |
4863 "Return the current `printing' setup. | |
4864 | |
4865 This is *not* an interactive command. | |
4866 One way to see `printing' setup is to switch to a *Scratch* buffer and type: | |
4867 | |
4868 M-: (insert (pr-setup)) RET | |
4869 | |
4870 Or choose the menu option Printing/Show Settings/printing." | |
4871 (let (ps-prefix-quote) | |
4872 (mapconcat | |
4873 #'ps-print-quote | |
4874 (list | |
4875 (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
|
4876 ";; internal vars" |
58408
6b5846d74ff0
pr-setup & lpr-setup
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58306
diff
changeset
|
4877 (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
|
4878 (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
|
4879 (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
|
4880 (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
|
4881 (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
|
4882 (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
|
4883 (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
|
4884 (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
|
4885 (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
|
4886 (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
|
4887 (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
|
4888 (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
|
4889 (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
|
4890 nil |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
4891 '(14 . pr-path-style) |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
4892 '(14 . pr-path-alist) |
49646 | 4893 nil |
4894 '(21 . pr-txt-name) | |
4895 '(21 . pr-txt-printer-alist) | |
4896 nil | |
4897 '(20 . pr-ps-name) | |
4898 '(20 . pr-ps-printer-alist) | |
4899 nil | |
4900 '(20 . pr-temp-dir) | |
4901 '(20 . pr-ps-temp-file) | |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
4902 '(20 . pr-file-modes) |
49646 | 4903 '(20 . pr-delete-temp-file) |
4904 '(20 . pr-list-directory) | |
4905 nil | |
4906 '(17 . pr-gv-command) | |
4907 '(17 . pr-gs-command) | |
4908 '(17 . pr-gs-switches) | |
4909 '(17 . pr-gs-device) | |
4910 '(17 . pr-gs-resolution) | |
4911 nil | |
4912 '(27 . pr-print-using-ghostscript) | |
4913 '(27 . pr-faces-p) | |
4914 '(27 . pr-spool-p) | |
4915 '(27 . pr-file-landscape) | |
4916 '(27 . pr-file-duplex) | |
4917 '(27 . pr-file-tumble) | |
4918 '(27 . pr-auto-region) | |
4919 '(27 . pr-auto-mode) | |
4920 nil | |
4921 '(20 . pr-ps-utility) | |
4922 '(20 . pr-ps-utility-alist) | |
4923 nil | |
4924 '(14 . pr-mode-alist) | |
4925 nil | |
4926 '(20 . pr-menu-lock) | |
4927 '(20 . pr-menu-char-height) | |
4928 '(20 . pr-menu-char-width) | |
4929 nil | |
4930 '(20 . pr-setting-database) | |
4931 nil | |
4932 '(22 . pr-visible-entry-list) | |
4933 nil | |
4934 '(22 . pr-buffer-verbose) | |
4935 '(22 . pr-buffer-name) | |
4936 '(22 . pr-buffer-name-ignore) | |
4937 ")\n\n;;; printing.el - end of settings\n") | |
4938 "\n"))) | |
4939 | |
4940 | |
4941 (defun lpr-setup () | |
4942 "Return the current `lpr' setup. | |
4943 | |
4944 This is *not* an interactive command. | |
4945 One way to see `lpr' setup is to switch to a *Scratch* buffer and type: | |
4946 | |
4947 M-: (insert (lpr-setup)) RET | |
4948 | |
4949 Or choose the menu option Printing/Show Settings/lpr." | |
4950 (let (ps-prefix-quote) | |
4951 (mapconcat | |
4952 #'ps-print-quote | |
58408
6b5846d74ff0
pr-setup & lpr-setup
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58306
diff
changeset
|
4953 (list |
6b5846d74ff0
pr-setup & lpr-setup
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58306
diff
changeset
|
4954 "\n;;; lpr.el settings\n" |
6b5846d74ff0
pr-setup & lpr-setup
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58306
diff
changeset
|
4955 (ps-comment-string "emacs-version" emacs-version) |
6b5846d74ff0
pr-setup & lpr-setup
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58306
diff
changeset
|
4956 nil |
6b5846d74ff0
pr-setup & lpr-setup
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58306
diff
changeset
|
4957 '(25 . printer-name) |
6b5846d74ff0
pr-setup & lpr-setup
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58306
diff
changeset
|
4958 '(25 . lpr-switches) |
6b5846d74ff0
pr-setup & lpr-setup
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58306
diff
changeset
|
4959 '(25 . lpr-add-switches) |
6b5846d74ff0
pr-setup & lpr-setup
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58306
diff
changeset
|
4960 '(25 . lpr-command) |
6b5846d74ff0
pr-setup & lpr-setup
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58306
diff
changeset
|
4961 '(25 . lpr-headers-switches) |
6b5846d74ff0
pr-setup & lpr-setup
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58306
diff
changeset
|
4962 '(25 . print-region-function) |
6b5846d74ff0
pr-setup & lpr-setup
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58306
diff
changeset
|
4963 '(25 . lpr-page-header-program) |
6b5846d74ff0
pr-setup & lpr-setup
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58306
diff
changeset
|
4964 '(25 . lpr-page-header-switches) |
6b5846d74ff0
pr-setup & lpr-setup
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58306
diff
changeset
|
4965 ")\n\n;;; lpr.el - end of settings\n") |
49646 | 4966 "\n"))) |
4967 | |
4968 | |
4969 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
4970 ;; mh-e (adapted from mh-e-init.el -- Tom Vogels <tov@ece.cmu.edu>) | |
4971 | |
4972 | |
4973 (defalias 'pr-mh-get-msg-num 'mh-get-msg-num) | |
4974 (defalias 'pr-mh-show 'mh-show) | |
4975 (defalias 'pr-mh-start-of-uncleaned-message 'mh-start-of-uncleaned-message) | |
4976 (defvar mh-show-buffer nil) | |
4977 | |
4978 | |
4979 (defun pr-article-date () | |
4980 "Find the date of an article or mail message in current buffer. | |
4981 Return only the dayname, if present, weekday, month, and year." | |
4982 (save-excursion | |
4983 (goto-char (point-min)) | |
4984 (if (re-search-forward | |
4985 "^Date:[ \t]+\\(\\([A-Za-z]+, \\)?[0-9]+ [A-Za-z]+ [0-9]+\\)" nil t) | |
4986 (buffer-substring (match-beginning 1) (match-end 1)) | |
4987 (format-time-string "%Y/%m/%d")))) | |
4988 | |
4989 | |
4990 (defun pr-mh-current-message () | |
4991 "Go to mh-inbox current message." | |
4992 (let ((msg (or (pr-mh-get-msg-num nil) 0))) | |
4993 (pr-mh-show) | |
4994 (set-buffer mh-show-buffer) | |
4995 (goto-char (point-min)) | |
4996 (pr-mh-start-of-uncleaned-message) | |
4997 (message "Printing message %d" msg))) | |
4998 | |
4999 | |
5000 (defun pr-mh-print-1 (n-up filename header-list) | |
5001 "Print mh-inbox current message in PostScript." | |
5002 (save-excursion | |
5003 (save-window-excursion | |
5004 (pr-mh-current-message) | |
5005 (pr-mode-print n-up filename header-list (point))))) | |
5006 | |
5007 | |
5008 (defun pr-mh-lpr-1 (header-list) | |
5009 "Print mh-inbox current message in text printer." | |
5010 (save-excursion | |
5011 (save-window-excursion | |
5012 (pr-mh-current-message) | |
5013 (pr-mode-lpr header-list (point))))) | |
5014 | |
5015 | |
5016 (defalias 'pr-mh-print-2 'pr-mode-print) | |
5017 | |
5018 | |
5019 (defalias 'pr-mh-lpr-2 'pr-mode-lpr) | |
5020 | |
5021 | |
5022 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
5023 ;; rmail (hacked from ps-print.el) | |
5024 | |
5025 | |
5026 (defun pr-rmail-lpr (header-list) | |
5027 "Print RMAIL current message in text printer." | |
5028 (pr-lpr-message-from-summary header-list | |
5029 'rmail-buffer 'rmail-summary-buffer)) | |
5030 | |
5031 | |
5032 (defun pr-rmail-print (n-up filename header-list) | |
5033 "Print RMAIL current message in PostScript." | |
5034 (pr-ps-message-from-summary n-up filename header-list | |
5035 'rmail-buffer 'rmail-summary-buffer)) | |
5036 | |
5037 | |
5038 (defun pr-ps-message-from-summary (n-up filename header-list | |
5039 summary-buffer summary-default) | |
5040 "Print current message in PostScript." | |
5041 (let ((buf (or (and (boundp summary-buffer) | |
5042 (symbol-value summary-buffer)) | |
5043 (symbol-value summary-default)))) | |
5044 (and (get-buffer buf) | |
5045 (save-excursion | |
5046 (set-buffer buf) | |
5047 (pr-mode-print n-up filename header-list))))) | |
5048 | |
5049 | |
5050 (defun pr-lpr-message-from-summary (header-list summary-buffer summary-default) | |
5051 "Print current message in text printer." | |
5052 (let ((buf (or (and (boundp summary-buffer) | |
5053 (symbol-value summary-buffer)) | |
5054 (symbol-value summary-default)))) | |
5055 (and (get-buffer buf) | |
5056 (save-excursion | |
5057 (set-buffer buf) | |
5058 (pr-mode-lpr header-list))))) | |
5059 | |
5060 | |
5061 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
5062 ;; gnus (hacked from ps-print.el) | |
5063 | |
5064 | |
5065 (defvar pr-gnus-article "*Article*") | |
5066 | |
5067 | |
5068 (defun pr-gnus-print (n-up filename header-list) | |
5069 "Print *Article* current message in PostScript." | |
5070 (pr-ps-message-from-summary n-up filename header-list | |
5071 'gnus-article-buffer 'pr-gnus-article)) | |
5072 | |
5073 | |
5074 (defun pr-gnus-lpr (header-list) | |
5075 "Print *Article* current message in text printer." | |
5076 (pr-lpr-message-from-summary header-list | |
5077 'gnus-article-buffer 'pr-gnus-article)) | |
5078 | |
5079 | |
5080 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
5081 ;; vm (hacked from ps-print.el) | |
5082 | |
5083 | |
5084 (defvar pr-vm-summary "") | |
5085 | |
5086 | |
5087 (defun pr-vm-print (n-up filename header-list) | |
5088 "Print current vm message in PostScript." | |
5089 (pr-ps-message-from-summary n-up filename header-list | |
5090 'vm-mail-buffer 'pr-vm-summary)) | |
5091 | |
5092 | |
5093 (defun pr-vm-lpr (header-list) | |
5094 "Print current vm message in text printer." | |
5095 (pr-lpr-message-from-summary header-list | |
5096 'vm-mail-buffer 'pr-vm-summary)) | |
5097 | |
5098 | |
5099 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
5100 ;; Mode Functions | |
5101 | |
5102 | |
5103 (defun pr-ps-mode (n-up filename) | |
5104 "If current major mode is declared, print it in PostScript." | |
5105 (let ((args (pr-mode-alist-p))) | |
5106 (if args | |
5107 (let ((fun (cdr args))) | |
5108 (funcall (car fun) n-up filename (cdr fun)) | |
5109 t) | |
5110 (ding) | |
5111 (message "`%s' major mode not declared." major-mode) | |
5112 nil))) | |
5113 | |
5114 | |
5115 (defmacro pr-local-variable (header-list &rest body) | |
5116 `(save-excursion | |
5117 (let ((ps-header-lines (or (nth 0 ,header-list) ps-header-lines)) | |
5118 (ps-left-header (or (nth 1 ,header-list) ps-left-header)) | |
5119 (ps-right-header (or (nth 2 ,header-list) ps-right-header)) | |
5120 ps-razzle-dazzle) | |
5121 (let ((local-var-list (pr-eval-local-alist (nthcdr 4 ,header-list)))) | |
5122 ,@body | |
5123 (and (nth 3 ,header-list) | |
5124 (pr-kill-local-variable local-var-list)))))) | |
5125 | |
5126 | |
5127 (defun pr-mode-print (n-up filename header-list &optional from to) | |
5128 "Print current major mode in PostScript." | |
5129 (pr-local-variable | |
5130 header-list | |
5131 (let ((file (pr-ps-file filename)) | |
5132 (start (cond (from) | |
5133 ((pr-region-active-p) (region-beginning)) | |
5134 (t nil) | |
5135 ))) | |
5136 (pr-text2ps (pr-region-active-symbol start) n-up file start | |
5137 (cond (to) | |
5138 ((pr-region-active-p) (region-end)) | |
5139 (from (point-max)) | |
5140 )) | |
5141 (unless (or pr-spool-p filename) | |
5142 (pr-ps-file-print file) | |
5143 (pr-delete-file file))))) | |
5144 | |
5145 | |
5146 (defun pr-mode-lpr (header-list &optional from to) | |
5147 "Print current major mode in text printer." | |
5148 (pr-local-variable | |
5149 header-list | |
5150 (pr-txt-print (cond (from) | |
5151 ((pr-region-active-p) (region-beginning)) | |
5152 (t (point-min))) | |
5153 (cond (to) | |
5154 ((pr-region-active-p) (region-end)) | |
5155 (t (point-max)))))) | |
5156 | |
5157 | |
5158 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
5159 ;; Menu Lock | |
5160 | |
5161 | |
5162 (defconst pr-menu-entry-alist | |
5163 '((postscript . 3) | |
5164 (text . 3) | |
5165 (postscript-options . 9) | |
5166 (postscript-process . 3) | |
5167 (printing . 3) | |
5168 (help . 3) | |
5169 ) | |
5170 "Alist that associates menu part with number of items per part. | |
5171 | |
5172 It's used by `pr-menu-index'. | |
5173 | |
5174 Each element has the form: | |
5175 | |
5176 (MENU-PART . NUMBER-OF-ITEMS) | |
5177 | |
5178 See `pr-visible-entry-alist'.") | |
5179 | |
5180 | |
5181 (defun pr-menu-index (entry index) | |
5182 (let ((base-list | |
5183 (cond ((eq entry 'text) | |
5184 '(postscript)) | |
5185 ((eq entry 'postscript-options) | |
5186 '(postscript text)) | |
5187 ((eq entry 'postscript-process) | |
5188 '(postscript text postscript-options)) | |
5189 ((eq entry 'printing) | |
5190 '(postscript text postscript-options postscript-process)) | |
5191 (t | |
5192 nil) | |
5193 )) | |
5194 key) | |
5195 (while base-list | |
5196 (setq key (car base-list) | |
5197 base-list (cdr base-list)) | |
5198 (and (pr-visible-p key) | |
5199 (setq index (+ index | |
5200 (cdr (assq key pr-menu-entry-alist))))))) | |
5201 (+ index 2)) | |
5202 | |
5203 | |
5204 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
5205 ;; Printer & Utility Selection | |
5206 | |
5207 | |
5208 (defun pr-update-var (var-sym alist) | |
5209 (or (assq (symbol-value var-sym) alist) | |
5210 (set var-sym (car (car alist))))) | |
5211 | |
5212 | |
5213 (defun pr-update-menus (&optional force) | |
5214 "Update utility, PostScript and text printer menus. | |
5215 | |
5216 If FORCE is non-nil, update menus doesn't matter if `pr-ps-printer-alist', | |
5217 `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
|
5218 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
|
5219 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
|
5220 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
|
5221 non-nil. |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
5222 |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
5223 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
|
5224 (interactive "P") |
63328
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
5225 (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
|
5226 ;; 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
|
5227 ;; 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
|
5228 ;; 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
|
5229 (pr-menu-bind) |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
5230 ;; Here menu binding is ok. |
af5c15bf9ea0
printing v6.8.4
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
63059
diff
changeset
|
5231 (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
|
5232 (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
|
5233 (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
|
5234 (pr-do-update-menus force))) |
49646 | 5235 |
5236 | |
5237 (defun pr-menu-create (name alist var-sym fun entry index) | |
5238 (cons name | |
5239 (mapcar | |
5240 #'(lambda (elt) | |
5241 (let ((sym (car elt))) | |
5242 (vector | |
5243 (symbol-name sym) | |
5244 (list fun (list 'quote sym) nil (list 'quote entry) index) | |
5245 :style 'radio | |
5246 :selected (list 'eq var-sym (list 'quote sym))))) | |
5247 alist))) | |
5248 | |
5249 | |
5250 (defun pr-ps-set-utility (value) | |
5251 (let ((item (cdr (assq value pr-ps-utility-alist)))) | |
5252 (or item | |
5253 (error | |
56578
a36e2d80b510
(toplevel, pr-ps-fast-fire, pr-ps-set-utility)
John Paul Wallington <jpw@pobox.com>
parents:
56493
diff
changeset
|
5254 "Invalid PostScript utility name `%s' for variable `pr-ps-utility'" |
49646 | 5255 value)) |
5256 (setq pr-ps-utility value) | |
5257 (pr-eval-alist (nthcdr 9 item))) | |
5258 (pr-update-mode-line)) | |
5259 | |
5260 | |
5261 (defun pr-ps-set-printer (value) | |
5262 (let ((ps (cdr (assq value pr-ps-printer-alist)))) | |
5263 (or ps | |
5264 (error | |
56578
a36e2d80b510
(toplevel, pr-ps-fast-fire, pr-ps-set-utility)
John Paul Wallington <jpw@pobox.com>
parents:
56493
diff
changeset
|
5265 "Invalid PostScript printer name `%s' for variable `pr-ps-name'" |
49646 | 5266 value)) |
5267 (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
|
5268 pr-ps-command (pr-dosify-file-name (nth 0 ps)) |
49646 | 5269 pr-ps-switches (nth 1 ps) |
5270 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
|
5271 pr-ps-printer (nth 3 ps)) |
49646 | 5272 (or (stringp pr-ps-command) |
5273 (setq pr-ps-command | |
5274 (cond (ps-windows-system "print") | |
5275 (ps-lp-system "lp") | |
5276 (t "lpr") | |
5277 ))) | |
5278 (or (stringp pr-ps-printer-switch) | |
5279 (setq pr-ps-printer-switch | |
5280 (cond (ps-windows-system "/D:") | |
5281 (ps-lp-system "-d") | |
5282 (t "-P") | |
5283 ))) | |
5284 (pr-eval-alist (nthcdr 4 ps))) | |
5285 (pr-update-mode-line)) | |
5286 | |
5287 | |
5288 (defun pr-txt-set-printer (value) | |
5289 (let ((txt (cdr (assq value pr-txt-printer-alist)))) | |
5290 (or txt | |
56578
a36e2d80b510
(toplevel, pr-ps-fast-fire, pr-ps-set-utility)
John Paul Wallington <jpw@pobox.com>
parents:
56493
diff
changeset
|
5291 (error "Invalid text printer name `%s' for variable `pr-txt-name'" |
49646 | 5292 value)) |
5293 (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
|
5294 pr-txt-command (pr-dosify-file-name (nth 0 txt)) |
49646 | 5295 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
|
5296 pr-txt-printer (nth 2 txt))) |
49646 | 5297 (or (stringp pr-txt-command) |
5298 (setq pr-txt-command | |
5299 (cond (ps-windows-system "print") | |
5300 (ps-lp-system "lp") | |
5301 (t "lpr") | |
5302 ))) | |
5303 (pr-update-mode-line)) | |
5304 | |
5305 | |
5306 (defun pr-eval-alist (alist) | |
5307 (mapcar #'(lambda (option) | |
5308 (let ((var-sym (car option)) | |
5309 (value (cdr option))) | |
5310 (if (eq var-sym 'inherits-from:) | |
5311 (pr-eval-setting-alist value 'global) | |
5312 (set var-sym (eval value))))) | |
5313 alist)) | |
5314 | |
5315 | |
5316 (defun pr-eval-local-alist (alist) | |
5317 (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
|
5318 (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
|
5319 (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
|
5320 (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
|
5321 (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
|
5322 (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
|
5323 (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
|
5324 (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
|
5325 (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
|
5326 alist) |
49646 | 5327 local-list)) |
5328 | |
5329 | |
5330 (defun pr-eval-setting-alist (key &optional global old) | |
5331 (let ((setting (cdr (assq key pr-setting-database)))) | |
5332 (and setting | |
5333 (let ((inherits (nth 0 setting)) | |
5334 (local (nth 1 setting)) | |
5335 (kill (nth 2 setting)) | |
5336 local-list) | |
5337 (and local global | |
5338 (progn | |
5339 (ding) | |
5340 (message "There are local buffer settings for `%S'." key) | |
5341 (setq global nil))) | |
5342 (and inherits | |
5343 (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
|
5344 (error "Circular inheritance for `%S'" inherits) |
49646 | 5345 (setq local-list |
5346 (pr-eval-setting-alist inherits global | |
5347 (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
|
5348 (mapc |
49646 | 5349 (cond ((not local) ; global settings |
5350 #'(lambda (option) | |
5351 (let ((var-sym (car option))) | |
5352 (or (eq var-sym 'inherits-from:) | |
5353 (set var-sym (eval (cdr option))))))) | |
5354 (kill ; local settings with killing | |
5355 #'(lambda (option) | |
5356 (let ((var-sym (car option))) | |
5357 (unless (eq var-sym 'inherits-from:) | |
5358 (setq local-list (cons var-sym local-list)) | |
5359 (set (make-local-variable var-sym) | |
5360 (eval (cdr option))))))) | |
5361 (t ; local settings without killing | |
5362 #'(lambda (option) | |
5363 (let ((var-sym (car option))) | |
5364 (or (eq var-sym 'inherits-from:) | |
5365 (set (make-local-variable var-sym) | |
5366 (eval (cdr option)))))))) | |
5367 (nthcdr 3 setting)) | |
5368 local-list)))) | |
5369 | |
5370 | |
5371 (defun pr-kill-local-variable (local-var-list) | |
5372 (mapcar 'kill-local-variable local-var-list)) | |
5373 | |
5374 | |
5375 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
5376 ;; Internal Functions (II) | |
5377 | |
5378 | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5379 (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
|
5380 &optional path no-menu) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5381 (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
|
5382 (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
|
5383 (or no-menu |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5384 (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
|
5385 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5386 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5387 (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
|
5388 (interactive) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5389 (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
|
5390 '("PostScript Print" "File") no-menu)) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5391 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5392 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5393 (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
|
5394 (interactive) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5395 (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
|
5396 '("PostScript Print" "File") no-menu)) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5397 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5398 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5399 (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
|
5400 (interactive) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5401 (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
|
5402 '("PostScript Print" "File") no-menu)) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5403 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5404 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5405 (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
|
5406 (interactive) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5407 (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
|
5408 '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
|
5409 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5410 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5411 (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
|
5412 (interactive) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5413 (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
|
5414 '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
|
5415 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5416 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5417 (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
|
5418 (interactive) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5419 (pr-toggle 'pr-spool-p "Spooling printing" |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5420 '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
|
5421 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5422 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5423 (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
|
5424 (interactive) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5425 (pr-toggle 'ps-spool-duplex "Printing duplex" |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5426 '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
|
5427 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5428 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5429 (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
|
5430 (interactive) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5431 (pr-toggle 'ps-spool-tumble "Tumble" |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5432 '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
|
5433 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5434 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5435 (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
|
5436 (interactive) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5437 (pr-toggle 'ps-landscape-mode "Landscape" |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5438 '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
|
5439 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5440 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5441 (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
|
5442 (interactive) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5443 (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
|
5444 '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
|
5445 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5446 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5447 (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
|
5448 (interactive) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5449 (pr-toggle 'ps-line-number "Line number" |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5450 '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
|
5451 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5452 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5453 (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
|
5454 (interactive) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5455 (pr-toggle 'ps-zebra-stripes "Zebra stripe" |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5456 '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
|
5457 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5458 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5459 (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
|
5460 (interactive) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5461 (pr-toggle 'ps-print-header "Print header" |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5462 '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
|
5463 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5464 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5465 (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
|
5466 (interactive) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5467 (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
|
5468 '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
|
5469 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5470 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5471 (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
|
5472 (interactive) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5473 (pr-toggle 'pr-menu-lock "Menu lock" |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5474 'printing 2 12 'toggle nil no-menu)) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5475 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5476 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5477 (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
|
5478 (interactive) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5479 (pr-toggle 'pr-auto-region "Auto region" |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5480 'printing 0 12 'toggle nil no-menu)) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5481 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5482 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5483 (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
|
5484 (interactive) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5485 (pr-toggle 'pr-auto-mode "Auto mode" |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5486 'printing 1 12 'toggle nil no-menu)) |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5487 |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5488 |
49646 | 5489 (defun pr-prompt (str) |
5490 (if (pr-auto-mode-p) | |
5491 (concat str " mode") | |
5492 (pr-region-active-string str))) | |
5493 | |
5494 | |
5495 (defun pr-prompt-region (str) | |
5496 (concat str (if (pr-auto-mode-p) | |
5497 " mode" | |
5498 " region"))) | |
5499 | |
5500 | |
5501 (defun pr-prompt-gs (str) | |
5502 (if (pr-using-ghostscript-p) | |
5503 (concat str " GS") | |
5504 str)) | |
5505 | |
5506 | |
5507 (defun pr-region-active-symbol (&optional region-p) | |
5508 (if (or region-p (pr-region-active-p)) | |
5509 'region | |
5510 'buffer)) | |
5511 | |
5512 | |
5513 (defun pr-region-active-string (prefix) | |
5514 (concat prefix | |
5515 (if (pr-region-active-p) | |
5516 " region" | |
5517 " buffer"))) | |
5518 | |
5519 | |
5520 (defun pr-show-setup (settings buffer-name) | |
5521 (with-output-to-temp-buffer buffer-name | |
5522 (princ settings) | |
5523 (print-help-return-message))) | |
5524 | |
5525 | |
5526 (defun pr-complete-alist (prompt alist default) | |
5527 (let ((collection (mapcar #'(lambda (elt) | |
5528 (setq elt (car elt)) | |
5529 (cons (symbol-name elt) elt)) | |
5530 alist))) | |
5531 (cdr (assoc (completing-read (concat prompt ": ") | |
5532 collection nil t | |
5533 (symbol-name default) nil | |
5534 (symbol-name default)) | |
5535 collection)))) | |
5536 | |
5537 | |
5538 (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
|
5539 (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
|
5540 (delete-file file))) |
49646 | 5541 |
5542 | |
5543 (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
|
5544 (pr-dosify-file-name (expand-file-name filename))) |
49646 | 5545 |
5546 | |
5547 (defun pr-ps-outfile-preprint (&optional mess) | |
5548 (let* ((prompt (format "%soutput PostScript file name: " (or mess ""))) | |
5549 (res (read-file-name prompt default-directory "" nil))) | |
5550 (while (cond ((not (file-writable-p res)) | |
5551 (ding) | |
5552 (setq prompt "is unwritable")) | |
5553 ((file-directory-p res) | |
5554 (ding) | |
5555 (setq prompt "is a directory")) | |
5556 ((file-exists-p res) | |
5557 (ding) | |
5558 (setq prompt "exists") | |
5559 (not (y-or-n-p (format "File `%s' exists; overwrite? " | |
5560 res)))) | |
5561 (t nil)) | |
5562 (setq res (read-file-name | |
5563 (format "File %s; PostScript file: " prompt) | |
5564 (file-name-directory res) nil nil | |
5565 (file-name-nondirectory res)))) | |
5566 (pr-expand-file-name res))) | |
5567 | |
5568 | |
5569 (defun pr-ps-infile-preprint (&optional mess) | |
5570 (let* ((prompt (format "%sinput PostScript file name: " (or mess ""))) | |
5571 (res (read-file-name prompt default-directory "" nil))) | |
5572 (while (cond ((not (file-exists-p res)) | |
5573 (ding) | |
5574 (setq prompt "doesn't exist")) | |
5575 ((not (file-readable-p res)) | |
5576 (ding) | |
5577 (setq prompt "is unreadable")) | |
5578 ((file-directory-p res) | |
5579 (ding) | |
5580 (setq prompt "is a directory")) | |
5581 (t nil)) | |
5582 (setq res (read-file-name | |
5583 (format "File %s; PostScript file: " prompt) | |
5584 (file-name-directory res) nil nil | |
5585 (file-name-nondirectory res)))) | |
5586 (pr-expand-file-name res))) | |
5587 | |
5588 | |
5589 (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
|
5590 ;; check arguments for PostScript file processing. |
49646 | 5591 ;; n-up |
5592 (or (symbol-value n-up-sym) | |
5593 (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
|
5594 ;; input file |
49646 | 5595 (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
|
5596 (set infile-sym (pr-ps-infile-preprint prompt))) |
49646 | 5597 (or (symbol-value infile-sym) |
5598 (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
|
5599 (set infile-sym (pr-dosify-file-name (symbol-value infile-sym))) |
49646 | 5600 ;; output file |
5601 (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
|
5602 (set outfile-sym (and current-prefix-arg |
49646 | 5603 (pr-ps-outfile-preprint prompt)))) |
5604 (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
|
5605 (set outfile-sym (pr-dosify-file-name (symbol-value outfile-sym)))) |
49646 | 5606 (pr-ps-file (symbol-value outfile-sym))) |
5607 | |
5608 | |
5609 (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
|
5610 ;; activate utility to process a PostScript file. |
49646 | 5611 (let (item) |
5612 (and (stringp infile) (file-exists-p infile) | |
5613 (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
|
5614 (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
|
5615 (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
|
5616 "pr-ps-utility-alist entry") |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
5617 (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
|
5618 "pr-ps-utility-alist entry") |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
5619 (and (nth 2 item) |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
5620 (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
|
5621 (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
|
5622 (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
|
5623 (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
|
5624 (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
|
5625 (pr-expand-file-name infile) |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
5626 (nth 7 item) |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
5627 (pr-expand-file-name outfile))))) |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
5628 |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
5629 |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
5630 (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
|
5631 (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
|
5632 (setq lst (cdr lst))) |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
5633 (let ((b lst) |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
5634 (l (cdr lst))) |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
5635 (while l |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
5636 (if (car l) |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
5637 (setq b l |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
5638 l (cdr l)) |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
5639 (setq l (cdr l)) |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
5640 (setcdr b l)))) |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
5641 lst) |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
5642 |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
5643 |
e97dd6ea9f71
It uses call-process instead shell-command
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54738
diff
changeset
|
5644 (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
|
5645 (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
|
5646 (cmd (pr-command command)) |
4aa6d60fc66c
Fix typos & pr-switches-string
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58218
diff
changeset
|
5647 status) |
4aa6d60fc66c
Fix typos & pr-switches-string
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58218
diff
changeset
|
5648 (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
|
5649 ;; *Printing Command Output* == show command & args |
4aa6d60fc66c
Fix typos & pr-switches-string
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58218
diff
changeset
|
5650 (save-excursion |
4aa6d60fc66c
Fix typos & pr-switches-string
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58218
diff
changeset
|
5651 (set-buffer buffer) |
4aa6d60fc66c
Fix typos & pr-switches-string
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58218
diff
changeset
|
5652 (goto-char (point-max)) |
4aa6d60fc66c
Fix typos & pr-switches-string
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58218
diff
changeset
|
5653 (insert (format "%s %S\n" cmd args))) |
4aa6d60fc66c
Fix typos & pr-switches-string
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58218
diff
changeset
|
5654 ;; *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
|
5655 (pr-save-file-modes |
58204
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
5656 (setq status |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
5657 (condition-case data |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
5658 (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
|
5659 ((quit error) |
58241
4aa6d60fc66c
Fix typos & pr-switches-string
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58218
diff
changeset
|
5660 (error-message-string data))))) |
4aa6d60fc66c
Fix typos & pr-switches-string
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58218
diff
changeset
|
5661 ;; *Printing Command Output* == show exit status |
4aa6d60fc66c
Fix typos & pr-switches-string
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58218
diff
changeset
|
5662 (save-excursion |
4aa6d60fc66c
Fix typos & pr-switches-string
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58218
diff
changeset
|
5663 (set-buffer buffer) |
4aa6d60fc66c
Fix typos & pr-switches-string
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58218
diff
changeset
|
5664 (goto-char (point-max)) |
4aa6d60fc66c
Fix typos & pr-switches-string
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58218
diff
changeset
|
5665 (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
|
5666 ;; message if error status |
4aa6d60fc66c
Fix typos & pr-switches-string
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58218
diff
changeset
|
5667 (if (or (stringp status) |
4aa6d60fc66c
Fix typos & pr-switches-string
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58218
diff
changeset
|
5668 (and (integerp status) (/= status 0))) |
4aa6d60fc66c
Fix typos & pr-switches-string
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58218
diff
changeset
|
5669 (message |
4aa6d60fc66c
Fix typos & pr-switches-string
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58218
diff
changeset
|
5670 "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
|
5671 status)))) |
49646 | 5672 |
5673 | |
5674 (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
|
5675 (let ((lpr-command (pr-standard-file-name (pr-command pr-txt-command))) |
49646 | 5676 (lpr-switches (pr-switches pr-txt-switches "pr-txt-switches")) |
5677 (printer-name pr-txt-printer)) | |
5678 (lpr-region from to))) | |
5679 | |
5680 | |
5681 (defun pr-switches-string (switches mess) | |
58241
4aa6d60fc66c
Fix typos & pr-switches-string
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58218
diff
changeset
|
5682 ;; If SWITCHES is nil, return nil. |
4aa6d60fc66c
Fix typos & pr-switches-string
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58218
diff
changeset
|
5683 ;; 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
|
5684 (and switches |
4aa6d60fc66c
Fix typos & pr-switches-string
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58218
diff
changeset
|
5685 (mapconcat 'identity (pr-switches switches mess) " "))) |
49646 | 5686 |
5687 | |
5688 (defun pr-switches (switches mess) | |
5689 (or (listp switches) | |
56578
a36e2d80b510
(toplevel, pr-ps-fast-fire, pr-ps-set-utility)
John Paul Wallington <jpw@pobox.com>
parents:
56493
diff
changeset
|
5690 (error "%S should have a list of strings" mess)) |
49646 | 5691 (ps-flatten-list ; dynamic evaluation |
5692 (mapcar 'ps-eval-switch switches))) | |
5693 | |
5694 | |
5695 (defun pr-ps-preview (kind n-up filename mess) | |
5696 (pr-set-n-up-and-filename 'n-up 'filename mess) | |
5697 (let ((file (pr-ps-file filename))) | |
5698 (pr-text2ps kind n-up file) | |
5699 (or pr-spool-p (pr-ps-file-preview file)))) | |
5700 | |
5701 | |
5702 (defun pr-ps-using-ghostscript (kind n-up filename mess) | |
5703 (pr-set-n-up-and-filename 'n-up 'filename mess) | |
5704 (let ((file (pr-ps-file filename))) | |
5705 (pr-text2ps kind n-up file) | |
5706 (unless (or pr-spool-p filename) | |
5707 (pr-ps-file-using-ghostscript file) | |
5708 (pr-delete-file file)))) | |
5709 | |
5710 | |
5711 (defun pr-ps-print (kind n-up filename mess) | |
5712 (pr-set-n-up-and-filename 'n-up 'filename mess) | |
5713 (let ((file (pr-ps-file filename))) | |
5714 (pr-text2ps kind n-up file) | |
5715 (unless (or pr-spool-p filename) | |
5716 (pr-ps-file-print file) | |
5717 (pr-delete-file file)))) | |
5718 | |
5719 | |
5720 (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
|
5721 (pr-dosify-file-name (or filename |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5722 (make-temp-file |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5723 (convert-standard-filename |
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5724 (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
|
5725 nil ".ps")))) |
49646 | 5726 |
5727 | |
5728 (defun pr-interactive-n-up (mess) | |
5729 (or (stringp mess) (setq mess "*")) | |
5730 (save-match-data | |
65680
ed770a0a7846
2005-09-24 Emilio C. Lopes <eclig@gmx.net>
Romain Francoise <romain@orebokech.com>
parents:
65582
diff
changeset
|
5731 (let* ((fmt-prompt "%s[%s] N-up printing (default 1): ") |
49646 | 5732 (prompt "") |
5733 (str (pr-f-read-string (format fmt-prompt prompt mess) "1" nil "1")) | |
5734 int) | |
5735 (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
|
5736 (setq int (string-to-number str) |
49646 | 5737 prompt (cond ((< int 1) "Integer below 1; ") |
5738 ((> int 100) "Integer above 100; ") | |
5739 (t nil))) | |
5740 (setq prompt "Invalid integer syntax; ")) | |
5741 (ding) | |
5742 (setq str | |
5743 (pr-f-read-string (format fmt-prompt prompt mess) str nil "1"))) | |
5744 int))) | |
5745 | |
5746 | |
5747 (defun pr-interactive-dir (mess) | |
5748 (let* ((dir-name (file-name-directory (or (buffer-file-name) | |
5749 default-directory))) | |
5750 (fmt-prompt (concat "%s[" mess "] Directory to print: ")) | |
5751 (dir (read-file-name (format fmt-prompt "") | |
5752 "" dir-name nil dir-name)) | |
5753 prompt) | |
5754 (while (cond ((not (file-directory-p dir)) | |
5755 (ding) | |
5756 (setq prompt "It's not a directory! ")) | |
5757 ((not (file-readable-p dir)) | |
5758 (ding) | |
5759 (setq prompt "Directory is unreadable! ")) | |
5760 (t nil)) | |
5761 (setq dir-name (file-name-directory dir) | |
5762 dir (read-file-name (format fmt-prompt prompt) | |
5763 "" dir-name nil dir-name))) | |
5764 (file-name-as-directory dir))) | |
5765 | |
5766 | |
5767 (defun pr-interactive-regexp (mess) | |
5768 (pr-f-read-string (format "[%s] File regexp to print: " mess) "" nil "")) | |
5769 | |
5770 | |
5771 (defun pr-interactive-dir-args (mess) | |
5772 (list | |
5773 ;; get directory argument | |
5774 (pr-interactive-dir mess) | |
5775 ;; get file name regexp | |
5776 (pr-interactive-regexp mess))) | |
5777 | |
5778 | |
5779 (defun pr-interactive-ps-dir-args (mess) | |
5780 (list | |
5781 ;; get n-up argument | |
5782 (pr-interactive-n-up mess) | |
5783 ;; get directory argument | |
5784 (pr-interactive-dir mess) | |
5785 ;; get file name regexp | |
5786 (pr-interactive-regexp mess) | |
5787 ;; get output file name | |
5788 (and (not pr-spool-p) | |
5789 (ps-print-preprint current-prefix-arg)))) | |
5790 | |
5791 | |
5792 (defun pr-interactive-n-up-file (mess) | |
5793 (list | |
5794 ;; get n-up argument | |
5795 (pr-interactive-n-up mess) | |
5796 ;; get output file name | |
5797 (and (not pr-spool-p) | |
5798 (ps-print-preprint current-prefix-arg)))) | |
5799 | |
5800 | |
5801 (defun pr-interactive-n-up-inout (mess) | |
5802 (list | |
5803 ;; get n-up argument | |
5804 (pr-interactive-n-up mess) | |
5805 ;; get input file name | |
5806 (pr-ps-infile-preprint (concat mess " ")) | |
5807 ;; get output file name | |
5808 (ps-print-preprint current-prefix-arg))) | |
5809 | |
5810 | |
5811 (defun pr-set-outfilename (filename-sym) | |
5812 (and (not pr-spool-p) | |
5813 (eq (symbol-value filename-sym) t) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
5814 (set filename-sym (and current-prefix-arg |
49646 | 5815 (ps-print-preprint current-prefix-arg)))) |
5816 (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
|
5817 (set filename-sym (pr-dosify-file-name (symbol-value filename-sym))))) |
49646 | 5818 |
5819 | |
5820 (defun pr-set-n-up-and-filename (n-up-sym filename-sym mess) | |
5821 ;; n-up | |
5822 (or (symbol-value n-up-sym) | |
5823 (set n-up-sym (pr-interactive-n-up mess))) | |
5824 ;; output file | |
5825 (pr-set-outfilename filename-sym)) | |
5826 | |
5827 | |
5828 (defun pr-set-dir-args (dir-sym regexp-sym mess) | |
5829 ;; directory | |
5830 (or (symbol-value dir-sym) | |
5831 (set dir-sym (pr-interactive-dir mess))) | |
5832 ;; file name regexp | |
5833 (or (symbol-value regexp-sym) | |
5834 (set regexp-sym (pr-interactive-regexp mess)))) | |
5835 | |
5836 | |
5837 (defun pr-set-ps-dir-args (n-up-sym dir-sym regexp-sym filename-sym mess) | |
5838 ;; n-up | |
5839 (or (symbol-value n-up-sym) | |
5840 (set n-up-sym (pr-interactive-n-up mess))) | |
5841 ;; directory & file name regexp | |
5842 (pr-set-dir-args dir-sym regexp-sym mess) | |
5843 ;; output file | |
5844 (pr-set-outfilename filename-sym)) | |
5845 | |
5846 | |
5847 (defun pr-find-buffer-visiting (file) | |
5848 (if (not (file-directory-p file)) | |
5849 (find-buffer-visiting (if ps-windows-system | |
5850 (downcase file) | |
5851 file)) | |
5852 (let ((truename (file-truename file)) | |
5853 (blist (buffer-list)) | |
5854 found) | |
5855 (while (and (not found) blist) | |
5856 (save-excursion | |
5857 (set-buffer (car blist)) | |
5858 (and (eq major-mode 'dired-mode) | |
5859 (save-excursion | |
5860 (goto-char (point-min)) | |
5861 (string= (buffer-substring-no-properties | |
5862 (+ (point-min) 2) | |
5863 (progn | |
5864 (end-of-line) | |
5865 (1- (point)))) | |
5866 truename)) | |
5867 (setq found (car blist)))) | |
5868 (setq blist (cdr blist))) | |
5869 found))) | |
5870 | |
5871 | |
5872 (defun pr-file-list (dir file-regexp fun) | |
5873 (mapcar #'(lambda (file) | |
5874 (and (or pr-list-directory | |
5875 (not (file-directory-p file))) | |
5876 (let ((buffer (pr-find-buffer-visiting file)) | |
5877 pop-up-windows | |
5878 pop-up-frames) | |
5879 (and (or buffer | |
5880 (file-readable-p file)) | |
5881 (save-excursion | |
5882 (set-buffer (or buffer | |
5883 (find-file-noselect file))) | |
5884 (funcall fun) | |
5885 (or buffer | |
5886 (kill-buffer (current-buffer)))))))) | |
5887 (directory-files dir t file-regexp))) | |
5888 | |
5889 | |
5890 (defun pr-delete-file-if-exists (filename) | |
5891 (and (not pr-spool-p) (stringp filename) (file-exists-p filename) | |
5892 (delete-file filename))) | |
5893 | |
5894 | |
5895 (defun pr-ps-file-list (n-up dir file-regexp filename) | |
5896 (pr-delete-file-if-exists (setq filename (pr-expand-file-name filename))) | |
5897 (let ((pr-spool-p t)) | |
5898 (pr-file-list dir file-regexp | |
5899 #'(lambda () | |
5900 (if (pr-auto-mode-p) | |
5901 (pr-ps-mode n-up filename) | |
5902 (pr-text2ps 'buffer n-up filename))))) | |
5903 (or pr-spool-p | |
5904 (pr-despool-print filename))) | |
5905 | |
5906 | |
5907 (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
|
5908 (pr-save-file-modes |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
5909 (let ((ps-n-up-printing n-up) |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
5910 (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
|
5911 'setpagedevice))) |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
5912 (pr-delete-file-if-exists filename) |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
5913 (cond (pr-faces-p |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
5914 (cond (pr-spool-p |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
5915 ;; pr-faces-p and pr-spool-p |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
5916 ;; here FILENAME arg is ignored |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
5917 (cond ((eq kind 'buffer) |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
5918 (ps-spool-buffer-with-faces)) |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
5919 ((eq kind 'region) |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
5920 (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
|
5921 (or to (mark)))) |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
5922 )) |
49646 | 5923 ;; 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
|
5924 ((eq kind 'buffer) |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
5925 (ps-print-buffer-with-faces filename)) |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
5926 ((eq kind 'region) |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
5927 (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
|
5928 (or to (mark)) filename)) |
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 (pr-spool-p |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
5931 ;; 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
|
5932 ;; here FILENAME arg is ignored |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
5933 (cond ((eq kind 'buffer) |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
5934 (ps-spool-buffer)) |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
5935 ((eq kind 'region) |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
5936 (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
|
5937 )) |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
5938 ;; 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
|
5939 ((eq kind 'buffer) |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
5940 (ps-print-buffer filename)) |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
5941 ((eq kind 'region) |
687bb63efa9d
interactive-p & file permission bits
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58164
diff
changeset
|
5942 (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
|
5943 )))) |
49646 | 5944 |
5945 | |
5946 (defun pr-command (command) | |
5947 "Return absolute file name specification for COMMAND. | |
5948 | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
5949 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
|
5950 |
49646 | 5951 If COMMAND is already an absolute file name specification, return it. |
5952 Else it uses `pr-path-alist' to find COMMAND, if find it then return it; | |
5953 otherwise, gives an error. | |
5954 | |
5955 When using `pr-path-alist' to find COMMAND, the entries `cygwin', `windows' and | |
5956 `unix' are used (see `pr-path-alist' for documentation). | |
5957 | |
5958 If Emacs is running on Windows 95/98/NT/2000, tries to find COMMAND, | |
5959 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
|
5960 (if (string= command "") |
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
5961 command |
56405
10b68aa88abe
Doc fix. Change name of some funs.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
56390
diff
changeset
|
5962 (pr-dosify-file-name |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
5963 (or (pr-find-command command) |
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
5964 (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
|
5965 (ps-windows-system 'windows) |
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
5966 (t 'unix)) |
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
5967 (file-name-nondirectory command) |
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
5968 nil) |
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
5969 (error "Command not found: %s" |
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
5970 (file-name-nondirectory command)))))) |
49646 | 5971 |
5972 | |
5973 (defun pr-path-command (symbol command sym-list) | |
5974 (let ((lpath (cdr (assq symbol pr-path-alist))) | |
5975 cmd) | |
5976 ;; PATH expansion | |
5977 (and (eq symbol 'PATH) (null lpath) | |
5978 (setq lpath (parse-colon-path (getenv "PATH")))) | |
5979 (while (and lpath | |
5980 (not | |
5981 (setq cmd | |
5982 (let ((path (car lpath))) | |
5983 (cond | |
5984 ;; symbol expansion | |
5985 ((symbolp path) | |
5986 (and (not (memq path sym-list)) | |
5987 (pr-path-command path command | |
5988 (cons path sym-list)))) | |
5989 ;; normal path | |
5990 ((stringp path) | |
5991 (pr-find-command | |
5992 (expand-file-name | |
5993 (substitute-in-file-name | |
5994 (concat (file-name-as-directory path) | |
5995 command))))) | |
5996 ))))) | |
5997 (setq lpath (cdr lpath))) | |
5998 cmd)) | |
5999 | |
6000 | |
6001 (defun pr-find-command (cmd) | |
6002 (if ps-windows-system | |
6003 ;; windows system | |
6004 (let ((ext (cons (file-name-extension cmd t) | |
6005 (list ".exe" ".bat" ".com"))) | |
6006 found) | |
6007 (setq cmd (file-name-sans-extension cmd)) | |
6008 (while (and ext | |
6009 (setq found (concat cmd (car ext))) | |
6010 (not (and (file-regular-p found) | |
6011 (file-executable-p found)))) | |
6012 (setq ext (cdr ext) | |
6013 found nil)) | |
6014 found) | |
6015 ;; non-windows systems | |
6016 (and (file-regular-p cmd) | |
6017 (file-executable-p cmd) | |
6018 cmd))) | |
6019 | |
6020 | |
6021 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
6022 ;; Printing Interface (inspired on ps-print-interface.el) | |
6023 | |
6024 | |
82253
e100ad942371
Evaluate require only during compilation
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
82140
diff
changeset
|
6025 (eval-when-compile |
e100ad942371
Evaluate require only during compilation
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
82140
diff
changeset
|
6026 (require 'cus-edit) |
e100ad942371
Evaluate require only during compilation
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
82140
diff
changeset
|
6027 (require 'wid-edit) |
e100ad942371
Evaluate require only during compilation
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
82140
diff
changeset
|
6028 (require 'widget)) |
49646 | 6029 |
6030 | |
6031 (defvar pr-i-window-configuration nil) | |
6032 | |
6033 (defvar pr-i-buffer nil) | |
6034 (defvar pr-i-region nil) | |
6035 (defvar pr-i-mode nil) | |
6036 (defvar pr-i-despool nil) | |
6037 (defvar pr-i-ps-as-is t) | |
6038 (defvar pr-i-n-up 1) | |
6039 (defvar pr-i-directory "./") | |
6040 (defvar pr-i-regexp "") | |
6041 (defvar pr-i-ps-file "") | |
6042 (defvar pr-i-out-file "") | |
6043 (defvar pr-i-answer-yes nil) | |
6044 (defvar pr-i-process 'buffer) | |
6045 (defvar pr-i-ps-send 'printer) | |
6046 | |
6047 | |
6048 (defvar pr-interface-map nil | |
6049 "Keymap for pr-interface.") | |
6050 | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
6051 (unless pr-interface-map |
49646 | 6052 (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
|
6053 (cond ((featurep 'xemacs) ; XEmacs |
49646 | 6054 (pr-f-set-keymap-parents pr-interface-map (list widget-keymap)) |
6055 (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
|
6056 (t ; GNU Emacs |
49646 | 6057 (pr-f-set-keymap-parents pr-interface-map widget-keymap))) |
6058 (define-key pr-interface-map "q" 'pr-interface-quit) | |
6059 (define-key pr-interface-map "?" 'pr-interface-help)) | |
6060 | |
6061 | |
6062 (defmacro pr-interface-save (&rest body) | |
6063 `(save-excursion | |
6064 (set-buffer pr-i-buffer) | |
6065 ,@body)) | |
6066 | |
6067 | |
6068 (defun pr-create-interface () | |
6069 "Create the front end for printing package." | |
6070 (setq pr-i-buffer (buffer-name (current-buffer)) | |
6071 pr-i-region (ps-mark-active-p) | |
6072 pr-i-mode (pr-mode-alist-p) | |
6073 pr-i-window-configuration (current-window-configuration)) | |
6074 | |
6075 (put 'pr-i-process 'pr-widget-list nil) | |
6076 (put 'pr-i-ps-send 'pr-widget-list nil) | |
6077 | |
6078 (delete-other-windows) | |
6079 (kill-buffer (get-buffer-create pr-buffer-name)) | |
6080 (switch-to-buffer (get-buffer-create pr-buffer-name)) | |
6081 | |
6082 ;; header | |
6083 (let ((versions (concat "printing v" pr-version | |
6084 " ps-print v" ps-print-version))) | |
73827
985f3831f360
Fix Print submenu creation
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
73770
diff
changeset
|
6085 ;; to keep compatibility with Emacs 20 & 21: |
985f3831f360
Fix Print submenu creation
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
73770
diff
changeset
|
6086 ;; DO NOT REPLACE `?\ ' BY `?\s' |
985f3831f360
Fix Print submenu creation
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
73770
diff
changeset
|
6087 (widget-insert (make-string (- 79 (length versions)) ?\ ) versions)) |
49646 | 6088 (pr-insert-italic "\nCurrent Directory : " 1) |
6089 (pr-insert-italic default-directory) | |
6090 | |
6091 (pr-insert-section-1) ; 1. Print | |
6092 (pr-insert-section-2) ; 2. PostScript Printer | |
6093 (pr-insert-section-3) ; 3. Text Printer | |
6094 | |
6095 ;; separator | |
6096 (widget-insert "\n\n " (make-string 77 ?-)) | |
6097 | |
6098 (pr-insert-section-4) ; 4. Settings | |
6099 (pr-insert-section-5) ; 5. Customize | |
6100 (pr-insert-section-6) ; 6. Show Settings | |
6101 (pr-insert-section-7) ; 7. Help | |
6102 | |
6103 (use-local-map pr-interface-map) | |
6104 (widget-setup) | |
6105 (goto-char (point-min)) | |
6106 | |
6107 (and pr-i-region ; let region activated | |
6108 (pr-keep-region-active))) | |
6109 | |
6110 | |
6111 (defun pr-insert-section-1 () | |
6112 ;; 1. Print: | |
6113 (pr-insert-italic "\nPrint :" 1) | |
6114 | |
6115 ;; 1a. Buffer: | |
6116 ;; 1a. Buffer: Buffer List | |
6117 (pr-insert-radio-button 'pr-i-process 'buffer) | |
6118 (pr-insert-menu "Buffer List" 'pr-i-buffer | |
6119 (let ((blist (buffer-list)) | |
6120 case-fold-search choices) | |
6121 (while blist | |
6122 (let ((name (buffer-name (car blist))) | |
6123 (ignore pr-buffer-name-ignore) | |
6124 found) | |
6125 (setq blist (cdr blist)) | |
6126 (while (and ignore (not found)) | |
6127 (setq found (string-match (car ignore) name) | |
6128 ignore (cdr ignore))) | |
6129 (or found | |
6130 (setq choices | |
6131 (cons (list 'quote | |
6132 (list 'choice-item | |
6133 :format "%[%t%]" | |
6134 name)) | |
6135 choices))))) | |
6136 (nreverse choices)) | |
6137 " Buffer : " nil | |
6138 '(progn | |
6139 (pr-interface-save | |
6140 (setq pr-i-region (ps-mark-active-p) | |
6141 pr-i-mode (pr-mode-alist-p))) | |
6142 (pr-update-checkbox 'pr-i-region) | |
6143 (pr-update-checkbox 'pr-i-mode))) | |
6144 ;; 1a. Buffer: Region | |
6145 (put 'pr-i-region 'pr-widget | |
6146 (pr-insert-checkbox | |
6147 "\n " | |
6148 'pr-i-region | |
6149 #'(lambda (widget &rest ignore) | |
6150 (let ((region-p (pr-interface-save | |
6151 (ps-mark-active-p)))) | |
6152 (cond ((null (widget-value widget)) ; widget is nil | |
6153 (setq pr-i-region nil)) | |
6154 (region-p ; widget is true and there is a region | |
6155 (setq pr-i-region t) | |
6156 (widget-value-set widget t) | |
6157 (widget-setup)) ; MUST be called after widget-value-set | |
6158 (t ; widget is true and there is no region | |
6159 (ding) | |
6160 (message "There is no region active") | |
6161 (setq pr-i-region nil) | |
6162 (widget-value-set widget nil) | |
6163 (widget-setup))))) ; MUST be called after widget-value-set | |
6164 " Region")) | |
6165 ;; 1a. Buffer: Mode | |
6166 (put 'pr-i-mode 'pr-widget | |
6167 (pr-insert-checkbox | |
6168 " " | |
6169 'pr-i-mode | |
6170 #'(lambda (widget &rest ignore) | |
6171 (let ((mode-p (pr-interface-save | |
6172 (pr-mode-alist-p)))) | |
6173 (cond | |
6174 ((null (widget-value widget)) ; widget is nil | |
6175 (setq pr-i-mode nil)) | |
6176 (mode-p ; widget is true and there is a `mode' | |
6177 (setq pr-i-mode t) | |
6178 (widget-value-set widget t) | |
6179 (widget-setup)) ; MUST be called after widget-value-set | |
6180 (t ; widget is true and there is no `mode' | |
6181 (ding) | |
6182 (message | |
6183 "This buffer isn't in a mode that printing treats specially.") | |
6184 (setq pr-i-mode nil) | |
6185 (widget-value-set widget nil) | |
6186 (widget-setup))))) ; MUST be called after widget-value-set | |
6187 " Mode\n")) | |
6188 | |
6189 ;; 1b. Directory: | |
6190 (pr-insert-radio-button 'pr-i-process 'directory) | |
6191 (widget-create | |
6192 'directory | |
6193 :size 58 | |
6194 :format " Directory : %v" | |
6195 :notify 'pr-interface-directory | |
6196 :action (lambda (widget &optional event) | |
6197 (if (pr-interface-directory widget) | |
6198 (pr-widget-field-action widget event) | |
6199 (ding) | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
6200 (message "Please specify a readable directory"))) |
49646 | 6201 pr-i-directory) |
6202 ;; 1b. Directory: File Regexp | |
6203 (widget-create 'regexp | |
6204 :size 58 | |
6205 :format "\n File Regexp : %v\n" | |
6206 :notify (lambda (widget &rest ignore) | |
6207 (setq pr-i-regexp (widget-value widget))) | |
6208 pr-i-regexp) | |
6209 ;; 1b. Directory: List Directory Entry | |
6210 (widget-insert " ") | |
6211 (pr-insert-toggle 'pr-list-directory " List Directory Entry\n") | |
6212 | |
6213 ;; 1c. PostScript File: | |
6214 (pr-insert-radio-button 'pr-i-process 'file) | |
6215 (widget-create | |
6216 'file | |
6217 :size 51 | |
6218 :format " PostScript File : %v" | |
6219 :notify 'pr-interface-infile | |
6220 :action (lambda (widget &rest event) | |
6221 (if (pr-interface-infile widget) | |
6222 (pr-widget-field-action widget event) | |
6223 (ding) | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
6224 (message "Please specify a readable PostScript file"))) |
49646 | 6225 pr-i-ps-file) |
6226 ;; 1c. PostScript File: PostScript Utility | |
6227 (pr-insert-menu "PostScript Utility" 'pr-ps-utility | |
6228 (pr-choice-alist pr-ps-utility-alist) | |
6229 "\n PostScript Utility : " | |
6230 " ") | |
54210
602769168263
Replace "As Is..." in PostScript file print/preview by "No Preprocessing...".
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54209
diff
changeset
|
6231 ;; 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
|
6232 (pr-insert-toggle 'pr-i-ps-as-is " No Preprocessing")) |
49646 | 6233 |
6234 | |
6235 (defun pr-insert-section-2 () | |
6236 ;; 2. PostScript Printer: | |
6237 ;; 2. PostScript Printer: PostScript Printer List | |
6238 (pr-insert-italic "\n\nPostScript Printer : " 2 20) | |
6239 (pr-insert-menu "PostScript Printer" 'pr-ps-name | |
6240 (pr-choice-alist pr-ps-printer-alist)) | |
6241 ;; 2. PostScript Printer: Despool | |
6242 (put 'pr-i-despool 'pr-widget | |
6243 (pr-insert-checkbox | |
6244 " " | |
6245 'pr-i-despool | |
6246 #'(lambda (widget &rest ignore) | |
6247 (if pr-spool-p | |
6248 (setq pr-i-despool (not pr-i-despool)) | |
6249 (ding) | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
6250 (message "Can despool only when spooling is actually selected") |
49646 | 6251 (setq pr-i-despool nil)) |
6252 (widget-value-set widget pr-i-despool) | |
6253 (widget-setup)) ; MUST be called after widget-value-set | |
6254 " Despool ")) | |
6255 ;; 2. PostScript Printer: Preview Print Quit | |
6256 (pr-insert-button 'pr-interface-preview "Preview" " ") | |
6257 (pr-insert-button 'pr-interface-ps-print "Print" " ") | |
6258 (pr-insert-button 'pr-interface-quit "Quit") | |
6259 ;; 2. PostScript Printer: Send to Printer/Temporary File | |
6260 (pr-insert-radio-button 'pr-i-ps-send 'printer) | |
6261 (widget-insert " Send to Printer/Temporary File") | |
6262 ;; 2. PostScript Printer: Send to File | |
6263 (pr-insert-radio-button 'pr-i-ps-send 'file) | |
6264 (widget-create | |
6265 'file | |
6266 :size 57 | |
6267 :format " Send to File : %v" | |
6268 :notify 'pr-interface-outfile | |
6269 :action (lambda (widget &rest event) | |
6270 (if (and (pr-interface-outfile widget) | |
6271 (or (not (file-exists-p pr-i-out-file)) | |
6272 (setq pr-i-answer-yes | |
6273 (y-or-n-p "File exists; overwrite? ")))) | |
6274 (pr-widget-field-action widget event) | |
6275 (ding) | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
6276 (message "Please specify a writable PostScript file"))) |
49646 | 6277 pr-i-out-file) |
6278 ;; 2. PostScript Printer: N-Up | |
6279 (widget-create | |
6280 'integer | |
6281 :size 3 | |
6282 :format "\n N-Up : %v" | |
6283 :notify (lambda (widget &rest ignore) | |
6284 (let ((value (if (string= (widget-apply widget :value-get) "") | |
6285 0 | |
6286 (widget-value widget)))) | |
6287 (if (and (integerp value) | |
6288 (<= 1 value) (<= value 100)) | |
6289 (progn | |
6290 (message " ") | |
6291 (setq pr-i-n-up value)) | |
6292 (ding) | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
6293 (message "Please specify an integer between 1 and 100")))) |
49646 | 6294 pr-i-n-up)) |
6295 | |
6296 | |
6297 (defun pr-insert-section-3 () | |
6298 ;; 3. Text Printer: | |
6299 (pr-insert-italic "\n\nText Printer : " 2 14) | |
6300 (pr-insert-menu "Text Printer" 'pr-txt-name | |
6301 (pr-choice-alist pr-txt-printer-alist) | |
6302 nil " ") | |
6303 (pr-insert-button 'pr-interface-printify "Printify" " ") | |
6304 (pr-insert-button 'pr-interface-txt-print "Print" " ") | |
6305 (pr-insert-button 'pr-interface-quit "Quit")) | |
6306 | |
6307 | |
6308 (defun pr-insert-section-4 () | |
6309 ;; 4. Settings: | |
6310 ;; 4. Settings: Landscape Auto Region Verbose | |
6311 (pr-insert-checkbox "\n\n " 'ps-landscape-mode | |
6312 #'(lambda (&rest ignore) | |
6313 (setq ps-landscape-mode (not ps-landscape-mode) | |
6314 pr-file-landscape ps-landscape-mode)) | |
6315 " Landscape ") | |
6316 (pr-insert-toggle 'pr-auto-region " Auto Region ") | |
6317 (pr-insert-toggle 'pr-buffer-verbose " Verbose\n ") | |
6318 | |
6319 ;; 4. Settings: Print Header Auto Mode | |
6320 (pr-insert-toggle 'ps-print-header " Print Header ") | |
6321 (pr-insert-toggle 'pr-auto-mode " Auto Mode\n ") | |
6322 | |
6323 ;; 4. Settings: Print Header Frame Menu Lock | |
6324 (pr-insert-toggle 'ps-print-header-frame " Print Header Frame ") | |
6325 (pr-insert-toggle 'pr-menu-lock " Menu Lock\n ") | |
6326 | |
6327 ;; 4. Settings: Line Number | |
6328 (pr-insert-toggle 'ps-line-number " Line Number\n ") | |
6329 | |
6330 ;; 4. Settings: Zebra Stripes Spool Buffer | |
6331 (pr-insert-toggle 'ps-zebra-stripes " Zebra Stripes") | |
6332 (pr-insert-checkbox " " | |
6333 'pr-spool-p | |
6334 #'(lambda (&rest ignore) | |
6335 (setq pr-spool-p (not pr-spool-p)) | |
6336 (unless pr-spool-p | |
6337 (setq pr-i-despool nil) | |
6338 (pr-update-checkbox 'pr-i-despool))) | |
6339 " Spool Buffer") | |
6340 | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
6341 ;; 4. Settings: Duplex Print with faces |
49646 | 6342 (pr-insert-checkbox "\n " |
6343 'ps-spool-duplex | |
6344 #'(lambda (&rest ignore) | |
6345 (setq ps-spool-duplex (not ps-spool-duplex) | |
6346 pr-file-duplex ps-spool-duplex)) | |
6347 " Duplex ") | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
6348 (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
|
6349 |
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
6350 ;; 4. Settings: Tumble Print via Ghostscript |
49646 | 6351 (pr-insert-checkbox "\n " |
6352 'ps-spool-tumble | |
6353 #'(lambda (&rest ignore) | |
6354 (setq ps-spool-tumble (not ps-spool-tumble) | |
6355 pr-file-tumble ps-spool-tumble)) | |
6356 " Tumble ") | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
6357 (pr-insert-toggle 'pr-print-using-ghostscript " Print via Ghostscript\n ") |
49646 | 6358 |
6359 ;; 4. Settings: Upside-Down Page Parity | |
54209
c312c950b64d
Adjust buffer interface.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54146
diff
changeset
|
6360 (pr-insert-toggle 'ps-print-upside-down " Upside-Down") |
c312c950b64d
Adjust buffer interface.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
54146
diff
changeset
|
6361 (pr-insert-italic "\n\nSelect Pages : " 2 14) |
49646 | 6362 (pr-insert-menu "Page Parity" 'ps-even-or-odd-pages |
6363 (mapcar #'(lambda (alist) | |
6364 (list 'quote | |
6365 (list 'choice-item | |
6366 :format "%[%t%]" | |
6367 :tag (cdr alist) | |
6368 :value (car alist)))) | |
6369 pr-even-or-odd-alist))) | |
6370 | |
6371 | |
6372 (defun pr-insert-section-5 () | |
6373 ;; 5. Customize: | |
6374 (pr-insert-italic "\n\nCustomize : " 2 11) | |
6375 (pr-insert-button 'pr-customize "printing" " ") | |
6376 (pr-insert-button #'(lambda (&rest ignore) (ps-print-customize)) | |
6377 "ps-print" " ") | |
6378 (pr-insert-button 'lpr-customize "lpr")) | |
6379 | |
6380 | |
6381 (defun pr-insert-section-6 () | |
6382 ;; 6. Show Settings: | |
6383 (pr-insert-italic "\nShow Settings : " 1 14) | |
6384 (pr-insert-button 'pr-show-pr-setup "printing" " ") | |
6385 (pr-insert-button 'pr-show-ps-setup "ps-print" " ") | |
6386 (pr-insert-button 'pr-show-lpr-setup "lpr")) | |
6387 | |
6388 | |
6389 (defun pr-insert-section-7 () | |
6390 ;; 7. Help: | |
6391 (pr-insert-italic "\nHelp : " 1 5) | |
6392 (pr-insert-button 'pr-interface-help "Interface Help" " ") | |
6393 (pr-insert-button 'pr-help "Menu Help" " ") | |
6394 (pr-insert-button 'pr-interface-quit "Quit" "\n ") | |
6395 (pr-insert-button 'pr-kill-help "Kill All Printing Help Buffer")) | |
6396 | |
6397 | |
6398 (defun pr-kill-help (&rest ignore) | |
6399 "Kill all printing help buffer." | |
6400 (interactive) | |
6401 (let ((help '("*Printing Interface Help*" "*Printing Help*" | |
6402 "*LPR Setup*" "*PR Setup*" "*PS Setup*"))) | |
6403 (while help | |
6404 (let ((buffer (get-buffer (car help)))) | |
6405 (setq help (cdr help)) | |
6406 (when buffer | |
6407 (delete-windows-on buffer) | |
6408 (kill-buffer buffer))))) | |
6409 (recenter (- (window-height) 2))) | |
6410 | |
6411 | |
6412 (defun pr-interface-quit (&rest ignore) | |
6413 "Kill the printing buffer interface and quit." | |
6414 (interactive) | |
6415 (kill-buffer pr-buffer-name) | |
6416 (set-window-configuration pr-i-window-configuration)) | |
6417 | |
6418 | |
6419 (defun pr-interface-help (&rest ignore) | |
6420 "printing buffer interface help." | |
6421 (interactive) | |
6422 (pr-show-setup pr-interface-help-message "*Printing Interface Help*")) | |
6423 | |
6424 | |
6425 (defun pr-interface-txt-print (&rest ignore) | |
6426 "Print using lpr package." | |
6427 (interactive) | |
6428 (condition-case data | |
6429 (cond | |
6430 ((eq pr-i-process 'directory) | |
6431 (pr-i-directory) | |
6432 (pr-interface-save | |
6433 (pr-txt-directory pr-i-directory pr-i-regexp))) | |
6434 ((eq pr-i-process 'buffer) | |
6435 (pr-interface-save | |
6436 (cond (pr-i-region | |
6437 (let ((pr-auto-mode pr-i-mode)) | |
6438 (pr-txt-region))) | |
6439 (pr-i-mode | |
6440 (let (pr-auto-region) | |
6441 (pr-txt-mode))) | |
6442 (t | |
6443 (let (pr-auto-mode pr-auto-region) | |
6444 (pr-txt-buffer))) | |
6445 ))) | |
6446 ((eq pr-i-process 'file) | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
6447 (error "Please specify a text file")) |
49646 | 6448 (t |
6449 (error "Internal error: `pr-i-process' = %S" pr-i-process)) | |
6450 ) | |
6451 ;; handlers | |
6452 ((quit error) | |
6453 (ding) | |
65582
4d1085b02d64
Message format spec fixes (1)
Deepak Goel <deego@gnufans.org>
parents:
64762
diff
changeset
|
6454 (message "%s" (error-message-string data))))) |
49646 | 6455 |
6456 | |
6457 (defun pr-interface-printify (&rest ignore) | |
6458 "Printify a buffer." | |
6459 (interactive) | |
6460 (condition-case data | |
6461 (cond | |
6462 ((eq pr-i-process 'directory) | |
6463 (pr-i-directory) | |
6464 (pr-interface-save | |
6465 (pr-printify-directory pr-i-directory pr-i-regexp))) | |
6466 ((eq pr-i-process 'buffer) | |
6467 (pr-interface-save | |
6468 (if pr-i-region | |
6469 (pr-printify-region) | |
6470 (pr-printify-buffer)))) | |
6471 ((eq pr-i-process 'file) | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
6472 (error "Cannot printify a PostScript file")) |
49646 | 6473 (t |
6474 (error "Internal error: `pr-i-process' = %S" pr-i-process)) | |
6475 ) | |
6476 ;; handlers | |
6477 ((quit error) | |
6478 (ding) | |
65582
4d1085b02d64
Message format spec fixes (1)
Deepak Goel <deego@gnufans.org>
parents:
64762
diff
changeset
|
6479 (message "%s" (error-message-string data))))) |
49646 | 6480 |
6481 | |
6482 (defun pr-interface-ps-print (&rest ignore) | |
6483 "Print using ps-print package." | |
6484 (interactive) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
6485 (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
|
6486 '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
|
6487 '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
|
6488 'pr-ps-buffer-ps-print)) |
49646 | 6489 |
6490 | |
6491 (defun pr-interface-preview (&rest ignore) | |
6492 "Preview a PostScript file." | |
6493 (interactive) | |
58306
561c3f4a39fe
interactive-p & eval-and-compile
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
58241
diff
changeset
|
6494 (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
|
6495 '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
|
6496 '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
|
6497 'pr-ps-buffer-preview)) |
49646 | 6498 |
6499 | |
6500 (defun pr-interface-ps (ps-despool ps-directory ps-file ps-file-up ps-region | |
6501 ps-mode ps-buffer) | |
6502 (condition-case data | |
6503 (let ((outfile (or (and (eq pr-i-process 'file) pr-i-ps-as-is) | |
6504 (pr-i-ps-send)))) | |
6505 (cond | |
6506 ((and pr-i-despool pr-spool-p) | |
6507 (pr-interface-save | |
6508 (funcall ps-despool outfile)) | |
6509 (setq pr-i-despool nil) | |
6510 (pr-update-checkbox 'pr-i-despool)) | |
6511 ((eq pr-i-process 'directory) | |
6512 (pr-i-directory) | |
6513 (pr-interface-save | |
6514 (funcall ps-directory | |
6515 pr-i-n-up pr-i-directory pr-i-regexp outfile))) | |
6516 ((eq pr-i-process 'file) | |
6517 (cond ((or (file-directory-p pr-i-ps-file) | |
6518 (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
|
6519 (error "Please specify a readable PostScript file")) |
49646 | 6520 (pr-i-ps-as-is |
6521 (pr-interface-save | |
6522 (funcall ps-file pr-i-ps-file))) | |
6523 (t | |
6524 (pr-interface-save | |
6525 (funcall ps-file-up pr-i-n-up pr-i-ps-file outfile))) | |
6526 )) | |
6527 ((eq pr-i-process 'buffer) | |
6528 (pr-interface-save | |
6529 (cond (pr-i-region | |
6530 (let ((pr-auto-mode pr-i-mode)) | |
6531 (funcall ps-region pr-i-n-up outfile))) | |
6532 (pr-i-mode | |
6533 (let (pr-auto-region) | |
6534 (funcall ps-mode pr-i-n-up outfile))) | |
6535 (t | |
6536 (let (pr-auto-mode pr-auto-region) | |
6537 (funcall ps-buffer pr-i-n-up outfile))) | |
6538 ))) | |
6539 (t | |
6540 (error "Internal error: `pr-i-process' = %S" pr-i-process)) | |
6541 )) | |
6542 ;; handlers | |
6543 ((quit error) | |
6544 (ding) | |
65582
4d1085b02d64
Message format spec fixes (1)
Deepak Goel <deego@gnufans.org>
parents:
64762
diff
changeset
|
6545 (message "%s" (error-message-string data))))) |
49646 | 6546 |
6547 | |
6548 (defun pr-i-ps-send () | |
6549 (cond ((eq pr-i-ps-send 'printer) | |
6550 nil) | |
6551 ((not (eq pr-i-ps-send 'file)) | |
6552 (error "Internal error: `pr-i-ps-send' = %S" pr-i-ps-send)) | |
6553 ((or (file-directory-p pr-i-out-file) | |
6554 (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
|
6555 (error "Please specify a writable PostScript file")) |
49646 | 6556 ((or (not (file-exists-p pr-i-out-file)) |
6557 pr-i-answer-yes | |
6558 (setq pr-i-answer-yes | |
6559 (y-or-n-p (format "File `%s' exists; overwrite? " | |
6560 pr-i-out-file)))) | |
6561 pr-i-out-file) | |
6562 (t | |
6563 (error "File already exists")))) | |
6564 | |
6565 | |
6566 (defun pr-i-directory () | |
6567 (or (and (file-directory-p pr-i-directory) | |
6568 (file-readable-p pr-i-directory)) | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
6569 (error "Please specify be a readable directory"))) |
49646 | 6570 |
6571 | |
6572 (defun pr-interface-directory (widget &rest ignore) | |
6573 (and pr-buffer-verbose | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
6574 (message "You can use M-TAB or ESC TAB for file completion")) |
49646 | 6575 (let ((dir (widget-value widget))) |
6576 (and (file-directory-p dir) | |
6577 (file-readable-p dir) | |
6578 (setq pr-i-directory dir)))) | |
6579 | |
6580 | |
6581 (defun pr-interface-infile (widget &rest ignore) | |
6582 (and pr-buffer-verbose | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
6583 (message "You can use M-TAB or ESC TAB for file completion")) |
49646 | 6584 (let ((file (widget-value widget))) |
6585 (and (not (file-directory-p file)) | |
6586 (file-readable-p file) | |
6587 (setq pr-i-ps-file file)))) | |
6588 | |
6589 | |
6590 (defun pr-interface-outfile (widget &rest ignore) | |
6591 (setq pr-i-answer-yes nil) | |
6592 (and pr-buffer-verbose | |
54146
2a5eca2838d1
A lot of doc fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
52401
diff
changeset
|
6593 (message "You can use M-TAB or ESC TAB for file completion")) |
49646 | 6594 (let ((file (widget-value widget))) |
6595 (and (not (file-directory-p file)) | |
6596 (file-writable-p file) | |
6597 (setq pr-i-out-file file)))) | |
6598 | |
6599 | |
6600 (defun pr-widget-field-action (widget event) | |
6601 (and (get-buffer "*Completions*") ; clean frame window | |
6602 (delete-windows-on "*Completions*")) | |
6603 (message " ") ; clean echo area | |
6604 (widget-field-action widget event)) | |
6605 | |
6606 | |
6607 (defun pr-insert-italic (str &optional from to) | |
6608 (let ((len (length str))) | |
6609 (put-text-property (if from (max from 0) 0) | |
6610 (if to (max to len) len) | |
6611 'face 'italic str) | |
6612 (widget-insert str))) | |
6613 | |
6614 | |
6615 (defun pr-insert-checkbox (before var-sym fun label) | |
6616 (widget-insert before) | |
6617 (prog1 | |
6618 (widget-create 'checkbox | |
6619 :notify fun | |
6620 (symbol-value var-sym)) | |
6621 (widget-insert label))) | |
6622 | |
6623 | |
6624 (defun pr-insert-toggle (var-sym label) | |
6625 (widget-create 'checkbox | |
6626 :notify `(lambda (&rest ignore) | |
6627 (setq ,var-sym (not ,var-sym))) | |
6628 (symbol-value var-sym)) | |
6629 (widget-insert label)) | |
6630 | |
6631 | |
6632 (defun pr-insert-button (fun label &optional separator) | |
6633 (widget-create 'push-button | |
6634 :notify fun | |
6635 label) | |
6636 (and separator | |
6637 (widget-insert separator))) | |
6638 | |
6639 | |
6640 (defun pr-insert-menu (tag var-sym choices &optional before after &rest body) | |
6641 (and before (widget-insert before)) | |
6642 (eval `(widget-create 'menu-choice | |
6643 :tag ,tag | |
6644 :format "%v" | |
6645 :inline t | |
6646 :value ,var-sym | |
6647 :notify (lambda (widget &rest ignore) | |
6648 (setq ,var-sym (widget-value widget)) | |
6649 ,@body) | |
6650 :void '(choice-item :format "%[%t%]" | |
6651 :tag "Can not display value!") | |
6652 ,@choices)) | |
6653 (and after (widget-insert after))) | |
6654 | |
6655 | |
6656 (defun pr-insert-radio-button (var-sym sym) | |
6657 (widget-insert "\n") | |
6658 (let ((wid-list (get var-sym 'pr-widget-list)) | |
6659 (wid (eval `(widget-create | |
6660 'radio-button | |
6661 :format " %[%v%]" | |
6662 :value (eq ,var-sym (quote ,sym)) | |
6663 :notify (lambda (&rest ignore) | |
6664 (setq ,var-sym (quote ,sym)) | |
6665 (pr-update-radio-button (quote ,var-sym))))))) | |
6666 (put var-sym 'pr-widget-list (cons (cons wid sym) wid-list)))) | |
6667 | |
6668 | |
6669 (defun pr-update-radio-button (var-sym) | |
6670 (let ((wid-list (get var-sym 'pr-widget-list))) | |
6671 (while wid-list | |
6672 (let ((wid (car (car wid-list))) | |
6673 (value (cdr (car wid-list)))) | |
6674 (setq wid-list (cdr wid-list)) | |
6675 (widget-value-set wid (eq (symbol-value var-sym) value)))) | |
6676 (widget-setup))) | |
6677 | |
6678 | |
6679 (defun pr-update-checkbox (var-sym) | |
6680 (let ((wid (get var-sym 'pr-widget))) | |
6681 (when wid | |
6682 (widget-value-set wid (symbol-value var-sym)) | |
6683 (widget-setup)))) | |
6684 | |
6685 | |
6686 (defun pr-choice-alist (alist) | |
6687 (let ((max (apply 'max (mapcar #'(lambda (alist) | |
6688 (length (symbol-name (car alist)))) | |
6689 alist)))) | |
6690 (mapcar #'(lambda (alist) | |
6691 (let* ((sym (car alist)) | |
6692 (name (symbol-name sym))) | |
6693 (list | |
6694 'quote | |
6695 (list | |
6696 'choice-item | |
6697 :format "%[%t%]" | |
6698 :tag (concat name | |
6699 (make-string (- max (length name)) ?_)) | |
6700 :value sym)))) | |
6701 alist))) | |
6702 | |
6703 | |
6704 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
6705 | |
6706 | |
6707 (provide 'printing) | |
6708 | |
6709 | |
58138
a93efc8bd56c
(pr-get-symbol): Don't downcase.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
57241
diff
changeset
|
6710 ;; arch-tag: 9ce9ac3f-0f60-4370-900b-1943215d9d18 |
49646 | 6711 ;;; printing.el ends here |