(lpr-page-header-switches): Page title switch is one of them.
authorEli Zaretskii <eliz@gnu.org>
Sat, 9 Sep 2006 10:40:27 +0000 (10:40 +0000)
committerEli Zaretskii <eliz@gnu.org>
Sat, 9 Sep 2006 10:40:27 +0000 (10:40 +0000)
(print-region-1): Substitute `%s' with the page title.

lisp/ChangeLog
lisp/lpr.el

index 7f7c3c7..a52ffeb 100644 (file)
@@ -1,3 +1,8 @@
+2006-09-09  Micha\e,Ak\e(Bl Cadilhac  <michael.cadilhac@lrde.org>
+
+       * lpr.el (lpr-page-header-switches): Page title switch is one of them.
+       (print-region-1): Substitute `%s' with the page title.
+
 2006-09-09  Matt Hodges  <MPHodges@member.fsf.org>
 
        * locate.el (locate-current-search): New variable.
index 14d1049..dd39eb2 100644 (file)
@@ -140,8 +140,9 @@ See definition of `print-region-1' for calling conventions."
 
 ;; Berkeley systems support -F, and GNU pr supports both -f and -F,
 ;; So it looks like -F is a better default.
-(defcustom lpr-page-header-switches '("-F")
-  "*List of strings to use as options for the page-header-generating program.
+(defcustom lpr-page-header-switches '("-h %s" "-F")
+  "List of strings to use as options for the page-header-generating program.
+If `%s' appears in one of the strings, it is substituted by the page title.
 The variable `lpr-page-header-program' specifies the program to use."
   :type '(repeat string)
   :group 'lpr)
@@ -243,8 +244,8 @@ for further customization of the printer command."
            (let ((new-coords (print-region-new-buffer start end)))
              (apply 'call-process-region (car new-coords) (cdr new-coords)
                     lpr-page-header-program t t nil
-                    (nconc (list "-h" title)
-                           lpr-page-header-switches)))
+                    (mapcar (lambda (e) (format e title))
+                            lpr-page-header-switches)))
            (setq start (point-min)
                  end   (point-max))))
       (apply (or print-region-function 'call-process-region)