aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1998-07-03 19:54:17 +0000
committerRichard M. Stallman1998-07-03 19:54:17 +0000
commit8748e3eb55f67993162e14448fdef5c26b01bfbd (patch)
treedc7d1f4f0deac5bb43102753c7563cfa8c37224c
parent5a0aa6443e4e04d351fb97872ddc44e81e74b272 (diff)
downloademacs-8748e3eb55f67993162e14448fdef5c26b01bfbd.tar.gz
emacs-8748e3eb55f67993162e14448fdef5c26b01bfbd.zip
(printer-name): New variable.
(lpr-switches): Mention it in docstring. (print-region-1): Use it.
-rw-r--r--lisp/lpr.el24
1 files changed, 23 insertions, 1 deletions
diff --git a/lisp/lpr.el b/lisp/lpr.el
index dbefaa938ef..b6f650c765a 100644
--- a/lisp/lpr.el
+++ b/lisp/lpr.el
@@ -26,7 +26,7 @@
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
@@ -34,10 +34,30 @@
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
43On Unix-like systems, a string value should be a name understood by
44lpr's -P option.
45
46On MS-DOS and MS-Windows systems, it is the name of a printer device or
47port. Typical non-default settings would be \"LPT1\" to \"LPT3\" for
48parallel printers, or \"COM1\" to \"COM4\" or \"AUX\" for serial
49printers, or \"//hostname/printer\" for a shared network printer. You
50can also set it to a name of a file, in which case the output gets
51appended to that file. If you want to discard the printed output, set
52this 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.
59It is recommended to set `printer-name' instead of including an explicit
60switch on this list.
41See `lpr-command'." 61See `lpr-command'."
42 :type '(repeat (string :tag "Argument")) 62 :type '(repeat (string :tag "Argument"))
43 :group 'lpr) 63 :group 'lpr)
@@ -170,6 +190,8 @@ The variable `lpr-page-header-program' specifies the program to use."
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))