diff options
| author | Richard M. Stallman | 1993-12-23 03:14:40 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1993-12-23 03:14:40 +0000 |
| commit | 3a621cfedc04fd82e489d0200e21b6db0cc74903 (patch) | |
| tree | c803490775b14227cd56d7e08a4d8989bd4bd3dc | |
| parent | 3591cb551bfcd96af19a963d4cca9b7781c5e425 (diff) | |
| download | emacs-3a621cfedc04fd82e489d0200e21b6db0cc74903.tar.gz emacs-3a621cfedc04fd82e489d0200e21b6db0cc74903.zip | |
(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.
| -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 @@ | |||
| 31 | 31 | ||
| 32 | ;;;###autoload | 32 | ;;;###autoload |
| 33 | (defvar lpr-switches nil | 33 | (defvar lpr-switches nil |
| 34 | "*List of strings to pass as extra switch args to lpr when it is invoked.") | 34 | "*List of strings to pass as extra switch args to `lpr' when it is invoked.") |
| 35 | |||
| 36 | (defvar lpr-add-options (eq system-type 'berkeley-unix) | ||
| 37 | "*Non-nil means construct -T and -J options for the `lpr'.") | ||
| 35 | 38 | ||
| 36 | ;;;###autoload | 39 | ;;;###autoload |
| 37 | (defvar lpr-command | 40 | (defvar lpr-command |
| 38 | (if (memq system-type '(usg-unix-v dgux-unix hpux irix)) | 41 | (if (memq system-type '(usg-unix-v dgux hpux irix)) |
| 39 | "lp" "lpr") | 42 | "lp" "lpr") |
| 40 | "*Shell command for printing a file") | 43 | "*Shell command for printing a file") |
| 41 | 44 | ||
| 45 | (defvar lpr-headers-switches (or (memq system-type '(usg-unix-v hpux)) "-p") | ||
| 46 | "*List of strings to use as options for `lpr' to request page headings.") | ||
| 47 | |||
| 42 | (defvar print-region-function nil | 48 | (defvar print-region-function nil |
| 43 | "Function to call to print the region on a printer. | 49 | "Function to call to print the region on a printer. |
| 44 | See definition of `print-region-1' for calling conventions.") | 50 | See definition of `print-region-1' for calling conventions.") |
| @@ -85,16 +91,16 @@ See definition of `print-region-1' for calling conventions.") | |||
| 85 | (setq end (point-marker))) | 91 | (setq end (point-marker))) |
| 86 | (untabify (point-min) (point-max)))) | 92 | (untabify (point-min) (point-max)))) |
| 87 | (if page-headers | 93 | (if page-headers |
| 88 | (if (eq system-type 'usg-unix-v) | 94 | (if lpr-headers-switches |
| 89 | (progn | 95 | ;; On BSD, use an option to get page headers. |
| 90 | (print-region-new-buffer start end) | 96 | (setq switches (append lpr-headers-switches switches)) |
| 91 | (call-process-region start end "pr" t t nil)) | 97 | (print-region-new-buffer start end) |
| 92 | ;; On BSD, use an option to get page headers. | 98 | (call-process-region start end "pr" t t nil) |
| 93 | (setq switches (cons "-p" switches)))) | 99 | (setq start (point-min) end (point-max)))) |
| 94 | (apply (or print-region-function 'call-process-region) | 100 | (apply (or print-region-function 'call-process-region) |
| 95 | (nconc (list start end lpr-command | 101 | (nconc (list start end lpr-command |
| 96 | nil nil nil) | 102 | nil nil nil) |
| 97 | (nconc (and (eq system-type 'berkeley-unix) | 103 | (nconc (and lpr-add-options |
| 98 | (list "-J" name "-T" name)) | 104 | (list "-J" name "-T" name)) |
| 99 | switches))) | 105 | switches))) |
| 100 | (if (markerp end) | 106 | (if (markerp end) |
| @@ -105,12 +111,12 @@ See definition of `print-region-1' for calling conventions.") | |||
| 105 | ;; into a new buffer, makes that buffer current, | 111 | ;; into a new buffer, makes that buffer current, |
| 106 | ;; and sets start and end to the buffer bounds. | 112 | ;; and sets start and end to the buffer bounds. |
| 107 | ;; start and end are used free. | 113 | ;; start and end are used free. |
| 108 | (defun print-region-new-buffer (start end) | 114 | (defun print-region-new-buffer (ostart oend) |
| 109 | (or (string= (buffer-name) " *spool temp*") | 115 | (or (string= (buffer-name) " *spool temp*") |
| 110 | (let ((oldbuf (current-buffer))) | 116 | (let ((oldbuf (current-buffer))) |
| 111 | (set-buffer (get-buffer-create " *spool temp*")) | 117 | (set-buffer (get-buffer-create " *spool temp*")) |
| 112 | (widen) (erase-buffer) | 118 | (widen) (erase-buffer) |
| 113 | (insert-buffer-substring oldbuf start end) | 119 | (insert-buffer-substring oldbuf ostart oend) |
| 114 | (setq start (point-min) end (point-max))))) | 120 | (setq start (point-min) end (point-max))))) |
| 115 | 121 | ||
| 116 | (defun printify-region (begin end) | 122 | (defun printify-region (begin end) |