Mercurial > emacs
comparison lisp/lpr.el @ 22679:08902da4c832
(printer-name): New variable.
(lpr-switches): Mention it in docstring.
(print-region-1): Use it.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Fri, 03 Jul 1998 19:54:17 +0000 |
parents | c1f86e273a38 |
children | 359e6eb97e11 |
comparison
equal
deleted
inserted
replaced
22678:e3fe83134880 | 22679:08902da4c832 |
---|---|
24 | 24 |
25 ;;; Commentary: | 25 ;;; Commentary: |
26 | 26 |
27 ;; Commands to send the region or a buffer your printer. Entry points | 27 ;; Commands to send the region or a buffer your printer. Entry points |
28 ;; are `lpr-buffer', `print-buffer', lpr-region', or `print-region'; option | 28 ;; are `lpr-buffer', `print-buffer', lpr-region', or `print-region'; option |
29 ;; variables include `lpr-switches' and `lpr-command'. | 29 ;; variables include `printer-name', `lpr-switches' and `lpr-command'. |
30 | 30 |
31 ;;; Code: | 31 ;;; Code: |
32 | 32 |
33 (defgroup lpr nil | 33 (defgroup lpr nil |
34 "Print Emacs buffer on line printer" | 34 "Print Emacs buffer on line printer" |
35 :group 'wp) | 35 :group 'wp) |
36 | 36 |
37 ;;;###autoload | |
38 (defcustom printer-name | |
39 (if (memq system-type '(ms-dos windows-nt)) "PRN") | |
40 "*The name of a local printer to which data is sent for printing. | |
41 \(Note that PostScript files are sent to `ps-printer-name', which see.\) | |
42 | |
43 On Unix-like systems, a string value should be a name understood by | |
44 lpr's -P option. | |
45 | |
46 On MS-DOS and MS-Windows systems, it is the name of a printer device or | |
47 port. Typical non-default settings would be \"LPT1\" to \"LPT3\" for | |
48 parallel printers, or \"COM1\" to \"COM4\" or \"AUX\" for serial | |
49 printers, or \"//hostname/printer\" for a shared network printer. You | |
50 can also set it to a name of a file, in which case the output gets | |
51 appended to that file. If you want to discard the printed output, set | |
52 this to \"NUL\"." | |
53 :type 'file ; could use string but then we lose completion for files. | |
54 :group 'lpr) | |
37 | 55 |
38 ;;;###autoload | 56 ;;;###autoload |
39 (defcustom lpr-switches nil | 57 (defcustom lpr-switches nil |
40 "*List of strings to pass as extra options for the printer program. | 58 "*List of strings to pass as extra options for the printer program. |
59 It is recommended to set `printer-name' instead of including an explicit | |
60 switch on this list. | |
41 See `lpr-command'." | 61 See `lpr-command'." |
42 :type '(repeat (string :tag "Argument")) | 62 :type '(repeat (string :tag "Argument")) |
43 :group 'lpr) | 63 :group 'lpr) |
44 | 64 |
45 (defcustom lpr-add-switches (eq system-type 'berkeley-unix) | 65 (defcustom lpr-add-switches (eq system-type 'berkeley-unix) |
168 (nconc (and lpr-add-switches | 188 (nconc (and lpr-add-switches |
169 (list "-J" name)) | 189 (list "-J" name)) |
170 ;; These belong in pr if we are using that. | 190 ;; These belong in pr if we are using that. |
171 (and lpr-add-switches lpr-headers-switches | 191 (and lpr-add-switches lpr-headers-switches |
172 (list "-T" title)) | 192 (list "-T" title)) |
193 (and (stringp printer-name) | |
194 (list (concat "-P" printer-name))) | |
173 switches))) | 195 switches))) |
174 (if (markerp end) | 196 (if (markerp end) |
175 (set-marker end nil)) | 197 (set-marker end nil)) |
176 (message "Spooling%s...done" switch-string)))) | 198 (message "Spooling%s...done" switch-string)))) |
177 | 199 |