mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2025-01-13 16:38:14 +00:00
(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.
This commit is contained in:
parent
3591cb551b
commit
3a621cfedc
28
lisp/lpr.el
28
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)
|
||||
|
Loading…
Reference in New Issue
Block a user