]> code.delx.au - gnu-emacs/blobdiff - lisp/lpr.el
(Man-filter-list): Recognize "Rev" footers.
[gnu-emacs] / lisp / lpr.el
index e331060e9b9567c773f314d70c926144d32731dc..1c8d7c2e8c96d49f2559f166cfdf1f0a2eb696cc 100644 (file)
 
 ;;;###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 options for the printer program.
+See `lpr-command'.")
 
 (defvar lpr-add-switches (eq system-type 'berkeley-unix)
-  "*Non-nil means construct -T and -J options for the `lpr'.")
+  "*Non-nil means construct -T and -J options for the printer program.
+These are made assuming that the program is `lpr';
+if you are using some other incompatible printer program,
+this variable should be nil.")
 
 ;;;###autoload
 (defvar lpr-command
@@ -45,7 +49,7 @@
 ;; Default is nil, because that enables us to use pr -f
 ;; which is more reliable than pr with no args, which is what lpr -p does.
 (defvar lpr-headers-switches nil
-  "*List of strings to use as options for `lpr' to request page headings.
+  "*List of strings of options to request page headings in the printer program.
 If nil, we run `lpr-page-header-program' to make page headings
 and print the result.")
 
@@ -57,7 +61,8 @@ See definition of `print-region-1' for calling conventions.")
   "*Name of program for adding page headers to a file.")
 
 (defvar lpr-page-header-switches '("-f")
-  "*List of strings to use as options for `lpr-page-header-program'.")
+  "*List of strings to use as options for the page-header-generating program.
+The variable `lpr-page-header-program' specifies the program to use.")
 
 ;;;###autoload
 (defun lpr-buffer ()
@@ -93,9 +98,22 @@ See definition of `print-region-1' for calling conventions.")
   ;; and it seems to annoying to do for that MIPS system.
   (let ((name (concat (buffer-name) " Emacs buffer"))
        (title (concat (buffer-name) " Emacs buffer"))
-       (width tab-width))
+       (width tab-width)
+       switch-string)
     (save-excursion
-      (message "Spooling...")
+      (if page-headers
+         (if lpr-headers-switches
+             ;; It is possible to use an lpr option
+             ;; to get page headers.
+             (setq switches (append (if (stringp lpr-headers-switches)
+                                        (list lpr-headers-switches)
+                                       lpr-headers-switches)
+                                    switches))))
+      (setq switch-string
+           (if switches (concat " with options "
+                                (mapconcat 'identity switches " "))
+             ""))
+      (message "Spooling%s..." switch-string)
       (if (/= tab-width 8)
          (let ((new-coords (print-region-new-buffer start end)))
            (setq start (car new-coords) end (cdr new-coords))
@@ -106,12 +124,8 @@ See definition of `print-region-1' for calling conventions.")
            (untabify (point-min) (point-max))))
       (if page-headers
          (if lpr-headers-switches
-             ;; It is possible to use an lpr option
-             ;; to get page headers.
-             (setq switches (append (if (stringp lpr-headers-switches)
-                                        (list lpr-headers-switches)
-                                       lpr-headers-switches)
-                                    switches))
+             ;; We handled this above by modifying SWITCHES.
+             nil
            ;; Run a separate program to get page headers.
            (let ((new-coords (print-region-new-buffer start end)))
              (setq start (car new-coords) end (cdr new-coords)))
@@ -132,7 +146,7 @@ See definition of `print-region-1' for calling conventions.")
                           switches)))
       (if (markerp end)
          (set-marker end nil))
-      (message "Spooling...done"))))
+      (message "Spooling%s...done" switch-string))))
 
 ;; This function copies the text between start and end
 ;; into a new buffer, makes that buffer current.
@@ -164,4 +178,6 @@ hexadecimal escapes."
             (format "\\^%c" (+ c ?@))
           (format "\\%02x" c)))))))
 
+(provide 'lpr)
+
 ;;; lpr.el ends here