(image-mode-current-vscroll, image-mode-current-hscroll): Make buffer-local.
[bpt/emacs.git] / lisp / lpr.el
index c44971e..9e9de8c 100644 (file)
@@ -1,7 +1,7 @@
 ;;; lpr.el --- print Emacs buffer on line printer
 
 ;; Copyright (C) 1985, 1988, 1992, 1994, 2001, 2002, 2003,
-;;   2004, 2005 Free Software Foundation, Inc.
+;;   2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
 
 ;; Maintainer: FSF
 ;; Keywords: unix
@@ -10,7 +10,7 @@
 
 ;; GNU Emacs is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
+;; the Free Software Foundation; either version 3, or (at your option)
 ;; any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
@@ -37,7 +37,7 @@
 
 ;;;###autoload
 (defvar lpr-lp-system
-  (memq system-type '(usg-unix-v dgux hpux irix)))
+  (memq system-type '(usg-unix-v hpux irix)))
 
 
 (defgroup lpr nil
@@ -47,7 +47,7 @@
 
 ;;;###autoload
 (defcustom printer-name
-  (and lpr-windows-system "PRN")
+  (and (memq system-type '(emx ms-dos)) "PRN")
   "*The name of a local printer to which data is sent for printing.
 \(Note that PostScript files are sent to `ps-printer-name', which see.\)
 
@@ -140,8 +140,10 @@ 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")
+(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 any of the strings, it is substituted by the page title.
+Note that for correct quoting, `%s' should normally be a separate element.
 The variable `lpr-page-header-program' specifies the program to use."
   :type '(repeat string)
   :group 'lpr)
@@ -243,8 +245,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)