* lisp/emacs-lisp/package.el (list-packages): Fix echo area message.
[bpt/emacs.git] / lisp / printing.el
index 22af718..9f98c2b 100644 (file)
@@ -1,7 +1,6 @@
 ;;; printing.el --- printing utilities
 
 ;;; printing.el --- printing utilities
 
-;; Copyright (C) 2000, 2001, 2003, 2004, 2005,
-;;   2006, 2007, 2008 Free Software Foundation, Inc.
+;; Copyright (C) 2000-2001, 2003-2011  Free Software Foundation, Inc.
 
 ;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br>
 ;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br>
 
 ;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br>
 ;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br>
@@ -18,19 +17,18 @@ Please send all bug fixes and enhancements to
 
 ;; This file is part of GNU Emacs.
 
 
 ;; This file is part of GNU Emacs.
 
-;; 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 3, or (at your option) any later
-;; version.
+;; 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 3 of the License, or
+;; (at your option) any later version.
 
 
-;; GNU Emacs is distributed in the hope that it will be useful, but WITHOUT ANY
-;; WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-;; FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
-;; details.
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
 
 
-;; You should have received a copy of the GNU General Public License along with
-;; GNU Emacs; see the file COPYING.  If not, write to the Free Software
-;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 
 ;;; Commentary:
 
 
 ;;; Commentary:
 
@@ -1388,20 +1386,6 @@ Used by `pr-menu-bind' and `pr-update-menus'.")
     (require 'easymenu))               ; to avoid compilation gripes
 
   (eval-and-compile
     (require 'easymenu))               ; to avoid compilation gripes
 
   (eval-and-compile
-    (cond
-     ;; GNU Emacs 20
-     ((< emacs-major-version 21)
-      (defun pr-global-menubar (pr-menu-spec)
-       (require 'easymenu)
-       (easy-menu-change '("tools") "Printing" pr-menu-spec pr-menu-print-item)
-       (when pr-menu-print-item
-         (easy-menu-remove-item nil '("tools") pr-menu-print-item)
-         (setq pr-menu-print-item nil
-               pr-menu-bar (vector 'menu-bar 'tools
-                                   (pr-get-symbol "Printing")))))
-      )
-     ;; GNU Emacs 21 & 22
-     (t
       (defun pr-global-menubar (pr-menu-spec)
        (require 'easymenu)
        (let ((menu-file (if (= emacs-major-version 21)
       (defun pr-global-menubar (pr-menu-spec)
        (require 'easymenu)
        (let ((menu-file (if (= emacs-major-version 21)
@@ -1423,8 +1407,7 @@ Used by `pr-menu-bind' and `pr-update-menus'.")
           (t
            (easy-menu-add-item global-map menu-file
                                (easy-menu-create-menu "Print" pr-menu-spec)))
           (t
            (easy-menu-add-item global-map menu-file
                                (easy-menu-create-menu "Print" pr-menu-spec)))
-          )))
-      )))
+          ))))
 
   (eval-and-compile
     (cond
 
   (eval-and-compile
     (cond
@@ -1684,7 +1667,7 @@ separator; otherwise, ensure unix-style directory separator."
           ps-windows-system)
       'windows
     'unix)
           ps-windows-system)
       'windows
     'unix)
-  "*Specify which path style to use for external commands.
+  "Specify which path style to use for external commands.
 
 Valid values are:
 
 
 Valid values are:
 
@@ -1701,7 +1684,7 @@ Valid values are:
   '((unix    PATH)
     (cygwin  PATH)
     (windows PATH))
   '((unix    PATH)
     (cygwin  PATH)
     (windows PATH))
-  "*Specify an alist for command paths.
+  "Specify an alist for command paths.
 
 It's used to find commands used for printing package, like gv, gs, gsview.exe,
 mpage, print.exe, etc.  See also `pr-command' function.
 
 It's used to find commands used for printing package, like gv, gs, gsview.exe,
 mpage, print.exe, etc.  See also `pr-command' function.
@@ -1776,7 +1759,7 @@ Examples:
 
 
 (defcustom pr-txt-name 'default
 
 
 (defcustom pr-txt-name 'default
-  "*Specify a printer for printing a text file.
+  "Specify a printer for printing a text file.
 
 The printer name symbol should be defined on `pr-txt-printer-alist' (see it for
 documentation).
 
 The printer name symbol should be defined on `pr-txt-printer-alist' (see it for
 documentation).
@@ -1806,7 +1789,7 @@ function (see it for documentation) to update text printer menu."
   ;;      (PRN      ""          nil "PRN")
   ;;      (standard "redpr.exe" nil "")
   ;;      )
   ;;      (PRN      ""          nil "PRN")
   ;;      (standard "redpr.exe" nil "")
   ;;      )
-  "*Specify an alist of all text printers (text printer database).
+  "Specify an alist of all text printers (text printer database).
 
 The alist element has the form:
 
 
 The alist element has the form:
 
@@ -1922,7 +1905,7 @@ Useful links:
 
 
 (defcustom pr-ps-name 'default
 
 
 (defcustom pr-ps-name 'default
-  "*Specify a printer for printing a PostScript file.
+  "Specify a printer for printing a PostScript file.
 
 This printer name symbol should be defined on `pr-ps-printer-alist' (see it for
 documentation).
 
 This printer name symbol should be defined on `pr-ps-printer-alist' (see it for
 documentation).
@@ -1957,7 +1940,7 @@ function (see it for documentation) to update PostScript printer menu."
   ;;      (PRN      ""          nil ""    "PRN")
   ;;      (standard "redpr.exe" nil ""    "")
   ;;      )
   ;;      (PRN      ""          nil ""    "PRN")
   ;;      (standard "redpr.exe" nil ""    "")
   ;;      )
-  "*Specify an alist for all PostScript printers (PostScript printer database).
+  "Specify an alist for all PostScript printers (PostScript printer database).
 
 The alist element has the form:
 
 
 The alist element has the form:
 
@@ -2215,10 +2198,9 @@ Useful links:
      (file-name-as-directory
       (or (getenv "TMPDIR") (getenv "TMP") (getenv "TEMP")
          (cond (ps-windows-system "c:/temp")
      (file-name-as-directory
       (or (getenv "TMPDIR") (getenv "TMP") (getenv "TEMP")
          (cond (ps-windows-system "c:/temp")
-               ((memq system-type '(vax-vms axp-vms)) "SYS$SCRATCH:")
                (t "/tmp")
                )))))
                (t "/tmp")
                )))))
-  "*Specify a directory for temporary files during printing.
+  "Specify a directory for temporary files during printing.
 
 See also `pr-ps-temp-file' and `pr-file-modes'."
   :type '(directory :tag "Temporary Directory")
 
 See also `pr-ps-temp-file' and `pr-file-modes'."
   :type '(directory :tag "Temporary Directory")
@@ -2226,7 +2208,7 @@ See also `pr-ps-temp-file' and `pr-file-modes'."
 
 
 (defcustom pr-ps-temp-file "prspool-"
 
 
 (defcustom pr-ps-temp-file "prspool-"
-  "*Specify PostScript temporary file name prefix.
+  "Specify PostScript temporary file name prefix.
 
 See also `pr-temp-dir' and `pr-file-modes'."
   :type '(file :tag "PostScript Temporary File Name")
 
 See also `pr-temp-dir' and `pr-file-modes'."
   :type '(file :tag "PostScript Temporary File Name")
@@ -2237,7 +2219,7 @@ See also `pr-temp-dir' and `pr-file-modes'."
 ;; So, by default, only the session owner have permission to deal with files
 ;; generated by `printing'.
 (defcustom pr-file-modes ?\600
 ;; So, by default, only the session owner have permission to deal with files
 ;; generated by `printing'.
 (defcustom pr-file-modes ?\600
-  "*Specify the file permission bits for newly created files.
+  "Specify the file permission bits for newly created files.
 
 It should be an integer; only the low 9 bits are used.
 
 
 It should be an integer; only the low 9 bits are used.
 
@@ -2250,7 +2232,7 @@ See also `pr-temp-dir' and `pr-ps-temp-file'."
   (if ps-windows-system
       "gsview32.exe"
     "gv")
   (if ps-windows-system
       "gsview32.exe"
     "gv")
-  "*Specify path and name of the gsview/gv utility.
+  "Specify path and name of the gsview/gv utility.
 
 See also `pr-path-alist'.
 
 
 See also `pr-path-alist'.
 
@@ -2291,7 +2273,7 @@ Useful links:
   (if ps-windows-system
       "gswin32.exe"
     "gs")
   (if ps-windows-system
       "gswin32.exe"
     "gs")
-  "*Specify path and name of the ghostscript utility.
+  "Specify path and name of the ghostscript utility.
 
 See also `pr-path-alist'.
 
 
 See also `pr-path-alist'.
 
@@ -2317,7 +2299,7 @@ Useful links:
   (if ps-windows-system
       '("-q -dNOPAUSE -Ic:/gs/gs5.50;c:/gs/gs5.50/fonts")
     '("-q -dNOPAUSE -I/usr/share/ghostscript/5.10"))
   (if ps-windows-system
       '("-q -dNOPAUSE -Ic:/gs/gs5.50;c:/gs/gs5.50/fonts")
     '("-q -dNOPAUSE -I/usr/share/ghostscript/5.10"))
-  "*Specify ghostscript switches.  See the documentation on GS for more info.
+  "Specify ghostscript switches.  See the documentation on GS for more info.
 
 It's a list of strings, where each string is one or more ghostscript switches.
 
 
 It's a list of strings, where each string is one or more ghostscript switches.
 
@@ -2359,7 +2341,7 @@ Useful links:
   (if ps-windows-system
       "mswinpr2"
     "uniprint")
   (if ps-windows-system
       "mswinpr2"
     "uniprint")
-  "*Specify the ghostscript device switch value (-sDEVICE=).
+  "Specify the ghostscript device switch value (-sDEVICE=).
 
 A note on the gs switches:
 
 
 A note on the gs switches:
 
@@ -2372,7 +2354,7 @@ See also `pr-ps-printer-alist'."
 
 
 (defcustom pr-gs-resolution 300
 
 
 (defcustom pr-gs-resolution 300
-  "*Specify ghostscript resolution switch value (-r).
+  "Specify ghostscript resolution switch value (-r).
 
 A note on the gs switches:
 
 
 A note on the gs switches:
 
@@ -2385,7 +2367,7 @@ See also `pr-ps-printer-alist'."
 
 
 (defcustom pr-print-using-ghostscript nil
 
 
 (defcustom pr-print-using-ghostscript nil
-  "*Non-nil means print using ghostscript.
+  "Non-nil means print using ghostscript.
 
 This is useful if you don't have a PostScript printer, so you could use the
 ghostscript to print a PostScript file.
 
 This is useful if you don't have a PostScript printer, so you could use the
 ghostscript to print a PostScript file.
@@ -2397,31 +2379,31 @@ variable should be nil."
 
 
 (defcustom pr-faces-p nil
 
 
 (defcustom pr-faces-p nil
-  "*Non-nil means print with face attributes."
+  "Non-nil means print with face attributes."
   :type 'boolean
   :group 'printing)
 
 
 (defcustom pr-spool-p nil
   :type 'boolean
   :group 'printing)
 
 
 (defcustom pr-spool-p nil
-  "*Non-nil means spool printing in a buffer."
+  "Non-nil means spool printing in a buffer."
   :type 'boolean
   :group 'printing)
 
 
 (defcustom pr-file-landscape nil
   :type 'boolean
   :group 'printing)
 
 
 (defcustom pr-file-landscape nil
-  "*Non-nil means print PostScript file in landscape orientation."
+  "Non-nil means print PostScript file in landscape orientation."
   :type 'boolean
   :group 'printing)
 
 
 (defcustom pr-file-duplex nil
   :type 'boolean
   :group 'printing)
 
 
 (defcustom pr-file-duplex nil
-  "*Non-nil means print PostScript file in duplex mode."
+  "Non-nil means print PostScript file in duplex mode."
   :type 'boolean
   :group 'printing)
 
 
 (defcustom pr-file-tumble nil
   :type 'boolean
   :group 'printing)
 
 
 (defcustom pr-file-tumble nil
-  "*Non-nil means print PostScript file in tumble mode.
+  "Non-nil means print PostScript file in tumble mode.
 
 If tumble is off, produces a printing suitable for binding on the left or
 right.
 
 If tumble is off, produces a printing suitable for binding on the left or
 right.
@@ -2432,7 +2414,7 @@ bottom."
 
 
 (defcustom pr-auto-region t
 
 
 (defcustom pr-auto-region t
-  "*Non-nil means region is automagically detected.
+  "Non-nil means region is automagically detected.
 
 Note that this will only work if you're using transient mark mode.
 
 
 Note that this will only work if you're using transient mark mode.
 
@@ -2444,7 +2426,7 @@ marked instead of all buffer."
 
 
 (defcustom pr-auto-mode t
 
 
 (defcustom pr-auto-mode t
-  "*Non-nil means major-mode specific printing is prefered over normal printing.
+  "Non-nil means major-mode specific printing is prefered over normal printing.
 
 That is, if current major-mode is declared in `pr-mode-alist', the `*-buffer*'
 and `*-region*' commands will behave like `*-mode*' commands; otherwise,
 
 That is, if current major-mode is declared in `pr-mode-alist', the `*-buffer*'
 and `*-region*' commands will behave like `*-mode*' commands; otherwise,
@@ -2512,7 +2494,7 @@ will print the current region."
      nil
      )
     )
      nil
      )
     )
-  "*Specify an alist for a major-mode and printing functions.
+  "Specify an alist for a major-mode and printing functions.
 
 To customize a major mode printing, just declare the customization in
 `pr-mode-alist' and invoke some of `*-mode*' commands.  An example for major
 
 To customize a major mode printing, just declare the customization in
 `pr-mode-alist' and invoke some of `*-mode*' commands.  An example for major
@@ -2655,7 +2637,7 @@ DEFAULT           It's a way to set default values when this entry is selected.
 
 
 (defcustom pr-ps-utility 'mpage
 
 
 (defcustom pr-ps-utility 'mpage
-  "*Specify PostScript utility symbol.
+  "Specify PostScript utility symbol.
 
 This utility symbol should be defined on `pr-ps-utility-alist' (see it for
 documentation).
 
 This utility symbol should be defined on `pr-ps-utility-alist' (see it for
 documentation).
@@ -2686,7 +2668,7 @@ NOTE: Don't forget to download and install the utilities declared on
   ;;    '((psnup "c:/psutils/psnup" ("-q") "-P%s" "-%d" "-l" nil  nil " " nil
   ;;             (pr-file-duplex . nil) (pr-file-tumble . nil))
   ;;      )
   ;;    '((psnup "c:/psutils/psnup" ("-q") "-P%s" "-%d" "-l" nil  nil " " nil
   ;;             (pr-file-duplex . nil) (pr-file-tumble . nil))
   ;;      )
-  "*Specify an alist for PostScript utility processing (PS utility database).
+  "Specify an alist for PostScript utility processing (PS utility database).
 
 The alist element has the form:
 
 
 The alist element has the form:
 
@@ -2884,7 +2866,7 @@ Useful links:
 
 
 (defcustom pr-menu-lock t
 
 
 (defcustom pr-menu-lock t
-  "*Non-nil means menu is locked while selecting toggle options.
+  "Non-nil means menu is locked while selecting toggle options.
 
 See also `pr-menu-char-height' and `pr-menu-char-width'."
   :type 'boolean
 
 See also `pr-menu-char-height' and `pr-menu-char-width'."
   :type 'boolean
@@ -2892,7 +2874,7 @@ See also `pr-menu-char-height' and `pr-menu-char-width'."
 
 
 (defcustom pr-menu-char-height (pr-menu-char-height)
 
 
 (defcustom pr-menu-char-height (pr-menu-char-height)
-  "*Specify menu char height in pixels.
+  "Specify menu char height in pixels.
 
 This variable is used to guess which vertical position should be locked the
 menu, so don't forget to adjust it if menu position is not ok.
 
 This variable is used to guess which vertical position should be locked the
 menu, so don't forget to adjust it if menu position is not ok.
@@ -2903,7 +2885,7 @@ See also `pr-menu-lock' and `pr-menu-char-width'."
 
 
 (defcustom pr-menu-char-width (pr-menu-char-width)
 
 
 (defcustom pr-menu-char-width (pr-menu-char-width)
-  "*Specify menu char width in pixels.
+  "Specify menu char width in pixels.
 
 This variable is used to guess which horizontal position should be locked the
 menu, so don't forget to adjust it if menu position is not ok.
 
 This variable is used to guess which horizontal position should be locked the
 menu, so don't forget to adjust it if menu position is not ok.
@@ -2919,7 +2901,7 @@ See also `pr-menu-lock' and `pr-menu-char-height'."
      (pr-file-duplex . nil)            ; settings
      (pr-file-tumble . nil))
     )
      (pr-file-duplex . nil)            ; settings
      (pr-file-tumble . nil))
     )
-  "*Specify an alist for settings in general.
+  "Specify an alist for settings in general.
 
 The elements have the following form:
 
 
 The elements have the following form:
 
@@ -3031,7 +3013,7 @@ SETTING           It's a cons like:
 
 (defcustom pr-visible-entry-list
   '(postscript text postscript-options postscript-process printing help)
 
 (defcustom pr-visible-entry-list
   '(postscript text postscript-options postscript-process printing help)
-  "*Specify a list of Printing menu visible entries.
+  "Specify a list of Printing menu visible entries.
 
 Valid values with the corresponding menu parts are:
 
 
 Valid values with the corresponding menu parts are:
 
@@ -3083,7 +3065,7 @@ Any other value is ignored."
 
 
 (defcustom pr-delete-temp-file t
 
 
 (defcustom pr-delete-temp-file t
-  "*Non-nil means delete temporary files.
+  "Non-nil means delete temporary files.
 
 Set `pr-delete-temp-file' to nil, if the following message (or a similar)
 happens when printing:
 
 Set `pr-delete-temp-file' to nil, if the following message (or a similar)
 happens when printing:
@@ -3094,7 +3076,7 @@ happens when printing:
 
 
 (defcustom pr-list-directory nil
 
 
 (defcustom pr-list-directory nil
-  "*Non-nil means list directory when processing a directory.
+  "Non-nil means list directory when processing a directory.
 
 That is, any subdirectories (and the superdirectory) of the directory (given as
 argument of functions below) are also printed (as dired-mode listings).
 
 That is, any subdirectories (and the superdirectory) of the directory (given as
 argument of functions below) are also printed (as dired-mode listings).
@@ -3107,7 +3089,7 @@ and `pr-txt-directory'."
 
 
 (defcustom pr-buffer-name "*Printing Interface*"
 
 
 (defcustom pr-buffer-name "*Printing Interface*"
-  "*Specify the name of the buffer interface for printing package.
+  "Specify the name of the buffer interface for printing package.
 
 It's used by `pr-interface'."
   :type 'string
 
 It's used by `pr-interface'."
   :type 'string
@@ -3117,7 +3099,7 @@ It's used by `pr-interface'."
 (defcustom pr-buffer-name-ignore
   (list (regexp-quote pr-buffer-name)  ; ignore printing interface buffer
        "^ .*$")                        ; ignore invisible buffers
 (defcustom pr-buffer-name-ignore
   (list (regexp-quote pr-buffer-name)  ; ignore printing interface buffer
        "^ .*$")                        ; ignore invisible buffers
-  "*Specify a regexp list for buffer names to be ignored in interface buffer.
+  "Specify a regexp list for buffer names to be ignored in interface buffer.
 
 NOTE: Case is important for matching, that is, `case-fold-search' is always
       nil.
 
 NOTE: Case is important for matching, that is, `case-fold-search' is always
       nil.
@@ -3128,7 +3110,7 @@ It's used by `pr-interface'."
 
 
 (defcustom pr-buffer-verbose t
 
 
 (defcustom pr-buffer-verbose t
-  "*Non-nil means to be verbose when editing a field in interface buffer.
+  "Non-nil means to be verbose when editing a field in interface buffer.
 
 It's used by `pr-interface'."
   :type 'boolean
 
 It's used by `pr-interface'."
   :type 'boolean
@@ -3455,12 +3437,7 @@ See `pr-ps-printer-alist'.")
 
 (defun pr-menu-bind ()
   "Install `printing' menu in the menubar.
 
 (defun pr-menu-bind ()
   "Install `printing' menu in the menubar.
-
-On Emacs 20, it replaces the Tools/Print menu by Tools/Printing menu.
-
-On Emacs 21 and 22, it replaces the File/Print* menu entries by File/Print
-menu.
-
+This replaces the File/Print* menu entries with a File/Print sub-menu.
 Calls `pr-update-menus' to adjust menus."
   (interactive)
   (pr-global-menubar pr-menu-spec)
 Calls `pr-update-menus' to adjust menus."
   (interactive)
   (pr-global-menubar pr-menu-spec)
@@ -3955,8 +3932,7 @@ If BUFFER is nil, the current buffer is used for printing.
 
 For more information, type \\[pr-interface-help]."
   (interactive)
 
 For more information, type \\[pr-interface-help]."
   (interactive)
-  (save-excursion
-    (set-buffer (or buffer (current-buffer)))
+  (with-current-buffer (or buffer (current-buffer))
     (pr-create-interface)))
 
 
     (pr-create-interface)))
 
 
@@ -4459,8 +4435,7 @@ image in a file with that name."
         (if (string= pr-ps-command "")
             ;; default action
             (let ((ps-spool-buffer (get-buffer-create ps-spool-buffer-name)))
         (if (string= pr-ps-command "")
             ;; default action
             (let ((ps-spool-buffer (get-buffer-create ps-spool-buffer-name)))
-              (save-excursion
-                (set-buffer ps-spool-buffer)
+              (with-current-buffer ps-spool-buffer
                 (erase-buffer)
                 (insert-file-contents-literally file))
               (pr-despool-print))
                 (erase-buffer)
                 (insert-file-contents-literally file))
               (pr-despool-print))
@@ -4636,7 +4611,7 @@ bottom."
 
 ;;;###autoload
 (defun pr-toggle-region ()
 
 ;;;###autoload
 (defun pr-toggle-region ()
-  "Toggle auto region."
+  "Toggle whether the region is automagically detected."
   (interactive)
   (pr-toggle-region-menu t))
 
   (interactive)
   (pr-toggle-region-menu t))
 
@@ -4958,11 +4933,10 @@ Or choose the menu option Printing/Show Settings/lpr."
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; mh-e (adapted from mh-e-init.el -- Tom Vogels <tov@ece.cmu.edu>)
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; mh-e (adapted from mh-e-init.el -- Tom Vogels <tov@ece.cmu.edu>)
 
-
-(defalias 'pr-mh-get-msg-num 'mh-get-msg-num)
-(defalias 'pr-mh-show 'mh-show)
-(defalias 'pr-mh-start-of-uncleaned-message 'mh-start-of-uncleaned-message)
-(defvar mh-show-buffer nil)
+(declare-function mh-get-msg-num "mh-utils" (error-if-no-message))
+(declare-function mh-show "mh-show" (&optional message redisplay-flag))
+(declare-function mh-start-of-uncleaned-message "mh-show" ())
+(defvar mh-show-buffer)
 
 
 (defun pr-article-date ()
 
 
 (defun pr-article-date ()
@@ -4978,11 +4952,11 @@ Return only the dayname, if present, weekday, month, and year."
 
 (defun pr-mh-current-message ()
   "Go to mh-inbox current message."
 
 (defun pr-mh-current-message ()
   "Go to mh-inbox current message."
-  (let ((msg (or (pr-mh-get-msg-num nil) 0)))
-    (pr-mh-show)
+  (let ((msg (or (mh-get-msg-num nil) 0)))
+    (mh-show)
     (set-buffer mh-show-buffer)
     (goto-char (point-min))
     (set-buffer mh-show-buffer)
     (goto-char (point-min))
-    (pr-mh-start-of-uncleaned-message)
+    (mh-start-of-uncleaned-message)
     (message "Printing message %d" msg)))
 
 
     (message "Printing message %d" msg)))
 
 
@@ -5031,8 +5005,7 @@ Return only the dayname, if present, weekday, month, and year."
                      (symbol-value summary-buffer))
                 (symbol-value summary-default))))
     (and (get-buffer buf)
                      (symbol-value summary-buffer))
                 (symbol-value summary-default))))
     (and (get-buffer buf)
-        (save-excursion
-          (set-buffer buf)
+        (with-current-buffer buf
           (pr-mode-print n-up filename header-list)))))
 
 
           (pr-mode-print n-up filename header-list)))))
 
 
@@ -5042,8 +5015,7 @@ Return only the dayname, if present, weekday, month, and year."
                      (symbol-value summary-buffer))
                 (symbol-value summary-default))))
     (and (get-buffer buf)
                      (symbol-value summary-buffer))
                 (symbol-value summary-default))))
     (and (get-buffer buf)
-        (save-excursion
-          (set-buffer buf)
+        (with-current-buffer buf
           (pr-mode-lpr header-list)))))
 
 
           (pr-mode-lpr header-list)))))
 
 
@@ -5374,102 +5346,119 @@ If menu binding was not done, calls `pr-menu-bind'."
 
 
 (defun pr-toggle-file-duplex-menu (&optional no-menu)
 
 
 (defun pr-toggle-file-duplex-menu (&optional no-menu)
+  "Toggle whether to print PostScript files in duplex mode."
   (interactive)
   (pr-toggle 'pr-file-duplex "PS file duplex" nil 7 5 nil
             '("PostScript Print" "File") no-menu))
 
 
 (defun pr-toggle-file-tumble-menu (&optional no-menu)
   (interactive)
   (pr-toggle 'pr-file-duplex "PS file duplex" nil 7 5 nil
             '("PostScript Print" "File") no-menu))
 
 
 (defun pr-toggle-file-tumble-menu (&optional no-menu)
+  "Toggle whether to print PostScript files in tumble mode."
   (interactive)
   (pr-toggle 'pr-file-tumble "PS file tumble" nil 8 5 nil
             '("PostScript Print" "File") no-menu))
 
 
 (defun pr-toggle-file-landscape-menu (&optional no-menu)
   (interactive)
   (pr-toggle 'pr-file-tumble "PS file tumble" nil 8 5 nil
             '("PostScript Print" "File") no-menu))
 
 
 (defun pr-toggle-file-landscape-menu (&optional no-menu)
+  "Toggle whether to print PostScript files in landscape orientation."
   (interactive)
   (pr-toggle 'pr-file-landscape "PS file landscape" nil 6 5 nil
             '("PostScript Print" "File") no-menu))
 
 
 (defun pr-toggle-ghostscript-menu (&optional no-menu)
   (interactive)
   (pr-toggle 'pr-file-landscape "PS file landscape" nil 6 5 nil
             '("PostScript Print" "File") no-menu))
 
 
 (defun pr-toggle-ghostscript-menu (&optional no-menu)
+  "Toggle whether to print using ghostscript."
   (interactive)
   (pr-toggle 'pr-print-using-ghostscript "Printing using ghostscript"
             'postscript-process 2 12 'toggle nil no-menu))
 
 
 (defun pr-toggle-faces-menu (&optional no-menu)
   (interactive)
   (pr-toggle 'pr-print-using-ghostscript "Printing using ghostscript"
             'postscript-process 2 12 'toggle nil no-menu))
 
 
 (defun pr-toggle-faces-menu (&optional no-menu)
+  "Toggle whether to print with face attributes."
   (interactive)
   (pr-toggle 'pr-faces-p "Printing with faces"
             'postscript-process 1 12 'toggle nil no-menu))
 
 
 (defun pr-toggle-spool-menu (&optional no-menu)
   (interactive)
   (pr-toggle 'pr-faces-p "Printing with faces"
             'postscript-process 1 12 'toggle nil no-menu))
 
 
 (defun pr-toggle-spool-menu (&optional no-menu)
+  "Toggle whether to spool printing in a buffer."
   (interactive)
   (pr-toggle 'pr-spool-p "Spooling printing"
             'postscript-process 0 12 'toggle nil no-menu))
 
 
 (defun pr-toggle-duplex-menu (&optional no-menu)
   (interactive)
   (pr-toggle 'pr-spool-p "Spooling printing"
             'postscript-process 0 12 'toggle nil no-menu))
 
 
 (defun pr-toggle-duplex-menu (&optional no-menu)
+  "Toggle whether to generate PostScript for a two-sided printer."
   (interactive)
   (pr-toggle 'ps-spool-duplex "Printing duplex"
             'postscript-options 5 12 'toggle nil no-menu))
 
 
 (defun pr-toggle-tumble-menu (&optional no-menu)
   (interactive)
   (pr-toggle 'ps-spool-duplex "Printing duplex"
             'postscript-options 5 12 'toggle nil no-menu))
 
 
 (defun pr-toggle-tumble-menu (&optional no-menu)
+  "Toggle how pages on opposite sides of a sheet are oriented."
   (interactive)
   (pr-toggle 'ps-spool-tumble "Tumble"
             'postscript-options 6 12 'toggle nil no-menu))
 
 
 (defun pr-toggle-landscape-menu (&optional no-menu)
   (interactive)
   (pr-toggle 'ps-spool-tumble "Tumble"
             'postscript-options 6 12 'toggle nil no-menu))
 
 
 (defun pr-toggle-landscape-menu (&optional no-menu)
+  "Toggle whether to print in landscape mode."
   (interactive)
   (pr-toggle 'ps-landscape-mode "Landscape"
             'postscript-options 0 12 'toggle nil no-menu))
 
 
 (defun pr-toggle-upside-down-menu (&optional no-menu)
   (interactive)
   (pr-toggle 'ps-landscape-mode "Landscape"
             'postscript-options 0 12 'toggle nil no-menu))
 
 
 (defun pr-toggle-upside-down-menu (&optional no-menu)
+  "Toggle whether to print upside-down (that is, rotated by 180 degrees)."
   (interactive)
   (pr-toggle 'ps-print-upside-down "Upside-Down"
             'postscript-options 7 12 'toggle nil no-menu))
 
 
 (defun pr-toggle-line-menu (&optional no-menu)
   (interactive)
   (pr-toggle 'ps-print-upside-down "Upside-Down"
             'postscript-options 7 12 'toggle nil no-menu))
 
 
 (defun pr-toggle-line-menu (&optional no-menu)
+  "Toggle whether to means print line numbers."
   (interactive)
   (pr-toggle 'ps-line-number "Line number"
             'postscript-options 3 12 'toggle nil no-menu))
 
 
 (defun pr-toggle-zebra-menu (&optional no-menu)
   (interactive)
   (pr-toggle 'ps-line-number "Line number"
             'postscript-options 3 12 'toggle nil no-menu))
 
 
 (defun pr-toggle-zebra-menu (&optional no-menu)
+  "Toggle whether to print zebra stripes."
   (interactive)
   (pr-toggle 'ps-zebra-stripes "Zebra stripe"
             'postscript-options 4 12 'toggle nil no-menu))
 
 
 (defun pr-toggle-header-menu (&optional no-menu)
   (interactive)
   (pr-toggle 'ps-zebra-stripes "Zebra stripe"
             'postscript-options 4 12 'toggle nil no-menu))
 
 
 (defun pr-toggle-header-menu (&optional no-menu)
+  "Toggle whether to print a header at the top of each page."
   (interactive)
   (pr-toggle 'ps-print-header "Print header"
             'postscript-options 1 12 'toggle nil no-menu))
 
 
 (defun pr-toggle-header-frame-menu (&optional no-menu)
   (interactive)
   (pr-toggle 'ps-print-header "Print header"
             'postscript-options 1 12 'toggle nil no-menu))
 
 
 (defun pr-toggle-header-frame-menu (&optional no-menu)
+  "Toggle whether to draw a gaudy frame around the header."
   (interactive)
   (pr-toggle 'ps-print-header-frame "Print header frame"
             'postscript-options 2 12 'toggle nil no-menu))
 
 
 (defun pr-toggle-lock-menu (&optional no-menu)
   (interactive)
   (pr-toggle 'ps-print-header-frame "Print header frame"
             'postscript-options 2 12 'toggle nil no-menu))
 
 
 (defun pr-toggle-lock-menu (&optional no-menu)
+  "Toggle whether the menu is locked while selecting toggle options."
   (interactive)
   (pr-toggle 'pr-menu-lock "Menu lock"
             'printing 2 12 'toggle nil no-menu))
 
 
 (defun pr-toggle-region-menu (&optional no-menu)
   (interactive)
   (pr-toggle 'pr-menu-lock "Menu lock"
             'printing 2 12 'toggle nil no-menu))
 
 
 (defun pr-toggle-region-menu (&optional no-menu)
+  "Toggle whether the region is automagically detected."
   (interactive)
   (pr-toggle 'pr-auto-region "Auto region"
             'printing 0 12 'toggle nil no-menu))
 
 
 (defun pr-toggle-mode-menu (&optional no-menu)
   (interactive)
   (pr-toggle 'pr-auto-region "Auto region"
             'printing 0 12 'toggle nil no-menu))
 
 
 (defun pr-toggle-mode-menu (&optional no-menu)
+  "Toggle whether major-mode specific printing is prefered over normal printing."
   (interactive)
   (pr-toggle 'pr-auto-mode "Auto mode"
             'printing 1 12 'toggle nil no-menu))
   (interactive)
   (pr-toggle 'pr-auto-mode "Auto mode"
             'printing 1 12 'toggle nil no-menu))
@@ -5509,7 +5498,7 @@ If menu binding was not done, calls `pr-menu-bind'."
 (defun pr-show-setup (settings buffer-name)
   (with-output-to-temp-buffer buffer-name
     (princ settings)
 (defun pr-show-setup (settings buffer-name)
   (with-output-to-temp-buffer buffer-name
     (princ settings)
-    (print-help-return-message)))
+    (help-print-return-message)))
 
 
 (defun pr-complete-alist (prompt alist default)
 
 
 (defun pr-complete-alist (prompt alist default)
@@ -5636,8 +5625,7 @@ If menu binding was not done, calls `pr-menu-bind'."
        status)
     (setq args (pr-remove-nil-from-list args))
     ;; *Printing Command Output* == show command & args
        status)
     (setq args (pr-remove-nil-from-list args))
     ;; *Printing Command Output* == show command & args
-    (save-excursion
-      (set-buffer buffer)
+    (with-current-buffer buffer
       (goto-char (point-max))
       (insert (format "%s %S\n" cmd args)))
     ;; *Printing Command Output* == show any return message from command
       (goto-char (point-max))
       (insert (format "%s %S\n" cmd args)))
     ;; *Printing Command Output* == show any return message from command
@@ -5648,8 +5636,7 @@ If menu binding was not done, calls `pr-menu-bind'."
             ((quit error)
              (error-message-string data)))))
     ;; *Printing Command Output* == show exit status
             ((quit error)
              (error-message-string data)))))
     ;; *Printing Command Output* == show exit status
-    (save-excursion
-      (set-buffer buffer)
+    (with-current-buffer buffer
       (goto-char (point-max))
       (insert (format "Exit status: %s\n\n" status)))
     ;; message if error status
       (goto-char (point-max))
       (insert (format "Exit status: %s\n\n" status)))
     ;; message if error status
@@ -5737,8 +5724,8 @@ If menu binding was not done, calls `pr-menu-bind'."
   (let* ((dir-name   (file-name-directory (or (buffer-file-name)
                                              default-directory)))
         (fmt-prompt (concat "%s[" mess "] Directory to print: "))
   (let* ((dir-name   (file-name-directory (or (buffer-file-name)
                                              default-directory)))
         (fmt-prompt (concat "%s[" mess "] Directory to print: "))
-        (dir        (read-file-name (format fmt-prompt "")
-                                    "" dir-name nil dir-name))
+        (dir        (read-directory-name (format fmt-prompt "")
+                                         "" dir-name nil dir-name))
         prompt)
     (while (cond ((not (file-directory-p dir))
                  (ding)
         prompt)
     (while (cond ((not (file-directory-p dir))
                  (ding)
@@ -5748,8 +5735,8 @@ If menu binding was not done, calls `pr-menu-bind'."
                  (setq prompt "Directory is unreadable! "))
                 (t nil))
       (setq dir-name (file-name-directory dir)
                  (setq prompt "Directory is unreadable! "))
                 (t nil))
       (setq dir-name (file-name-directory dir)
-           dir      (read-file-name (format fmt-prompt prompt)
-                                    "" dir-name nil dir-name)))
+           dir      (read-directory-name (format fmt-prompt prompt)
+                                         "" dir-name nil dir-name)))
     (file-name-as-directory dir)))
 
 
     (file-name-as-directory dir)))
 
 
@@ -5842,8 +5829,7 @@ If menu binding was not done, calls `pr-menu-bind'."
          (blist (buffer-list))
          found)
       (while (and (not found) blist)
          (blist (buffer-list))
          found)
       (while (and (not found) blist)
-       (save-excursion
-         (set-buffer (car blist))
+       (with-current-buffer (car blist)
          (and (eq major-mode 'dired-mode)
               (save-excursion
                 (goto-char (point-min))
          (and (eq major-mode 'dired-mode)
               (save-excursion
                 (goto-char (point-min))
@@ -5867,9 +5853,8 @@ If menu binding was not done, calls `pr-menu-bind'."
                         pop-up-frames)
                     (and (or buffer
                              (file-readable-p file))
                         pop-up-frames)
                     (and (or buffer
                              (file-readable-p file))
-                         (save-excursion
-                           (set-buffer (or buffer
-                                           (find-file-noselect file)))
+                         (with-current-buffer (or buffer
+                                                   (find-file-noselect file))
                            (funcall fun)
                            (or buffer
                                (kill-buffer (current-buffer))))))))
                            (funcall fun)
                            (or buffer
                                (kill-buffer (current-buffer))))))))
@@ -6050,8 +6035,7 @@ COMMAND.exe, COMMAND.bat and COMMAND.com in this order."
 
 
 (defmacro pr-interface-save (&rest body)
 
 
 (defmacro pr-interface-save (&rest body)
-  `(save-excursion
-     (set-buffer pr-i-buffer)
+  `(with-current-buffer pr-i-buffer
      ,@body))
 
 
      ,@body))
 
 
@@ -6697,5 +6681,4 @@ COMMAND.exe, COMMAND.bat and COMMAND.com in this order."
 (provide 'printing)
 
 
 (provide 'printing)
 
 
-;; arch-tag: 9ce9ac3f-0f60-4370-900b-1943215d9d18
 ;;; printing.el ends here
 ;;; printing.el ends here