comparison lisp/lpr.el @ 72747:4dea9a34fd2e

(lpr-page-header-switches): Page title switch is one of them. (print-region-1): Substitute `%s' with the page title.
author Eli Zaretskii <eliz@gnu.org>
date Sat, 09 Sep 2006 10:39:45 +0000
parents 3bd95f4f2941
children 575850f5bd53 a1a25ac6c88a
comparison
equal deleted inserted replaced
72746:e9b964af66d4 72747:4dea9a34fd2e
138 :type 'string 138 :type 'string
139 :group 'lpr) 139 :group 'lpr)
140 140
141 ;; Berkeley systems support -F, and GNU pr supports both -f and -F, 141 ;; Berkeley systems support -F, and GNU pr supports both -f and -F,
142 ;; So it looks like -F is a better default. 142 ;; So it looks like -F is a better default.
143 (defcustom lpr-page-header-switches '("-F") 143 (defcustom lpr-page-header-switches '("-h %s" "-F")
144 "*List of strings to use as options for the page-header-generating program. 144 "List of strings to use as options for the page-header-generating program.
145 If `%s' appears in one of the strings, it is substituted by the page title.
145 The variable `lpr-page-header-program' specifies the program to use." 146 The variable `lpr-page-header-program' specifies the program to use."
146 :type '(repeat string) 147 :type '(repeat string)
147 :group 'lpr) 148 :group 'lpr)
148 149
149 ;;;###autoload 150 ;;;###autoload
241 nil 242 nil
242 ;; Run a separate program to get page headers. 243 ;; Run a separate program to get page headers.
243 (let ((new-coords (print-region-new-buffer start end))) 244 (let ((new-coords (print-region-new-buffer start end)))
244 (apply 'call-process-region (car new-coords) (cdr new-coords) 245 (apply 'call-process-region (car new-coords) (cdr new-coords)
245 lpr-page-header-program t t nil 246 lpr-page-header-program t t nil
246 (nconc (list "-h" title) 247 (mapcar (lambda (e) (format e title))
247 lpr-page-header-switches))) 248 lpr-page-header-switches)))
248 (setq start (point-min) 249 (setq start (point-min)
249 end (point-max)))) 250 end (point-max))))
250 (apply (or print-region-function 'call-process-region) 251 (apply (or print-region-function 'call-process-region)
251 (nconc (list start end lpr-command 252 (nconc (list start end lpr-command
252 nil nil nil) 253 nil nil nil)