Mercurial > emacs
comparison lisp/ps-print.el @ 22680:3cf03f32956c
(ps-printer-name): New variable.
(ps-do-despool): Use it.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Fri, 03 Jul 1998 19:54:30 +0000 |
parents | b926b360d222 |
children | 75c35003c69f |
comparison
equal
deleted
inserted
replaced
22679:08902da4c832 | 22680:3cf03f32956c |
---|---|
920 :prefix "ps-" | 920 :prefix "ps-" |
921 :tag "PS Faces" | 921 :tag "PS Faces" |
922 :group 'ps-print | 922 :group 'ps-print |
923 :group 'faces) | 923 :group 'faces) |
924 | 924 |
925 | |
926 (defcustom ps-printer-name printer-name | |
927 "*The name of a local printer for printing PostScript files. | |
928 | |
929 On Unix-like systems, a string value should be a name understood by | |
930 lpr's -P option; otherwise the value should be nil. | |
931 | |
932 On MS-DOS and MS-Windows systems, if the value is a string, then it is | |
933 taken as the name of the device to which PostScript files are written. | |
934 By default it is the same as `printer-name'; typical non-default | |
935 settings 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 | |
938 it to a name of a file, in which case the output gets appended to that | |
939 file. \(Note that `ps-print' package already has facilities for | |
940 printing to a file, so you might as well use them instead of changing | |
941 the setting of this variable.\) If you want to silently discard the | |
942 printed output, set this to \"NUL\". | |
943 | |
944 On DOS/Windows, if the value is anything but a string, PostScript files | |
945 will be piped to the program given by `ps-lpr-command', with switches | |
946 given by `ps-lpr-switches', which see." | |
947 :type '(choice file (other :tag "Pipe to ps-lpr-command" pipe)) | |
948 :group 'ps-print) | |
925 | 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 |
929 :group 'ps-print) | 953 :group 'ps-print) |
3979 (and ps-razzle-dazzle (message "Wrote %s" filename))) | 4003 (and ps-razzle-dazzle (message "Wrote %s" filename))) |
3980 ;; Else, spool to the printer | 4004 ;; Else, spool to the printer |
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) |
3992 nil | 4027 nil |
3993 (ps-flatten-list ; dynamic evaluation | 4028 (ps-flatten-list ; dynamic evaluation |