aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1995-02-02 21:12:06 +0000
committerRichard M. Stallman1995-02-02 21:12:06 +0000
commit7173ec778ed04cb9f0150cc0116d3fb46649d382 (patch)
tree78acbde4fd24b1c84c00b21043ec03bcce473f65
parente86fe0d7893ddc1998668d1dfc8cd8440ed365a5 (diff)
downloademacs-7173ec778ed04cb9f0150cc0116d3fb46649d382.tar.gz
emacs-7173ec778ed04cb9f0150cc0116d3fb46649d382.zip
(lpr-headers-switches): Default is nil.
-rw-r--r--lisp/lpr.el13
1 files changed, 9 insertions, 4 deletions
diff --git a/lisp/lpr.el b/lisp/lpr.el
index c5d9bb2205e..bab4e2e5a04 100644
--- a/lisp/lpr.el
+++ b/lisp/lpr.el
@@ -42,9 +42,12 @@
42 "lp" "lpr") 42 "lp" "lpr")
43 "*Name of program for printing a file.") 43 "*Name of program for printing a file.")
44 44
45(defvar lpr-headers-switches 45;; Default is nil, because that enables us to use pr -f
46 (if (equal lpr-command "lpr") '("-p") nil) 46;; which is more reliable than pr with no args, which is what lpr -p does.
47 "*List of strings to use as options for `lpr' to request page headings.") 47(defvar lpr-headers-switches nil
48 "*List of strings to use as options for `lpr' to request page headings.
49If nil, we run `lpr-page-header-program' to make page headings
50and print the result.")
48 51
49(defvar print-region-function nil 52(defvar print-region-function nil
50 "Function to call to print the region on a printer. 53 "Function to call to print the region on a printer.
@@ -103,11 +106,13 @@ See definition of `print-region-1' for calling conventions.")
103 (untabify (point-min) (point-max)))) 106 (untabify (point-min) (point-max))))
104 (if page-headers 107 (if page-headers
105 (if lpr-headers-switches 108 (if lpr-headers-switches
106 ;; On BSD, use an option to get page headers. 109 ;; It is possible to use an lpr option
110 ;; to get page headers.
107 (setq switches (append (if (stringp lpr-headers-switches) 111 (setq switches (append (if (stringp lpr-headers-switches)
108 (list lpr-headers-switches) 112 (list lpr-headers-switches)
109 lpr-headers-switches) 113 lpr-headers-switches)
110 switches)) 114 switches))
115 ;; Run a separate program to get page headers.
111 (print-region-new-buffer start end) 116 (print-region-new-buffer start end)
112 (call-process-region start end lpr-page-header-program 117 (call-process-region start end lpr-page-header-program
113 t t lpr-page-header-options) 118 t t lpr-page-header-options)