aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1998-07-03 19:54:30 +0000
committerRichard M. Stallman1998-07-03 19:54:30 +0000
commit038205144ec744d5e49ed108fce7daca8634138c (patch)
treebf6b7672176c485c98de8335ddca24a62f3c1b3d
parent8748e3eb55f67993162e14448fdef5c26b01bfbd (diff)
downloademacs-038205144ec744d5e49ed108fce7daca8634138c.tar.gz
emacs-038205144ec744d5e49ed108fce7daca8634138c.zip
(ps-printer-name): New variable.
(ps-do-despool): Use it.
-rw-r--r--lisp/ps-print.el43
1 files changed, 39 insertions, 4 deletions
diff --git a/lisp/ps-print.el b/lisp/ps-print.el
index b792eaf87cc..d5478d7da5b 100644
--- a/lisp/ps-print.el
+++ b/lisp/ps-print.el
@@ -923,6 +923,30 @@ Please send all bug fixes and enhancements to
923 :group 'faces) 923 :group 'faces)
924 924
925 925
926(defcustom ps-printer-name printer-name
927 "*The name of a local printer for printing PostScript files.
928
929On Unix-like systems, a string value should be a name understood by
930lpr's -P option; otherwise the value should be nil.
931
932On MS-DOS and MS-Windows systems, if the value is a string, then it is
933taken as the name of the device to which PostScript files are written.
934By default it is the same as `printer-name'; typical non-default
935settings would be \"LPT1\" to \"LPT3\" for parallel printers, or
936\"COM1\" to \"COM4\" or \"AUX\" for serial printers, or
937\"//hostname/printer\" for a shared network printer. You can also set
938it to a name of a file, in which case the output gets appended to that
939file. \(Note that `ps-print' package already has facilities for
940printing to a file, so you might as well use them instead of changing
941the setting of this variable.\) If you want to silently discard the
942printed output, set this to \"NUL\".
943
944On DOS/Windows, if the value is anything but a string, PostScript files
945will be piped to the program given by `ps-lpr-command', with switches
946given by `ps-lpr-switches', which see."
947 :type '(choice file (other :tag "Pipe to ps-lpr-command" pipe))
948 :group 'ps-print)
949
926(defcustom ps-lpr-command lpr-command 950(defcustom ps-lpr-command lpr-command
927 "*The shell command for printing a PostScript file." 951 "*The shell command for printing a PostScript file."
928 :type 'string 952 :type 'string
@@ -3981,11 +4005,22 @@ If FACE is not a valid face name, it is used default face."
3981 (and ps-razzle-dazzle (message "Printing...")) 4005 (and ps-razzle-dazzle (message "Printing..."))
3982 (save-excursion 4006 (save-excursion
3983 (set-buffer ps-spool-buffer) 4007 (set-buffer ps-spool-buffer)
3984 (let ((coding-system-for-write 'raw-text-unix)) 4008 (let ((coding-system-for-write 'raw-text-unix)
3985 (if (and (eq system-type 'ms-dos) 4009 (ps-lpr-switches
3986 (stringp (symbol-value 'dos-ps-printer))) 4010 (append
4011 (and (stringp ps-printer-name)
4012 (list (concat "-P" ps-printer-name)))
4013 ps-lpr-switches)))
4014 (if (and (memq system-type '(ms-dos windows-nt))
4015 (or (and (boundp 'dos-ps-printer)
4016 (stringp (symbol-value 'dos-ps-printer)))
4017 (stringp (symbol-value 'ps-printer-name))))
3987 (write-region (point-min) (point-max) 4018 (write-region (point-min) (point-max)
3988 (symbol-value 'dos-ps-printer) t 0) 4019 (or (and (boundp 'dos-ps-printer)
4020 (stringp (symbol-value 'dos-ps-printer))
4021 (symbol-value 'dos-ps-printer))
4022 (symbol-value 'ps-printer-name))
4023 t 0)
3989 (apply 'call-process-region 4024 (apply 'call-process-region
3990 (point-min) (point-max) ps-lpr-command nil 4025 (point-min) (point-max) ps-lpr-command nil
3991 (and (fboundp 'start-process) 0) 4026 (and (fboundp 'start-process) 0)