]> code.delx.au - gnu-emacs/blobdiff - lisp/printing.el
Merge from gnus--devo--0
[gnu-emacs] / lisp / printing.el
index 245d21d7de5503d44c4a2081dbb82e1f097b2eda..8fac4bf298169808e646e6f95b737276d44c6328 100644 (file)
@@ -1,16 +1,16 @@
 ;;; printing.el --- printing utilities
 
 ;; Copyright (C) 2000, 2001, 2003, 2004, 2005,
-;;   2006, 2007 Free Software Foundation, Inc.
+;;   2006, 2007, 2008 Free Software Foundation, Inc.
 
 ;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br>
 ;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br>
 ;; Keywords: wp, print, PostScript
-;; Version: 6.9.2
+;; Version: 6.9.3
 ;; X-URL: http://www.emacswiki.org/cgi-bin/wiki/ViniciusJoseLatorre
 
-(defconst pr-version "6.9.2"
-  "printing.el, v 6.9.2 <2007/10/26 vinicius>
+(defconst pr-version "6.9.3"
+  "printing.el, v 6.9.3 <2007/12/09 vinicius>
 
 Please send all bug fixes and enhancements to
        Vinicius Jose Latorre <viniciusjl@ig.com.br>
@@ -18,19 +18,18 @@ Please send all bug fixes and enhancements to
 
 ;; 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:
 
@@ -70,7 +69,7 @@ Please send all bug fixes and enhancements to
 ;; `http://www.emacswiki.org/cgi-bin/wiki/PsPrintPackage'.
 ;; Please, see README file for ps-print installation instructions.
 ;;
-;; `printing' was inspired on:
+;; `printing' was inspired by:
 ;;
 ;;    print-nt.el            Frederic Corne <frederic.corne@erli.fr>
 ;;      Special printing functions for Windows NT
@@ -1118,8 +1117,8 @@ If SUFFIX is non-nil, add that at the end of the file name."
   (defalias 'pr-region-active-p        'ignore)
   (defalias 'pr-do-update-menus        'ignore)
   (defalias 'pr-update-mode-line       'ignore)
-  (defalias 'pr-f-read-string          'ignore)
-  (defalias 'pr-f-set-keymap-parents   'ignore)
+  (defalias 'pr-read-string            'ignore)
+  (defalias 'pr-set-keymap-parents     'ignore)
   (defalias 'pr-keep-region-active     'ignore))
 
 
@@ -1154,11 +1153,11 @@ Used by `pr-menu-bind' and `pr-update-menus'.")
 (cond
  ((featurep 'xemacs)                   ; XEmacs
   ;; XEmacs
-  (defalias 'pr-f-set-keymap-parents 'set-keymap-parents)
-  (defalias 'pr-f-set-keymap-name    'set-keymap-name)
+  (defalias 'pr-set-keymap-parents 'set-keymap-parents)
+  (defalias 'pr-set-keymap-name    'set-keymap-name)
 
   ;; XEmacs
-  (defun pr-f-read-string (prompt initial history default)
+  (defun pr-read-string (prompt initial history default)
     (let ((str (read-string prompt initial)))
       (if (and str (not (string= str "")))
          str
@@ -1353,9 +1352,9 @@ Used by `pr-menu-bind' and `pr-update-menus'.")
   )
  (t                                    ; GNU Emacs
   ;; GNU Emacs
-  (defalias 'pr-f-set-keymap-parents 'set-keymap-parent)
-  (defalias 'pr-f-set-keymap-name    'ignore)
-  (defalias 'pr-f-read-string        'read-string)
+  (defalias 'pr-set-keymap-parents 'set-keymap-parent)
+  (defalias 'pr-set-keymap-name    'ignore)
+  (defalias 'pr-read-string        'read-string)
 
   ;; GNU Emacs
   (defvar deactivate-mark)
@@ -1451,7 +1450,7 @@ Used by `pr-menu-bind' and `pr-update-menus'.")
       )))
 
   (defvar pr-menu-position nil)
-  (defvar pr-menu-state nil)
+  (defvar pr-menu-state    nil)
 
   ;; GNU Emacs
   (defun pr-menu-lookup (path)
@@ -1674,7 +1673,7 @@ separator; otherwise, ensure unix-style directory separator."
   :tag "Printing Utilities"
   :link '(emacs-library-link :tag "Source Lisp File" "printing.el")
   :prefix "pr-"
-  :version "20"
+  :version "22.1"
   :group 'wp
   :group 'postscript)
 
@@ -1694,7 +1693,6 @@ Valid values are:
   :type '(choice :tag "Path style"
                 (const :tag "Windows 9x/NT Style (\\)" :value windows)
                 (const :tag "Unix Style (/)" :value unix))
-  :version "20"
   :group 'printing)
 
 
@@ -1773,7 +1771,6 @@ Examples:
                                :tag "Directory"
                                (string :value "")
                                (symbol :value symbol)))))
-  :version "20"
   :group 'printing)
 
 
@@ -1788,7 +1785,6 @@ modified by other means (for example, a lisp function), use `pr-update-menus'
 function (see it for documentation) to update text printer menu."
   :type 'symbol
   :set 'pr-txt-name-custom-set
-  :version "20"
   :group 'printing)
 
 
@@ -1921,7 +1917,6 @@ Useful links:
                        (const :tag "None" nil)
                        string)))
   :set 'pr-alist-custom-set
-  :version "20"
   :group 'printing)
 
 
@@ -1936,7 +1931,6 @@ modified by other means (for example, a lisp function), use `pr-update-menus'
 function (see it for documentation) to update PostScript printer menu."
   :type 'symbol
   :set 'pr-ps-name-custom-set
-  :version "20"
   :group 'printing)
 
 
@@ -2209,7 +2203,6 @@ Useful links:
             (sexp :tag "Value")))
           ))
   :set 'pr-alist-custom-set
-  :version "20"
   :group 'printing)
 
 
@@ -2228,7 +2221,6 @@ Useful links:
 
 See also `pr-ps-temp-file' and `pr-file-modes'."
   :type '(directory :tag "Temporary Directory")
-  :version "20"
   :group 'printing)
 
 
@@ -2237,7 +2229,6 @@ See also `pr-ps-temp-file' and `pr-file-modes'."
 
 See also `pr-temp-dir' and `pr-file-modes'."
   :type '(file :tag "PostScript Temporary File Name")
-  :version "21"
   :group 'printing)
 
 
@@ -2251,7 +2242,6 @@ It should be an integer; only the low 9 bits are used.
 
 See also `pr-temp-dir' and `pr-ps-temp-file'."
   :type '(integer :tag "File Permission Bits")
-  :version "21.3"
   :group 'printing)
 
 
@@ -2293,7 +2283,6 @@ Useful links:
   `http://www.cs.wisc.edu/~ghost/macos/index.htm'
 "
   :type '(string :tag "Ghostview Utility")
-  :version "20"
   :group 'printing)
 
 
@@ -2320,7 +2309,6 @@ Useful links:
   `http://www.cs.wisc.edu/~ghost/doc/printer.htm'
 "
   :type '(string :tag "Ghostscript Utility")
-  :version "20"
   :group 'printing)
 
 
@@ -2363,7 +2351,6 @@ Useful links:
   `http://www.cs.wisc.edu/~ghost/doc/printer.htm'
 "
   :type '(repeat (string :tag "Ghostscript Switch"))
-  :version "20"
   :group 'printing)
 
 
@@ -2380,7 +2367,6 @@ A note on the gs switches:
 See `pr-gs-switches' for documentation.
 See also `pr-ps-printer-alist'."
   :type '(string :tag "Ghostscript Device")
-  :version "20"
   :group 'printing)
 
 
@@ -2394,7 +2380,6 @@ A note on the gs switches:
 See `pr-gs-switches' for documentation.
 See also `pr-ps-printer-alist'."
   :type '(integer :tag "Ghostscript Resolution")
-  :version "20"
   :group 'printing)
 
 
@@ -2407,35 +2392,30 @@ ghostscript to print a PostScript file.
 In GNU or Unix system, if ghostscript is set as a PostScript filter, this
 variable should be nil."
   :type 'boolean
-  :version "20"
   :group 'printing)
 
 
 (defcustom pr-faces-p nil
   "*Non-nil means print with face attributes."
   :type 'boolean
-  :version "20"
   :group 'printing)
 
 
 (defcustom pr-spool-p nil
   "*Non-nil means spool printing in a buffer."
   :type 'boolean
-  :version "20"
   :group 'printing)
 
 
 (defcustom pr-file-landscape nil
   "*Non-nil means print PostScript file in landscape orientation."
   :type 'boolean
-  :version "20"
   :group 'printing)
 
 
 (defcustom pr-file-duplex nil
   "*Non-nil means print PostScript file in duplex mode."
   :type 'boolean
-  :version "20"
   :group 'printing)
 
 
@@ -2447,7 +2427,6 @@ right.
 If tumble is on, produces a printing suitable for binding at the top or
 bottom."
   :type 'boolean
-  :version "20"
   :group 'printing)
 
 
@@ -2460,7 +2439,6 @@ When this variable is non-nil, the `*-buffer*' commands will behave like
 `*-region*' commands, that is, `*-buffer*' commands will print only the region
 marked instead of all buffer."
   :type 'boolean
-  :version "20"
   :group 'printing)
 
 
@@ -2472,7 +2450,6 @@ and `*-region*' commands will behave like `*-mode*' commands; otherwise,
 `*-buffer*' commands will print the current buffer and `*-region*' commands
 will print the current region."
   :type 'boolean
-  :version "20"
   :group 'printing)
 
 
@@ -2673,7 +2650,6 @@ DEFAULT           It's a way to set default values when this entry is selected.
              (variable :tag "Other"))
             (sexp :tag "Value")))
           ))
-  :version "20"
   :group 'printing)
 
 
@@ -2691,7 +2667,6 @@ NOTE: Don't forget to download and install the utilities declared on
       `pr-ps-utility-alist'."
   :type '(symbol :tag "PS File Utility")
   :set 'pr-ps-utility-custom-set
-  :version "20"
   :group 'printing)
 
 
@@ -2904,7 +2879,6 @@ Useful links:
                  (sexp :tag "Value")))
                ))
   :set 'pr-alist-custom-set
-  :version "20"
   :group 'printing)
 
 
@@ -2913,7 +2887,6 @@ Useful links:
 
 See also `pr-menu-char-height' and `pr-menu-char-width'."
   :type 'boolean
-  :version "20"
   :group 'printing)
 
 
@@ -2925,7 +2898,6 @@ menu, so don't forget to adjust it if menu position is not ok.
 
 See also `pr-menu-lock' and `pr-menu-char-width'."
   :type 'integer
-  :version "20"
   :group 'printing)
 
 
@@ -2937,7 +2909,6 @@ menu, so don't forget to adjust it if menu position is not ok.
 
 See also `pr-menu-lock' and `pr-menu-char-height'."
   :type 'integer
-  :version "20"
   :group 'printing)
 
 
@@ -3054,7 +3025,6 @@ SETTING           It's a cons like:
              (variable :tag "Other"))
             (sexp :tag "Value")))
           ))
-  :version "20"
   :group 'printing)
 
 
@@ -3108,7 +3078,6 @@ Any other value is ignored."
                         (const postscript-process)
                         (const printing)
                         (const help)))
-  :version "20"
   :group 'printing)
 
 
@@ -3120,7 +3089,6 @@ happens when printing:
 
    Error: could not open \"c:\\temp\\prspool.ps\" for reading."
   :type 'boolean
-  :version "20"
   :group 'printing)
 
 
@@ -3134,7 +3102,6 @@ It's used by `pr-ps-directory-preview', `pr-ps-directory-using-ghostscript',
 `pr-ps-directory-print', `pr-ps-directory-ps-print', `pr-printify-directory'
 and `pr-txt-directory'."
   :type 'boolean
-  :version "20"
   :group 'printing)
 
 
@@ -3143,7 +3110,6 @@ and `pr-txt-directory'."
 
 It's used by `pr-interface'."
   :type 'string
-  :version "20"
   :group 'printing)
 
 
@@ -3157,7 +3123,6 @@ NOTE: Case is important for matching, that is, `case-fold-search' is always
 
 It's used by `pr-interface'."
   :type '(repeat (regexp :tag "Buffer Name Regexp"))
-  :version "20"
   :group 'printing)
 
 
@@ -3166,7 +3131,6 @@ It's used by `pr-interface'."
 
 It's used by `pr-interface'."
   :type 'boolean
-  :version "20"
   :group 'printing)
 
 
@@ -5754,7 +5718,7 @@ If menu binding was not done, calls `pr-menu-bind'."
   (save-match-data
     (let* ((fmt-prompt "%s[%s] N-up printing (default 1): ")
           (prompt "")
-          (str (pr-f-read-string (format fmt-prompt prompt mess) "1" nil "1"))
+          (str (pr-read-string (format fmt-prompt prompt mess) "1" nil "1"))
           int)
       (while (if (string-match "^\\s *[0-9]+$" str)
                 (setq int (string-to-number str)
@@ -5764,7 +5728,7 @@ If menu binding was not done, calls `pr-menu-bind'."
               (setq prompt "Invalid integer syntax; "))
        (ding)
        (setq str
-             (pr-f-read-string (format fmt-prompt prompt mess) str nil "1")))
+             (pr-read-string (format fmt-prompt prompt mess) str nil "1")))
       int)))
 
 
@@ -5789,7 +5753,7 @@ If menu binding was not done, calls `pr-menu-bind'."
 
 
 (defun pr-interactive-regexp (mess)
-  (pr-f-read-string (format "[%s] File regexp to print: " mess) "" nil ""))
+  (pr-read-string (format "[%s] File regexp to print: " mess) "" nil ""))
 
 
 (defun pr-interactive-dir-args (mess)
@@ -6043,7 +6007,7 @@ COMMAND.exe, COMMAND.bat and COMMAND.com in this order."
 
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; Printing Interface (inspired on ps-print-interface.el)
+;; Printing Interface (inspired by ps-print-interface.el)
 
 
 (eval-when-compile
@@ -6073,14 +6037,15 @@ COMMAND.exe, COMMAND.bat and COMMAND.com in this order."
   "Keymap for pr-interface.")
 
 (unless pr-interface-map
-  (setq pr-interface-map (make-sparse-keymap))
-  (cond ((featurep 'xemacs)            ; XEmacs
-        (pr-f-set-keymap-parents pr-interface-map (list widget-keymap))
-        (pr-f-set-keymap-name pr-interface-map 'pr-interface-map))
-       (t                              ; GNU Emacs
-        (pr-f-set-keymap-parents pr-interface-map widget-keymap)))
-  (define-key pr-interface-map "q" 'pr-interface-quit)
-  (define-key pr-interface-map "?" 'pr-interface-help))
+  (let ((map (make-sparse-keymap)))
+    (cond ((featurep 'xemacs)          ; XEmacs
+          (pr-set-keymap-parents map (list widget-keymap))
+          (pr-set-keymap-name    map 'pr-interface-map))
+         (t                            ; GNU Emacs
+          (pr-set-keymap-parents map widget-keymap)))
+    (define-key map "q" 'pr-interface-quit)
+    (define-key map "?" 'pr-interface-help)
+    (setq pr-interface-map map)))
 
 
 (defmacro pr-interface-save (&rest body)