From 908b5ffee4460436b3c80387c02d97828adadaca Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Thu, 23 Dec 1993 03:14:40 +0000 Subject: (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. --- lisp/lpr.el | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) (limited to 'lisp/lpr.el') 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) -- cgit v1.2.1