]> git.eshelyaron.com Git - emacs.git/commitdiff
(lpr-headers-switches): Treat hpux like usg-unix-v.
authorRichard M. Stallman <rms@gnu.org>
Thu, 23 Dec 1993 03:14:40 +0000 (03:14 +0000)
committerRichard M. Stallman <rms@gnu.org>
Thu, 23 Dec 1993 03:14:40 +0000 (03:14 +0000)
(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

index 6e92289709da63db230c51da4cb3aaf2a37fe721..7fa9d912e227e67421db7845572f1a6465360727 100644 (file)
 
 ;;;###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)