diff options
author | Richard M. Stallman <rms@gnu.org> | 1993-12-23 03:14:40 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1993-12-23 03:14:40 +0000 |
commit | 908b5ffee4460436b3c80387c02d97828adadaca (patch) | |
tree | 0b8952b0afbb76c5abb0354c08c9a354e399c8a0 /lisp/lpr.el | |
parent | c6c73cdee32260fad44090a6d70a78fdb5d87d88 (diff) | |
download | emacs-908b5ffee4460436b3c80387c02d97828adadaca.tar.gz |
(lpr-headers-switches): Treat hpux like usg-unix-v.
(print-region-1): Adjust start, end after running pr.
(lpr-command): Use dgux, not dgux-unix.
(print-region-new-buffer): Rename args to OSTART and OEND.
(lpr-headers-switches): New variable.
(print-region-1): Use it.
(lpr-add-options): New variable.
(print-region-1): Obey that.
Diffstat (limited to 'lisp/lpr.el')
-rw-r--r-- | lisp/lpr.el | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/lisp/lpr.el b/lisp/lpr.el index 6e92289709d..7fa9d912e22 100644 --- a/lisp/lpr.el +++ b/lisp/lpr.el @@ -31,14 +31,20 @@ ;;;###autoload (defvar lpr-switches nil - "*List of strings to pass as extra switch args to lpr when it is invoked.") + "*List of strings to pass as extra switch args to `lpr' when it is invoked.") + +(defvar lpr-add-options (eq system-type 'berkeley-unix) + "*Non-nil means construct -T and -J options for the `lpr'.") ;;;###autoload (defvar lpr-command - (if (memq system-type '(usg-unix-v dgux-unix hpux irix)) + (if (memq system-type '(usg-unix-v dgux hpux irix)) "lp" "lpr") "*Shell command for printing a file") +(defvar lpr-headers-switches (or (memq system-type '(usg-unix-v hpux)) "-p") + "*List of strings to use as options for `lpr' to request page headings.") + (defvar print-region-function nil "Function to call to print the region on a printer. See definition of `print-region-1' for calling conventions.") @@ -85,16 +91,16 @@ See definition of `print-region-1' for calling conventions.") (setq end (point-marker))) (untabify (point-min) (point-max)))) (if page-headers - (if (eq system-type 'usg-unix-v) - (progn - (print-region-new-buffer start end) - (call-process-region start end "pr" t t nil)) - ;; On BSD, use an option to get page headers. - (setq switches (cons "-p" switches)))) + (if lpr-headers-switches + ;; On BSD, use an option to get page headers. + (setq switches (append lpr-headers-switches switches)) + (print-region-new-buffer start end) + (call-process-region start end "pr" t t nil) + (setq start (point-min) end (point-max)))) (apply (or print-region-function 'call-process-region) (nconc (list start end lpr-command nil nil nil) - (nconc (and (eq system-type 'berkeley-unix) + (nconc (and lpr-add-options (list "-J" name "-T" name)) switches))) (if (markerp end) @@ -105,12 +111,12 @@ See definition of `print-region-1' for calling conventions.") ;; into a new buffer, makes that buffer current, ;; and sets start and end to the buffer bounds. ;; start and end are used free. -(defun print-region-new-buffer (start end) +(defun print-region-new-buffer (ostart oend) (or (string= (buffer-name) " *spool temp*") (let ((oldbuf (current-buffer))) (set-buffer (get-buffer-create " *spool temp*")) (widen) (erase-buffer) - (insert-buffer-substring oldbuf start end) + (insert-buffer-substring oldbuf ostart oend) (setq start (point-min) end (point-max))))) (defun printify-region (begin end) |