emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/printing.el


From: Vinicius Jose Latorre
Subject: [Emacs-diffs] Changes to emacs/lisp/printing.el
Date: Sat, 13 Nov 2004 19:59:09 -0500

Index: emacs/lisp/printing.el
diff -c emacs/lisp/printing.el:1.21 emacs/lisp/printing.el:1.22
*** emacs/lisp/printing.el:1.21 Fri Nov 12 02:14:03 2004
--- emacs/lisp/printing.el      Sun Nov 14 00:47:34 2004
***************
*** 5,17 ****
  
  ;; Author: Vinicius Jose Latorre <address@hidden>
  ;; Maintainer: Vinicius Jose Latorre <address@hidden>
! ;; Time-stamp: <2004/11/11 23:54:13 vinicius>
  ;; Keywords: wp, print, PostScript
! ;; Version: 6.8.2
  ;; X-URL: http://www.cpqd.com.br/~vinicius/emacs/
  
! (defconst pr-version "6.8.2"
!   "printing.el, v 6.8.2 <2004/11/11 vinicius>
  
  Please send all bug fixes and enhancements to
        Vinicius Jose Latorre <address@hidden>
--- 5,17 ----
  
  ;; Author: Vinicius Jose Latorre <address@hidden>
  ;; Maintainer: Vinicius Jose Latorre <address@hidden>
! ;; Time-stamp: <2004/11/13 21:36:38 vinicius>
  ;; Keywords: wp, print, PostScript
! ;; Version: 6.8.3
  ;; X-URL: http://www.cpqd.com.br/~vinicius/emacs/
  
! (defconst pr-version "6.8.3"
!   "printing.el, v 6.8.3 <2004/11/13 vinicius>
  
  Please send all bug fixes and enhancements to
        Vinicius Jose Latorre <address@hidden>
***************
*** 440,454 ****
  ;;
  ;; Current global keyboard mapping for GNU Emacs is:
  ;;
! ;;    (global-set-key [print]   'pr-ps-fast-fire)
! ;;    (global-set-key [M-print] 'pr-ps-mode-using-ghostscript)
! ;;    (global-set-key [C-print] 'pr-txt-fast-fire)
  ;;
  ;; And for XEmacs is:
  ;;
! ;;    (global-set-key 'f22           'pr-ps-fast-fire)
! ;;    (global-set-key '(meta f22)    'pr-ps-mode-using-ghostscript)
! ;;    (global-set-key '(control f22) 'pr-txt-fast-fire)
  ;;
  ;; As a suggestion of global keyboard mapping for some `printing' commands:
  ;;
--- 440,458 ----
  ;;
  ;; Current global keyboard mapping for GNU Emacs is:
  ;;
! ;;    (global-set-key [print]     'pr-ps-fast-fire)
! ;;    (global-set-key [M-print]   'pr-ps-mode-using-ghostscript)
! ;;    (global-set-key [S-print]   'pr-ps-mode-using-ghostscript)
! ;;    (global-set-key [C-print]   'pr-txt-fast-fire)
! ;;    (global-set-key [C-M-print] 'pr-txt-fast-fire)
  ;;
  ;; And for XEmacs is:
  ;;
! ;;    (global-set-key 'f22                'pr-ps-fast-fire)
! ;;    (global-set-key '(meta f22)         'pr-ps-mode-using-ghostscript)
! ;;    (global-set-key '(shift f22)        'pr-ps-mode-using-ghostscript)
! ;;    (global-set-key '(control f22)      'pr-txt-fast-fire)
! ;;    (global-set-key '(control meta f22) 'pr-txt-fast-fire)
  ;;
  ;; As a suggestion of global keyboard mapping for some `printing' commands:
  ;;
***************
*** 486,491 ****
--- 490,498 ----
  ;;
  ;; `pr-ps-temp-file'          Specify PostScript temporary file name.
  ;;
+ ;; `pr-file-modes'            Specify the file permission bits for newly
+ ;;                            created files.
+ ;;
  ;; `pr-gv-command'            Specify path and name of the gsview/gv
  ;;                            utility.
  ;;
***************
*** 943,948 ****
--- 950,958 ----
  ;; Acknowledgments
  ;; ---------------
  ;;
+ ;; Thanks to Stefan Monnier <address@hidden> for GNU Emacs and XEmacs
+ ;; printing menu (in `pr-menu-spec') merging suggestion.
+ ;;
  ;; Thanks to Lennart Borgman <address@hidden> for gsprint
  ;; suggestion (see tip 5 in section Tips).
  ;;
***************
*** 1119,1124 ****
--- 1129,1135 ----
    :type '(choice :tag "Path style"
                 (const :tag "Windows 9x/NT Style (\\)" :value windows)
                 (const :tag "Unix Style (/)" :value unix))
+   :version "20"
    :group 'printing)
  
  
***************
*** 1230,1235 ****
--- 1241,1247 ----
                                :tag "Directory"
                                (string :value "")
                                (symbol :value symbol)))))
+   :version "20"
    :group 'printing)
  
  
***************
*** 1244,1249 ****
--- 1256,1262 ----
  function (see it for documentation) to update text printer menu."
    :type 'symbol
    :set 'pr-txt-name-custom-set
+   :version "20"
    :group 'printing)
  
  
***************
*** 1356,1361 ****
--- 1369,1375 ----
                        (const :tag "None" nil)
                        string)))
    :set 'pr-alist-custom-set
+   :version "20"
    :group 'printing)
  
  
***************
*** 1370,1375 ****
--- 1384,1390 ----
  function (see it for documentation) to update PostScript printer menu."
    :type 'symbol
    :set 'pr-ps-name-custom-set
+   :version "20"
    :group 'printing)
  
  
***************
*** 1564,1569 ****
--- 1579,1585 ----
             (sexp :tag "Value")))
           ))
    :set 'pr-alist-custom-set
+   :version "20"
    :group 'printing)
  
  
***************
*** 1578,1591 ****
                ((memq system-type '(vax-vms axp-vms)) "SYS$SCRATCH:")
                (t "/tmp")
                )))))
!   "*Specify a directory for temporary files during printing."
    :type '(directory :tag "Temporary Directory")
    :group 'printing)
  
  
  (defcustom pr-ps-temp-file "prspool.ps"
!   "*Specify PostScript temporary file name."
    :type '(file :tag "PostScript Temporary File Name")
    :group 'printing)
  
  
--- 1594,1627 ----
                ((memq system-type '(vax-vms axp-vms)) "SYS$SCRATCH:")
                (t "/tmp")
                )))))
!   "*Specify a directory for temporary files during printing.
! 
! See also `pr-ps-temp-file' and `pr-file-modes'."
    :type '(directory :tag "Temporary Directory")
+   :version "20"
    :group 'printing)
  
  
  (defcustom pr-ps-temp-file "prspool.ps"
!   "*Specify PostScript temporary file name.
! 
! See also `pr-temp-dir' and `pr-file-modes'."
    :type '(file :tag "PostScript Temporary File Name")
+   :version "20"
+   :group 'printing)
+ 
+ 
+ ;; It uses 0600 as default instead of (default-file-modes).
+ ;; 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.
+ 
+ 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)
  
  
***************
*** 1597,1602 ****
--- 1633,1639 ----
  
  See also `pr-path-alist'."
    :type '(string :tag "Ghostview Utility")
+   :version "20"
    :group 'printing)
  
  
***************
*** 1608,1613 ****
--- 1645,1651 ----
  
  See also `pr-path-alist'."
    :type '(string :tag "Ghostscript Utility")
+   :version "20"
    :group 'printing)
  
  
***************
*** 1638,1643 ****
--- 1676,1682 ----
       located in the same directory as gswin32.exe.
     - for brief documentation, type: gswin32.exe -h"
    :type '(repeat (string :tag "Ghostscript Switch"))
+   :version "20"
    :group 'printing)
  
  
***************
*** 1654,1659 ****
--- 1693,1699 ----
  See `pr-gs-switches' for documentation.
  See also `pr-ps-printer-alist'."
    :type '(string :tag "Ghostscript Device")
+   :version "20"
    :group 'printing)
  
  
***************
*** 1667,1672 ****
--- 1707,1713 ----
  See `pr-gs-switches' for documentation.
  See also `pr-ps-printer-alist'."
    :type '(integer :tag "Ghostscript Resolution")
+   :version "20"
    :group 'printing)
  
  
***************
*** 1679,1708 ****
--- 1720,1754 ----
  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)
  
  
***************
*** 1714,1719 ****
--- 1760,1766 ----
  If tumble is on, produces a printing suitable for binding at the top or
  bottom."
    :type 'boolean
+   :version "20"
    :group 'printing)
  
  
***************
*** 1726,1731 ****
--- 1773,1779 ----
  `*-region*' commands, that is, `*-buffer*' commands will print only the region
  marked instead of all buffer."
    :type 'boolean
+   :version "20"
    :group 'printing)
  
  
***************
*** 1737,1742 ****
--- 1785,1791 ----
  `*-buffer*' commands will print the current buffer and `*-region*' commands
  will print the current region."
    :type 'boolean
+   :version "20"
    :group 'printing)
  
  
***************
*** 1937,1942 ****
--- 1986,1992 ----
              (variable :tag "Other"))
             (sexp :tag "Value")))
           ))
+   :version "20"
    :group 'printing)
  
  
***************
*** 1954,1959 ****
--- 2004,2010 ----
        `pr-ps-utility-alist'."
    :type '(symbol :tag "PS File Utility")
    :set 'pr-ps-utility-custom-set
+   :version "20"
    :group 'printing)
  
  
***************
*** 2138,2143 ****
--- 2189,2195 ----
                  (sexp :tag "Value")))
                ))
    :set 'pr-alist-custom-set
+   :version "20"
    :group 'printing)
  
  
***************
*** 2146,2151 ****
--- 2198,2204 ----
  
  See also `pr-menu-char-height' and `pr-menu-char-width'."
    :type 'boolean
+   :version "20"
    :group 'printing)
  
  
***************
*** 2161,2166 ****
--- 2214,2220 ----
  
  See also `pr-menu-lock' and `pr-menu-char-width'."
    :type 'integer
+   :version "20"
    :group 'printing)
  
  
***************
*** 2176,2181 ****
--- 2230,2236 ----
  
  See also `pr-menu-lock' and `pr-menu-char-height'."
    :type 'integer
+   :version "20"
    :group 'printing)
  
  
***************
*** 2292,2297 ****
--- 2347,2353 ----
              (variable :tag "Other"))
             (sexp :tag "Value")))
           ))
+   :version "20"
    :group 'printing)
  
  
***************
*** 2345,2350 ****
--- 2401,2407 ----
                         (const postscript-process)
                         (const printing)
                         (const help)))
+   :version "20"
    :group 'printing)
  
  
***************
*** 2356,2361 ****
--- 2413,2419 ----
  
     Error: could not open \"c:\\temp\\prspool.ps\" for reading."
    :type 'boolean
+   :version "20"
    :group 'printing)
  
  
***************
*** 2369,2374 ****
--- 2427,2433 ----
  `pr-ps-directory-print', `pr-ps-directory-ps-print', `pr-printify-directory'
  and `pr-txt-directory'."
    :type 'boolean
+   :version "20"
    :group 'printing)
  
  
***************
*** 2377,2382 ****
--- 2436,2442 ----
  
  It's used by `pr-interface'."
    :type 'string
+   :version "20"
    :group 'printing)
  
  
***************
*** 2390,2395 ****
--- 2450,2456 ----
  
  It's used by `pr-interface'."
    :type '(repeat (regexp :tag "Buffer Name Regexp"))
+   :version "20"
    :group 'printing)
  
  
***************
*** 2398,2403 ****
--- 2459,2465 ----
  
  It's used by `pr-interface'."
    :type 'boolean
+   :version "20"
    :group 'printing)
  
  
***************
*** 2445,2450 ****
--- 2507,2538 ----
  
  
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;; Macros
+ 
+ 
+ (defvar pr-interactive-p nil
+   "Save the `interactive-p' result value.
+ 
+ It's used by `pr-save-interactive' (which see).")
+ 
+ 
+ (defmacro pr-save-interactive (&rest body)
+   "Save the `interactive-p' result value using `let'.
+ 
+ It uses `pr-interactive-p' var (which see)."
+   `(let ((pr-interactive-p (or pr-interactive-p (interactive-p))))
+      ,@body))
+ 
+ 
+ (defmacro pr-save-file-modes (&rest body)
+   "Set temporally file modes to `pr-file-modes'."
+   `(let ((pr--default-file-modes (default-file-modes)))       ; save default
+      (set-default-file-modes pr-file-modes)
+      ,@body
+      (set-default-file-modes pr--default-file-modes))) ; restore default
+ 
+ 
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  ;; Keys & Menus
  
  
***************
*** 2489,2521 ****
  
  
    (defconst pr-menu-spec
!     (cond
!      ((eq ps-print-emacs-type 'emacs) ; GNU Emacs
!       '(
        ["Printing Interface" pr-interface
!        :help "Use buffer interface instead of menu interface"]
        "--"
!       ("PostScript Preview" :visible (pr-visible-p 'postscript)
!        :help "Preview PostScript instead of sending to printer"
!        ("Directory" :active (not pr-spool-p)
          ["1-up"     (pr-ps-directory-preview 1   nil nil t) t]
          ["2-up"     (pr-ps-directory-preview 2   nil nil t) t]
          ["4-up"     (pr-ps-directory-preview 4   nil nil t) t]
          ["Other..." (pr-ps-directory-preview nil nil nil t)
           :keys "\\[pr-ps-buffer-preview]"])
!        ("Buffer" :active (not pr-spool-p)
          ["1-up"     (pr-ps-buffer-preview 1   t) t]
          ["2-up"     (pr-ps-buffer-preview 2   t) t]
          ["4-up"     (pr-ps-buffer-preview 4   t) t]
          ["Other..." (pr-ps-buffer-preview nil t)
           :keys "\\[pr-ps-buffer-preview]"])
!        ("Region" :active (and (not pr-spool-p) (ps-mark-active-p))
          ["1-up"     (pr-ps-region-preview 1   t) t]
          ["2-up"     (pr-ps-region-preview 2   t) t]
          ["4-up"     (pr-ps-region-preview 4   t) t]
          ["Other..." (pr-ps-region-preview nil t)
           :keys "\\[pr-ps-region-preview]"])
!        ("Mode" :active (and (not pr-spool-p) (pr-mode-alist-p))
          ["1-up"     (pr-ps-mode-preview 1   t) t]
          ["2-up"     (pr-ps-mode-preview 2   t) t]
          ["4-up"     (pr-ps-mode-preview 4   t) t]
--- 2577,2622 ----
  
  
    (defconst pr-menu-spec
!     ;; Menu mapping:
!     ;;   unfortunately XEmacs doesn't support :active or :visible
!     ;;   for submenus, only for items.
!     ;;   It uses :included instead of :active or :visible.
!     ;;   Also, XEmacs doesn't support :help tag.
!     (let ((pr-:active  (if (eq ps-print-emacs-type 'emacs)
!                          :active      ; GNU Emacs
!                        :included))    ; XEmacs
!         (pr-:visible (if (eq ps-print-emacs-type 'emacs)
!                          :visible     ; GNU Emacs
!                        :included))    ; XEmacs
!         pr-:help)
!       (if (eq ps-print-emacs-type 'emacs)
!         (defalias 'pr-:help #'(lambda (text) (list :help text))) ; GNU Emacs
!       (defalias 'pr-:help 'ignore))                              ; XEmacs
!       `(
        ["Printing Interface" pr-interface
!        ,@(pr-:help "Use buffer interface instead of menu interface")]
        "--"
!       ("PostScript Preview" ,pr-:visible (pr-visible-p 'postscript)
!        ,@(pr-:help "Preview PostScript instead of sending to printer")
!        ("Directory" ,pr-:active (not pr-spool-p)
          ["1-up"     (pr-ps-directory-preview 1   nil nil t) t]
          ["2-up"     (pr-ps-directory-preview 2   nil nil t) t]
          ["4-up"     (pr-ps-directory-preview 4   nil nil t) t]
          ["Other..." (pr-ps-directory-preview nil nil nil t)
           :keys "\\[pr-ps-buffer-preview]"])
!        ("Buffer" ,pr-:active (not pr-spool-p)
          ["1-up"     (pr-ps-buffer-preview 1   t) t]
          ["2-up"     (pr-ps-buffer-preview 2   t) t]
          ["4-up"     (pr-ps-buffer-preview 4   t) t]
          ["Other..." (pr-ps-buffer-preview nil t)
           :keys "\\[pr-ps-buffer-preview]"])
!        ("Region" ,pr-:active (and (not pr-spool-p) (ps-mark-active-p))
          ["1-up"     (pr-ps-region-preview 1   t) t]
          ["2-up"     (pr-ps-region-preview 2   t) t]
          ["4-up"     (pr-ps-region-preview 4   t) t]
          ["Other..." (pr-ps-region-preview nil t)
           :keys "\\[pr-ps-region-preview]"])
!        ("Mode" ,pr-:active (and (not pr-spool-p) (pr-mode-alist-p))
          ["1-up"     (pr-ps-mode-preview 1   t) t]
          ["2-up"     (pr-ps-mode-preview 2   t) t]
          ["4-up"     (pr-ps-mode-preview 4   t) t]
***************
*** 2524,2533 ****
         ("File"
          ["No Preprocessing..." (call-interactively 'pr-ps-file-preview)
           :keys "\\[pr-ps-file-preview]"
!          :help "Preview PostScript file"]
          "--"
          ["PostScript Utility" pr-update-menus :active pr-ps-utility-alist
!          :help "Select PostScript utility"]
          "--"
          ["1-up..."   (pr-ps-file-up-preview 1   t t) pr-ps-utility-alist]
          ["2-up..."   (pr-ps-file-up-preview 2   t t) pr-ps-utility-alist]
--- 2625,2634 ----
         ("File"
          ["No Preprocessing..." (call-interactively 'pr-ps-file-preview)
           :keys "\\[pr-ps-file-preview]"
!          ,@(pr-:help "Preview PostScript file")]
          "--"
          ["PostScript Utility" pr-update-menus :active pr-ps-utility-alist
!          ,@(pr-:help "Select PostScript utility")]
          "--"
          ["1-up..."   (pr-ps-file-up-preview 1   t t) pr-ps-utility-alist]
          ["2-up..."   (pr-ps-file-up-preview 2   t t) pr-ps-utility-alist]
***************
*** 2537,2557 ****
          "--"
          ["Landscape" pr-toggle-file-landscape
           :style toggle :selected pr-file-landscape
!          :help "Toggle landscape for PostScript file"
           :active pr-ps-utility-alist]
          ["Duplex"    pr-toggle-file-duplex
           :style toggle :selected pr-file-duplex
!          :help "Toggle duplex for PostScript file"
           :active pr-ps-utility-alist]
          ["Tumble"    pr-toggle-file-tumble
           :style toggle :selected pr-file-tumble
!          :help "Toggle tumble for PostScript file"
           :active (and pr-file-duplex pr-ps-utility-alist)])
         ["Despool..." (call-interactively 'pr-despool-preview)
          :active pr-spool-p :keys "\\[pr-despool-preview]"
!         :help "Despool PostScript buffer to printer or file (C-u)"])
!       ("PostScript Print" :visible (pr-visible-p 'postscript)
!        :help "Send PostScript to printer or file (C-u)"
         ("Directory"
          ["1-up"     (pr-ps-directory-ps-print 1   nil nil t) t]
          ["2-up"     (pr-ps-directory-ps-print 2   nil nil t) t]
--- 2638,2658 ----
          "--"
          ["Landscape" pr-toggle-file-landscape
           :style toggle :selected pr-file-landscape
!          ,@(pr-:help "Toggle landscape for PostScript file")
           :active pr-ps-utility-alist]
          ["Duplex"    pr-toggle-file-duplex
           :style toggle :selected pr-file-duplex
!          ,@(pr-:help "Toggle duplex for PostScript file")
           :active pr-ps-utility-alist]
          ["Tumble"    pr-toggle-file-tumble
           :style toggle :selected pr-file-tumble
!          ,@(pr-:help "Toggle tumble for PostScript file")
           :active (and pr-file-duplex pr-ps-utility-alist)])
         ["Despool..." (call-interactively 'pr-despool-preview)
          :active pr-spool-p :keys "\\[pr-despool-preview]"
!         ,@(pr-:help "Despool PostScript buffer to printer or file (C-u)")])
!       ("PostScript Print" ,pr-:visible (pr-visible-p 'postscript)
!        ,@(pr-:help "Send PostScript to printer or file (C-u)")
         ("Directory"
          ["1-up"     (pr-ps-directory-ps-print 1   nil nil t) t]
          ["2-up"     (pr-ps-directory-ps-print 2   nil nil t) t]
***************
*** 2564,2576 ****
          ["4-up"     (pr-ps-buffer-ps-print 4   t) t]
          ["Other..." (pr-ps-buffer-ps-print nil t)
           :keys "\\[pr-ps-buffer-ps-print]"])
!        ("Region" :active (ps-mark-active-p)
          ["1-up"     (pr-ps-region-ps-print 1   t) t]
          ["2-up"     (pr-ps-region-ps-print 2   t) t]
          ["4-up"     (pr-ps-region-ps-print 4   t) t]
          ["Other..." (pr-ps-region-ps-print nil t)
           :keys "\\[pr-ps-region-ps-print]"])
!        ("Mode" :active (pr-mode-alist-p)
          ["1-up"     (pr-ps-mode-ps-print 1   t) t]
          ["2-up"     (pr-ps-mode-ps-print 2   t) t]
          ["4-up"     (pr-ps-mode-ps-print 4   t) t]
--- 2665,2677 ----
          ["4-up"     (pr-ps-buffer-ps-print 4   t) t]
          ["Other..." (pr-ps-buffer-ps-print nil t)
           :keys "\\[pr-ps-buffer-ps-print]"])
!        ("Region" ,pr-:active (ps-mark-active-p)
          ["1-up"     (pr-ps-region-ps-print 1   t) t]
          ["2-up"     (pr-ps-region-ps-print 2   t) t]
          ["4-up"     (pr-ps-region-ps-print 4   t) t]
          ["Other..." (pr-ps-region-ps-print nil t)
           :keys "\\[pr-ps-region-ps-print]"])
!        ("Mode" ,pr-:active (pr-mode-alist-p)
          ["1-up"     (pr-ps-mode-ps-print 1   t) t]
          ["2-up"     (pr-ps-mode-ps-print 2   t) t]
          ["4-up"     (pr-ps-mode-ps-print 4   t) t]
***************
*** 2579,2588 ****
         ("File"
          ["No Preprocessing..." (call-interactively 'pr-ps-file-ps-print)
           :keys "\\[pr-ps-file-ps-print]"
!          :help "Send PostScript file to printer"]
          "--"
          ["PostScript Utility" pr-update-menus :active pr-ps-utility-alist
!          :help "Select PostScript utility"]
          "--"
          ["1-up..."   (pr-ps-file-up-ps-print 1   t t) pr-ps-utility-alist]
          ["2-up..."   (pr-ps-file-up-ps-print 2   t t) pr-ps-utility-alist]
--- 2680,2689 ----
         ("File"
          ["No Preprocessing..." (call-interactively 'pr-ps-file-ps-print)
           :keys "\\[pr-ps-file-ps-print]"
!          ,@(pr-:help "Send PostScript file to printer")]
          "--"
          ["PostScript Utility" pr-update-menus :active pr-ps-utility-alist
!          ,@(pr-:help "Select PostScript utility")]
          "--"
          ["1-up..."   (pr-ps-file-up-ps-print 1   t t) pr-ps-utility-alist]
          ["2-up..."   (pr-ps-file-up-ps-print 2   t t) pr-ps-utility-alist]
***************
*** 2592,2628 ****
          "--"
          ["Landscape" pr-toggle-file-landscape
           :style toggle :selected pr-file-landscape
!          :help "Toggle landscape for PostScript file"
           :active pr-ps-utility-alist]
          ["Duplex"    pr-toggle-file-duplex
           :style toggle :selected pr-file-duplex
!          :help "Toggle duplex for PostScript file"
           :active pr-ps-utility-alist]
          ["Tumble"    pr-toggle-file-tumble
           :style toggle :selected pr-file-tumble
!          :help "Toggle tumble for PostScript file"
           :active (and pr-file-duplex pr-ps-utility-alist)])
         ["Despool..." (call-interactively 'pr-despool-ps-print)
          :active pr-spool-p :keys "\\[pr-despool-ps-print]"
!         :help "Despool PostScript buffer to printer or file (C-u)"])
        ["PostScript Printers" pr-update-menus
         :active pr-ps-printer-alist :included (pr-visible-p 'postscript)
!        :help "Select PostScript printer"]
        "--"
!       ("Printify" :visible (pr-visible-p 'text)
!        :help "Replace non-printing chars with printable representations."
         ["Directory" pr-printify-directory t]
         ["Buffer"    pr-printify-buffer    t]
         ["Region"    pr-printify-region    (ps-mark-active-p)])
!       ("Print" :visible (pr-visible-p 'text)
!        :help "Send text to printer"
         ["Directory" pr-txt-directory t]
         ["Buffer"    pr-txt-buffer    t]
         ["Region"    pr-txt-region    (ps-mark-active-p)]
         ["Mode"      pr-txt-mode      (pr-mode-alist-p)])
        ["Text Printers" pr-update-menus
         :active pr-txt-printer-alist :included (pr-visible-p 'text)
!        :help "Select text printer"]
        "--"
        ["Landscape"               pr-toggle-landscape
         :style toggle :selected ps-landscape-mode
--- 2693,2730 ----
          "--"
          ["Landscape" pr-toggle-file-landscape
           :style toggle :selected pr-file-landscape
!          ,@(pr-:help "Toggle landscape for PostScript file")
           :active pr-ps-utility-alist]
          ["Duplex"    pr-toggle-file-duplex
           :style toggle :selected pr-file-duplex
!          ,@(pr-:help "Toggle duplex for PostScript file")
           :active pr-ps-utility-alist]
          ["Tumble"    pr-toggle-file-tumble
           :style toggle :selected pr-file-tumble
!          ,@(pr-:help "Toggle tumble for PostScript file")
           :active (and pr-file-duplex pr-ps-utility-alist)])
         ["Despool..." (call-interactively 'pr-despool-ps-print)
          :active pr-spool-p :keys "\\[pr-despool-ps-print]"
!         ,@(pr-:help "Despool PostScript buffer to printer or file (C-u)")])
        ["PostScript Printers" pr-update-menus
         :active pr-ps-printer-alist :included (pr-visible-p 'postscript)
!        ,@(pr-:help "Select PostScript printer")]
        "--"
!       ("Printify" ,pr-:visible (pr-visible-p 'text)
!        ,@(pr-:help
!           "Replace non-printing chars with printable representations.")
         ["Directory" pr-printify-directory t]
         ["Buffer"    pr-printify-buffer    t]
         ["Region"    pr-printify-region    (ps-mark-active-p)])
!       ("Print" ,pr-:visible (pr-visible-p 'text)
!        ,@(pr-:help "Send text to printer")
         ["Directory" pr-txt-directory t]
         ["Buffer"    pr-txt-buffer    t]
         ["Region"    pr-txt-region    (ps-mark-active-p)]
         ["Mode"      pr-txt-mode      (pr-mode-alist-p)])
        ["Text Printers" pr-update-menus
         :active pr-txt-printer-alist :included (pr-visible-p 'text)
!        ,@(pr-:help "Select text printer")]
        "--"
        ["Landscape"               pr-toggle-landscape
         :style toggle :selected ps-landscape-mode
***************
*** 2648,2655 ****
        ["Upside-Down"             pr-toggle-upside-down
         :style toggle :selected ps-print-upside-down
         :included (pr-visible-p 'postscript-options)]
!       ("Print All Pages" :visible (pr-visible-p 'postscript-options)
!        :help "Select odd/even pages/sheets to print"
         ["All Pages"   (pr-even-or-odd-pages nil)
          :style radio :selected (eq ps-even-or-odd-pages nil)]
         ["Even Pages"  (pr-even-or-odd-pages 'even-page)
--- 2750,2757 ----
        ["Upside-Down"             pr-toggle-upside-down
         :style toggle :selected ps-print-upside-down
         :included (pr-visible-p 'postscript-options)]
!       ("Print All Pages" ,pr-:visible (pr-visible-p 'postscript-options)
!        ,@(pr-:help "Select odd/even pages/sheets to print")
         ["All Pages"   (pr-even-or-odd-pages nil)
          :style radio :selected (eq ps-even-or-odd-pages nil)]
         ["Even Pages"  (pr-even-or-odd-pages 'even-page)
***************
*** 2664,2866 ****
        ["Spool Buffer"            pr-toggle-spool
         :style toggle :selected pr-spool-p
         :included (pr-visible-p 'postscript-process)
!        :help "Toggle PostScript spooling"]
        ["Print with faces"        pr-toggle-faces
         :style toggle :selected pr-faces-p
         :included (pr-visible-p 'postscript-process)
!        :help "Toggle PostScript printing with faces"]
        ["Print via Ghostscript" pr-toggle-ghostscript
         :style toggle :selected pr-print-using-ghostscript
         :included (pr-visible-p 'postscript-process)
!        :help "Toggle PostScript generation using ghostscript"]
!       "--"
!       ["Auto Region" pr-toggle-region
!        :style toggle :selected pr-auto-region
!        :included (pr-visible-p 'printing)]
!       ["Auto Mode"   pr-toggle-mode
!        :style toggle :selected pr-auto-mode
!        :included (pr-visible-p 'printing)]
!       ["Menu Lock"   pr-toggle-lock
!        :style toggle :selected pr-menu-lock
!        :included (pr-visible-p 'printing)]
!       "--"
!       ("Customize" :visible (pr-visible-p 'help)
!        ["printing" pr-customize       t]
!        ["ps-print" ps-print-customize t]
!        ["lpr"      lpr-customize      t])
!       ("Show Settings" :visible (pr-visible-p 'help)
!        ["printing" pr-show-pr-setup  t]
!        ["ps-print" pr-show-ps-setup  t]
!        ["lpr"      pr-show-lpr-setup t])
!       ["Help" pr-help :active t :included (pr-visible-p 'help)]
!       ))
! 
! 
!      ((eq ps-print-emacs-type 'xemacs)        ; XEmacs
!       ;; Menu mapping:
!       ;;   unfortunately XEmacs doesn't support :active or :visible
!       ;;   for submenus, only for items.
!       ;;   It uses :included instead of :active or :visible.
!       ;;   Also, XEmacs doesn't support :help tag.
!       '(
!       ["Printing Interface" pr-interface]
!       "--"
!       ("PostScript Preview" :included (pr-visible-p 'postscript)
!        ("Directory" :included (not pr-spool-p)
!         ["1-up"     (pr-ps-directory-preview 1   nil nil t) t]
!         ["2-up"     (pr-ps-directory-preview 2   nil nil t) t]
!         ["4-up"     (pr-ps-directory-preview 4   nil nil t) t]
!         ["Other..." (pr-ps-directory-preview nil nil nil t)
!          :keys "\\[pr-ps-buffer-preview]"])
!        ("Buffer" :included (not pr-spool-p)
!         ["1-up"     (pr-ps-buffer-preview 1   t) t]
!         ["2-up"     (pr-ps-buffer-preview 2   t) t]
!         ["4-up"     (pr-ps-buffer-preview 4   t) t]
!         ["Other..." (pr-ps-buffer-preview nil t)
!          :keys "\\[pr-ps-buffer-preview]"])
!        ("Region" :included (and (not pr-spool-p) (ps-mark-active-p))
!         ["1-up"     (pr-ps-region-preview 1   t) t]
!         ["2-up"     (pr-ps-region-preview 2   t) t]
!         ["4-up"     (pr-ps-region-preview 4   t) t]
!         ["Other..." (pr-ps-region-preview nil t)
!          :keys "\\[pr-ps-region-preview]"])
!        ("Mode" :included (and (not pr-spool-p) (pr-mode-alist-p))
!         ["1-up"     (pr-ps-mode-preview 1   t) t]
!         ["2-up"     (pr-ps-mode-preview 2   t) t]
!         ["4-up"     (pr-ps-mode-preview 4   t) t]
!         ["Other..." (pr-ps-mode-preview nil t)
!          :keys "\\[pr-ps-mode-preview]"])
!        ("File"
!         ["No Preprocessing..." (call-interactively 'pr-ps-file-preview)
!          :keys "\\[pr-ps-file-preview]"]
!         "--"
!         ["PostScript Utility" pr-update-menus :active pr-ps-utility-alist]
!         "--"
!         ["1-up..."   (pr-ps-file-up-preview 1   t t) pr-ps-utility-alist]
!         ["2-up..."   (pr-ps-file-up-preview 2   t t) pr-ps-utility-alist]
!         ["4-up..."   (pr-ps-file-up-preview 4   t t) pr-ps-utility-alist]
!         ["Other..."  (pr-ps-file-up-preview nil t t)
!          :keys "\\[pr-ps-file-up-preview]" :active pr-ps-utility-alist]
!         "--"
!         ["Landscape" pr-toggle-file-landscape
!          :style toggle :selected pr-file-landscape
!          :active pr-ps-utility-alist]
!         ["Duplex"    pr-toggle-file-duplex
!          :style toggle :selected pr-file-duplex
!          :active pr-ps-utility-alist]
!         ["Tumble"    pr-toggle-file-tumble
!          :style toggle :selected pr-file-tumble
!          :active (and pr-file-duplex pr-ps-utility-alist)])
!        ["Despool..." (call-interactively 'pr-despool-preview)
!         :active pr-spool-p :keys "\\[pr-despool-preview]"])
!       ("PostScript Print" :included (pr-visible-p 'postscript)
!        ("Directory"
!         ["1-up"     (pr-ps-directory-ps-print 1   nil nil t) t]
!         ["2-up"     (pr-ps-directory-ps-print 2   nil nil t) t]
!         ["4-up"     (pr-ps-directory-ps-print 4   nil nil t) t]
!         ["Other..." (pr-ps-directory-ps-print nil nil nil t)
!          :keys "\\[pr-ps-buffer-ps-print]"])
!        ("Buffer"
!         ["1-up"     (pr-ps-buffer-ps-print 1   t) t]
!         ["2-up"     (pr-ps-buffer-ps-print 2   t) t]
!         ["4-up"     (pr-ps-buffer-ps-print 4   t) t]
!         ["Other..." (pr-ps-buffer-ps-print nil t)
!          :keys "\\[pr-ps-buffer-ps-print]"])
!        ("Region" :included (ps-mark-active-p)
!         ["1-up"     (pr-ps-region-ps-print 1   t) t]
!         ["2-up"     (pr-ps-region-ps-print 2   t) t]
!         ["4-up"     (pr-ps-region-ps-print 4   t) t]
!         ["Other..." (pr-ps-region-ps-print nil t)
!          :keys "\\[pr-ps-region-ps-print]"])
!        ("Mode" :included (pr-mode-alist-p)
!         ["1-up"     (pr-ps-mode-ps-print 1   t) t]
!         ["2-up"     (pr-ps-mode-ps-print 2   t) t]
!         ["4-up"     (pr-ps-mode-ps-print 4   t) t]
!         ["Other..." (pr-ps-mode-ps-print nil t)
!          :keys "\\[pr-ps-mode-ps-print]"])
!        ("File"
!         ["No Preprocessing..." (call-interactively 'pr-ps-file-ps-print)
!          :keys "\\[pr-ps-file-ps-print]"]
!         "--"
!         ["PostScript Utility" pr-update-menus :active pr-ps-utility-alist]
!         "--"
!         ["1-up..."   (pr-ps-file-up-ps-print 1   t t) pr-ps-utility-alist]
!         ["2-up..."   (pr-ps-file-up-ps-print 2   t t) pr-ps-utility-alist]
!         ["4-up..."   (pr-ps-file-up-ps-print 4   t t) pr-ps-utility-alist]
!         ["Other..."  (pr-ps-file-up-ps-print nil t t)
!          :keys "\\[pr-ps-file-up-ps-print]" :active pr-ps-utility-alist]
!         "--"
!         ["Landscape" pr-toggle-file-landscape
!          :style toggle :selected pr-file-landscape
!          :active pr-ps-utility-alist]
!         ["Duplex"    pr-toggle-file-duplex
!          :style toggle :selected pr-file-duplex
!          :active pr-ps-utility-alist]
!         ["Tumble"    pr-toggle-file-tumble
!          :style toggle :selected pr-file-tumble
!          :active (and pr-file-duplex pr-ps-utility-alist)])
!        ["Despool..." (call-interactively 'pr-despool-ps-print)
!         :active pr-spool-p :keys "\\[pr-despool-ps-print]"])
!       ["PostScript Printers" pr-update-menus
!        :active pr-ps-printer-alist :included (pr-visible-p 'postscript)]
!       "--"
!       ("Printify" :included (pr-visible-p 'text)
!        ["Directory" pr-printify-directory t]
!        ["Buffer"    pr-printify-buffer    t]
!        ["Region"    pr-printify-region    (ps-mark-active-p)])
!       ("Print" :included (pr-visible-p 'text)
!        ["Directory" pr-txt-directory t]
!        ["Buffer"    pr-txt-buffer    t]
!        ["Region"    pr-txt-region    (ps-mark-active-p)]
!        ["Mode"      pr-txt-mode      (pr-mode-alist-p)])
!       ["Text Printers" pr-update-menus
!        :active pr-txt-printer-alist :included (pr-visible-p 'text)]
!       "--"
!       ["Landscape"               pr-toggle-landscape
!        :style toggle :selected ps-landscape-mode
!        :included (pr-visible-p 'postscript-options)]
!       ["Print Header"            pr-toggle-header
!        :style toggle :selected ps-print-header
!        :included (pr-visible-p 'postscript-options)]
!       ["Print Header Frame"      pr-toggle-header-frame
!        :style toggle :selected ps-print-header-frame :active ps-print-header
!        :included (pr-visible-p 'postscript-options)]
!       ["Line Number"             pr-toggle-line
!        :style toggle :selected ps-line-number
!        :included (pr-visible-p 'postscript-options)]
!       ["Zebra Stripes"           pr-toggle-zebra
!        :style toggle :selected ps-zebra-stripes
!        :included (pr-visible-p 'postscript-options)]
!       ["Duplex"                  pr-toggle-duplex
!        :style toggle :selected ps-spool-duplex
!        :included (pr-visible-p 'postscript-options)]
!       ["Tumble"                  pr-toggle-tumble
!        :style toggle :selected ps-spool-tumble :active ps-spool-duplex
!        :included (pr-visible-p 'postscript-options)]
!       ["Upside-Down"             pr-toggle-upside-down
!        :style toggle :selected ps-print-upside-down
!        :included (pr-visible-p 'postscript-options)]
!       ("Print All Pages" :included (pr-visible-p 'postscript-options)
!        ["All Pages"   (pr-even-or-odd-pages nil)
!         :style radio :selected (eq ps-even-or-odd-pages nil)]
!        ["Even Pages"  (pr-even-or-odd-pages 'even-page)
!         :style radio :selected (eq ps-even-or-odd-pages 'even-page)]
!        ["Odd Pages"   (pr-even-or-odd-pages 'odd-page)
!         :style radio :selected (eq ps-even-or-odd-pages 'odd-page)]
!        ["Even Sheets" (pr-even-or-odd-pages 'even-sheet)
!         :style radio :selected (eq ps-even-or-odd-pages 'even-sheet)]
!        ["Odd Sheets"  (pr-even-or-odd-pages 'odd-sheet)
!         :style radio :selected (eq ps-even-or-odd-pages 'odd-sheet)])
!       "--"
!       ["Spool Buffer"            pr-toggle-spool
!        :style toggle :selected pr-spool-p
!        :included (pr-visible-p 'postscript-process)]
!       ["Print with faces"        pr-toggle-faces
!        :style toggle :selected pr-faces-p
!        :included (pr-visible-p 'postscript-process)]
!       ["Print via Ghostscript" pr-toggle-ghostscript
!        :style toggle :selected pr-print-using-ghostscript
!        :included (pr-visible-p 'postscript-process)]
        "--"
        ["Auto Region" pr-toggle-region
         :style toggle :selected pr-auto-region
--- 2766,2780 ----
        ["Spool Buffer"            pr-toggle-spool
         :style toggle :selected pr-spool-p
         :included (pr-visible-p 'postscript-process)
!        ,@(pr-:help "Toggle PostScript spooling")]
        ["Print with faces"        pr-toggle-faces
         :style toggle :selected pr-faces-p
         :included (pr-visible-p 'postscript-process)
!        ,@(pr-:help "Toggle PostScript printing with faces")]
        ["Print via Ghostscript" pr-toggle-ghostscript
         :style toggle :selected pr-print-using-ghostscript
         :included (pr-visible-p 'postscript-process)
!        ,@(pr-:help "Toggle PostScript generation using ghostscript")]
        "--"
        ["Auto Region" pr-toggle-region
         :style toggle :selected pr-auto-region
***************
*** 2872,2888 ****
         :style toggle :selected pr-menu-lock
         :included (pr-visible-p 'printing)]
        "--"
!       ("Customize" :included (pr-visible-p 'help)
         ["printing" pr-customize       t]
         ["ps-print" ps-print-customize t]
         ["lpr"      lpr-customize      t])
!       ("Show Settings" :included (pr-visible-p 'help)
         ["printing" pr-show-pr-setup  t]
         ["ps-print" pr-show-ps-setup  t]
         ["lpr"      pr-show-lpr-setup t])
        ["Help" pr-help :active t :included (pr-visible-p 'help)]
!       ))
!      ))
  
  
    (cond
--- 2786,2801 ----
         :style toggle :selected pr-menu-lock
         :included (pr-visible-p 'printing)]
        "--"
!       ("Customize" ,pr-:visible (pr-visible-p 'help)
         ["printing" pr-customize       t]
         ["ps-print" ps-print-customize t]
         ["lpr"      lpr-customize      t])
!       ("Show Settings" ,pr-:visible (pr-visible-p 'help)
         ["printing" pr-show-pr-setup  t]
         ["ps-print" pr-show-ps-setup  t]
         ["lpr"      pr-show-lpr-setup t])
        ["Help" pr-help :active t :included (pr-visible-p 'help)]
!       )))
  
  
    (cond
***************
*** 2915,2937 ****
              pr-menu-bar (vector 'menu-bar 'file
                                  (pr-get-symbol "Print")))))
       (t
!       (easy-menu-change '("file") "Print" pr-menu-spec)))
! 
!     ;; Key binding
!     (global-set-key [print]   'pr-ps-fast-fire)
!     (global-set-key [M-print] 'pr-ps-mode-using-ghostscript)
!     (global-set-key [C-print] 'pr-txt-fast-fire))
  
  
     ((eq ps-print-emacs-type 'xemacs)  ; XEmacs
      ;; Menu binding
      (pr-xemacs-global-menubar
!      (pr-x-add-submenu nil (cons "Printing" pr-menu-spec) "Apps"))
  
!     ;; Key binding
!     (global-set-key 'f22           'pr-ps-fast-fire)
!     (global-set-key '(meta f22)    'pr-ps-mode-using-ghostscript)
!     (global-set-key '(control f22) 'pr-txt-fast-fire))))
  
  
  ;;; You can also use something like:
--- 2828,2856 ----
              pr-menu-bar (vector 'menu-bar 'file
                                  (pr-get-symbol "Print")))))
       (t
!       (easy-menu-change '("file") "Print" pr-menu-spec))))
  
  
     ((eq ps-print-emacs-type 'xemacs)  ; XEmacs
      ;; Menu binding
      (pr-xemacs-global-menubar
!      (pr-x-add-submenu nil (cons "Printing" pr-menu-spec) "Apps"))))
! 
  
!   ;; Key binding
!   (let ((pr-print-key (if (eq ps-print-emacs-type 'emacs)
!                         'print        ; GNU Emacs
!                       'f22)))         ; XEmacs
!     (global-set-key `[,pr-print-key]                'pr-ps-fast-fire)
!     ;; Well, M-print and S-print are used because in my keyboard S-print works
!     ;; and M-print doesn't.  But M-print can work in other keyboard.
!     (global-set-key `[(meta ,pr-print-key)]         
'pr-ps-mode-using-ghostscript)
!     (global-set-key `[(shift ,pr-print-key)]        
'pr-ps-mode-using-ghostscript)
!     ;; Well, C-print and C-M-print are used because in my keyboard C-M-print 
works
!     ;; and C-print doesn't.  But C-print can work in other keyboard.
!     (global-set-key `[(control ,pr-print-key)]      'pr-txt-fast-fire)
!     (global-set-key `[(control meta ,pr-print-key)] 'pr-txt-fast-fire)
!     ))
  
  
  ;;; You can also use something like:
***************
*** 3407,3415 ****
  
  For more information, type \\[pr-interface-help]."
    (interactive)
!   (save-excursion
!     (set-buffer (or buffer (current-buffer)))
!     (pr-create-interface)))
  
  
  ;;;###autoload
--- 3326,3335 ----
  
  For more information, type \\[pr-interface-help]."
    (interactive)
!   (pr-save-interactive
!    (save-excursion
!      (set-buffer (or buffer (current-buffer)))
!      (pr-create-interface))))
  
  
  ;;;###autoload
***************
*** 3430,3441 ****
  
  See also documentation for `pr-list-directory'."
    (interactive (pr-interactive-ps-dir-args (pr-prompt "PS preview dir")))
!   (pr-set-ps-dir-args 'n-up 'dir 'file-regexp 'filename
!                     (pr-prompt "PS preview dir"))
!   (setq filename (pr-ps-file filename))
!   (pr-ps-file-list n-up dir file-regexp filename)
!   (or pr-spool-p
!       (pr-ps-file-preview filename)))
  
  
  ;;;###autoload
--- 3350,3362 ----
  
  See also documentation for `pr-list-directory'."
    (interactive (pr-interactive-ps-dir-args (pr-prompt "PS preview dir")))
!   (pr-save-interactive
!    (pr-set-ps-dir-args 'n-up 'dir 'file-regexp 'filename
!                      (pr-prompt "PS preview dir"))
!    (setq filename (pr-ps-file filename))
!    (pr-ps-file-list n-up dir file-regexp filename)
!    (or pr-spool-p
!        (pr-ps-file-preview filename))))
  
  
  ;;;###autoload
***************
*** 3456,3467 ****
  
  See also documentation for `pr-list-directory'."
    (interactive (pr-interactive-ps-dir-args (pr-prompt "PS print dir GS")))
!   (pr-set-ps-dir-args 'n-up 'dir 'file-regexp 'filename
!                     (pr-prompt "PS print dir GS"))
!   (let ((file (pr-ps-file filename)))
!     (pr-ps-file-list n-up dir file-regexp file)
!     (pr-ps-file-using-ghostscript file)
!     (or filename (pr-delete-file file))))
  
  
  ;;;###autoload
--- 3377,3389 ----
  
  See also documentation for `pr-list-directory'."
    (interactive (pr-interactive-ps-dir-args (pr-prompt "PS print dir GS")))
!   (pr-save-interactive
!    (pr-set-ps-dir-args 'n-up 'dir 'file-regexp 'filename
!                      (pr-prompt "PS print dir GS"))
!    (let ((file (pr-ps-file filename)))
!      (pr-ps-file-list n-up dir file-regexp file)
!      (pr-ps-file-using-ghostscript file)
!      (or filename (pr-delete-file file)))))
  
  
  ;;;###autoload
***************
*** 3482,3493 ****
  
  See also documentation for `pr-list-directory'."
    (interactive (pr-interactive-ps-dir-args (pr-prompt "PS print dir")))
!   (pr-set-ps-dir-args 'n-up 'dir 'file-regexp 'filename
!                     (pr-prompt "PS print dir"))
!   (let ((file (pr-ps-file filename)))
!     (pr-ps-file-list n-up dir file-regexp file)
!     (pr-ps-file-print file)
!     (or filename (pr-delete-file file))))
  
  
  ;;;###autoload
--- 3404,3416 ----
  
  See also documentation for `pr-list-directory'."
    (interactive (pr-interactive-ps-dir-args (pr-prompt "PS print dir")))
!   (pr-save-interactive
!    (pr-set-ps-dir-args 'n-up 'dir 'file-regexp 'filename
!                      (pr-prompt "PS print dir"))
!    (let ((file (pr-ps-file filename)))
!      (pr-ps-file-list n-up dir file-regexp file)
!      (pr-ps-file-print file)
!      (or filename (pr-delete-file file)))))
  
  
  ;;;###autoload
***************
*** 3511,3521 ****
  See also documentation for `pr-list-directory'."
    (interactive (pr-interactive-ps-dir-args
                (pr-prompt (pr-prompt-gs "PS print dir"))))
!   (pr-set-ps-dir-args 'n-up 'dir 'file-regexp 'filename
!                     (pr-prompt (pr-prompt-gs "PS print dir")))
!   (if (pr-using-ghostscript-p)
!       (pr-ps-directory-using-ghostscript n-up dir file-regexp filename)
!     (pr-ps-directory-print n-up dir file-regexp filename)))
  
  
  ;;;###autoload
--- 3434,3445 ----
  See also documentation for `pr-list-directory'."
    (interactive (pr-interactive-ps-dir-args
                (pr-prompt (pr-prompt-gs "PS print dir"))))
!   (pr-save-interactive
!    (pr-set-ps-dir-args 'n-up 'dir 'file-regexp 'filename
!                      (pr-prompt (pr-prompt-gs "PS print dir")))
!    (if (pr-using-ghostscript-p)
!        (pr-ps-directory-using-ghostscript n-up dir file-regexp filename)
!      (pr-ps-directory-print n-up dir file-regexp filename))))
  
  
  ;;;###autoload
***************
*** 3531,3540 ****
  temporary file.  If FILENAME is a string, save the PostScript image in a file
  with that name.  If FILENAME is t, prompts for a file name."
    (interactive (pr-interactive-n-up-file (pr-prompt "PS preview")))
!   (if (pr-auto-mode-p)
!       (pr-ps-mode-preview n-up filename)
!     (pr-ps-preview (pr-region-active-symbol) n-up filename
!                  (pr-region-active-string "PS preview"))))
  
  
  ;;;###autoload
--- 3455,3465 ----
  temporary file.  If FILENAME is a string, save the PostScript image in a file
  with that name.  If FILENAME is t, prompts for a file name."
    (interactive (pr-interactive-n-up-file (pr-prompt "PS preview")))
!   (pr-save-interactive
!    (if (pr-auto-mode-p)
!        (pr-ps-mode-preview n-up filename)
!      (pr-ps-preview (pr-region-active-symbol) n-up filename
!                   (pr-region-active-string "PS preview")))))
  
  
  ;;;###autoload
***************
*** 3550,3559 ****
  printer.  If FILENAME is a string, save the PostScript image in a file with
  that name.  If FILENAME is t, prompts for a file name."
    (interactive (pr-interactive-n-up-file (pr-prompt "PS print GS")))
!   (if (pr-auto-mode-p)
!       (pr-ps-mode-using-ghostscript n-up filename)
!     (pr-ps-using-ghostscript (pr-region-active-symbol) n-up filename
!                            (pr-region-active-string "PS print GS"))))
  
  
  ;;;###autoload
--- 3475,3485 ----
  printer.  If FILENAME is a string, save the PostScript image in a file with
  that name.  If FILENAME is t, prompts for a file name."
    (interactive (pr-interactive-n-up-file (pr-prompt "PS print GS")))
!   (pr-save-interactive
!    (if (pr-auto-mode-p)
!        (pr-ps-mode-using-ghostscript n-up filename)
!      (pr-ps-using-ghostscript (pr-region-active-symbol) n-up filename
!                             (pr-region-active-string "PS print GS")))))
  
  
  ;;;###autoload
***************
*** 3569,3578 ****
  printer.  If FILENAME is a string, save the PostScript image in a file with
  that name.  If FILENAME is t, prompts for a file name."
    (interactive (pr-interactive-n-up-file (pr-prompt "PS print")))
!   (if (pr-auto-mode-p)
!       (pr-ps-mode-print n-up filename)
!     (pr-ps-print (pr-region-active-symbol) n-up filename
!                (pr-region-active-string "PS print"))))
  
  
  ;;;###autoload
--- 3495,3505 ----
  printer.  If FILENAME is a string, save the PostScript image in a file with
  that name.  If FILENAME is t, prompts for a file name."
    (interactive (pr-interactive-n-up-file (pr-prompt "PS print")))
!   (pr-save-interactive
!    (if (pr-auto-mode-p)
!        (pr-ps-mode-print n-up filename)
!      (pr-ps-print (pr-region-active-symbol) n-up filename
!                 (pr-region-active-string "PS print")))))
  
  
  ;;;###autoload
***************
*** 3591,3604 ****
  that name.  If FILENAME is t, prompts for a file name."
    (interactive (pr-interactive-n-up-file
                (pr-prompt (pr-prompt-gs "PS print"))))
!   (cond ((pr-auto-mode-p)
!        (pr-ps-mode-ps-print n-up filename))
!       ((pr-using-ghostscript-p)
!        (pr-ps-using-ghostscript (pr-region-active-symbol) n-up filename
!                                 (pr-region-active-string "PS print GS")))
!       (t
!        (pr-ps-print (pr-region-active-symbol) n-up filename
!                     (pr-region-active-string "PS print")))))
  
  
  ;;;###autoload
--- 3518,3532 ----
  that name.  If FILENAME is t, prompts for a file name."
    (interactive (pr-interactive-n-up-file
                (pr-prompt (pr-prompt-gs "PS print"))))
!   (pr-save-interactive
!    (cond ((pr-auto-mode-p)
!         (pr-ps-mode-ps-print n-up filename))
!        ((pr-using-ghostscript-p)
!         (pr-ps-using-ghostscript (pr-region-active-symbol) n-up filename
!                                  (pr-region-active-string "PS print GS")))
!        (t
!         (pr-ps-print (pr-region-active-symbol) n-up filename
!                      (pr-region-active-string "PS print"))))))
  
  
  ;;;###autoload
***************
*** 3607,3616 ****
  
  See also `pr-ps-buffer-preview'."
    (interactive (pr-interactive-n-up-file (pr-prompt-region "PS preview")))
!   (if (pr-auto-mode-p)
!       (let ((pr-auto-region t))
!       (pr-ps-mode-preview n-up filename))
!     (pr-ps-preview 'region n-up filename "PS preview region")))
  
  
  ;;;###autoload
--- 3535,3545 ----
  
  See also `pr-ps-buffer-preview'."
    (interactive (pr-interactive-n-up-file (pr-prompt-region "PS preview")))
!   (pr-save-interactive
!    (if (pr-auto-mode-p)
!        (let ((pr-auto-region t))
!        (pr-ps-mode-preview n-up filename))
!      (pr-ps-preview 'region n-up filename "PS preview region"))))
  
  
  ;;;###autoload
***************
*** 3619,3628 ****
  
  See also `pr-ps-buffer-using-ghostscript'."
    (interactive (pr-interactive-n-up-file (pr-prompt-region "PS print GS")))
!   (if (pr-auto-mode-p)
!       (let ((pr-auto-region t))
!       (pr-ps-mode-using-ghostscript n-up filename))
!     (pr-ps-using-ghostscript 'region n-up filename "PS print GS region")))
  
  
  ;;;###autoload
--- 3548,3558 ----
  
  See also `pr-ps-buffer-using-ghostscript'."
    (interactive (pr-interactive-n-up-file (pr-prompt-region "PS print GS")))
!   (pr-save-interactive
!    (if (pr-auto-mode-p)
!        (let ((pr-auto-region t))
!        (pr-ps-mode-using-ghostscript n-up filename))
!      (pr-ps-using-ghostscript 'region n-up filename "PS print GS region"))))
  
  
  ;;;###autoload
***************
*** 3631,3640 ****
  
  See also `pr-ps-buffer-print'."
    (interactive (pr-interactive-n-up-file (pr-prompt-region "PS print")))
!   (if (pr-auto-mode-p)
!       (let ((pr-auto-region t))
!       (pr-ps-mode-print n-up filename))
!     (pr-ps-print 'region n-up filename "PS print region")))
  
  
  ;;;###autoload
--- 3561,3571 ----
  
  See also `pr-ps-buffer-print'."
    (interactive (pr-interactive-n-up-file (pr-prompt-region "PS print")))
!   (pr-save-interactive
!    (if (pr-auto-mode-p)
!        (let ((pr-auto-region t))
!        (pr-ps-mode-print n-up filename))
!      (pr-ps-print 'region n-up filename "PS print region"))))
  
  
  ;;;###autoload
***************
*** 3644,3656 ****
  See also `pr-ps-buffer-ps-print'."
    (interactive (pr-interactive-n-up-file
                (pr-prompt-region (pr-prompt-gs "PS print"))))
!   (cond ((pr-auto-mode-p)
!        (let ((pr-auto-region t))
!          (pr-ps-mode-ps-print n-up filename)))
!       ((pr-using-ghostscript-p)
!        (pr-ps-using-ghostscript 'region n-up filename "PS print GS region"))
!       (t
!        (pr-ps-print 'region n-up filename "PS print region"))))
  
  
  ;;;###autoload
--- 3575,3588 ----
  See also `pr-ps-buffer-ps-print'."
    (interactive (pr-interactive-n-up-file
                (pr-prompt-region (pr-prompt-gs "PS print"))))
!   (pr-save-interactive
!    (cond ((pr-auto-mode-p)
!         (let ((pr-auto-region t))
!           (pr-ps-mode-ps-print n-up filename)))
!        ((pr-using-ghostscript-p)
!         (pr-ps-using-ghostscript 'region n-up filename "PS print GS region"))
!        (t
!         (pr-ps-print 'region n-up filename "PS print region")))))
  
  
  ;;;###autoload
***************
*** 3659,3669 ****
  
  See also `pr-ps-buffer-preview'."
    (interactive (pr-interactive-n-up-file "PS preview mode"))
!   (pr-set-n-up-and-filename 'n-up 'filename "PS preview mode")
!   (let ((file (pr-ps-file filename)))
!     (and (pr-ps-mode n-up file)
!        (not pr-spool-p)
!        (pr-ps-file-preview file))))
  
  
  ;;;###autoload
--- 3591,3602 ----
  
  See also `pr-ps-buffer-preview'."
    (interactive (pr-interactive-n-up-file "PS preview mode"))
!   (pr-save-interactive
!    (pr-set-n-up-and-filename 'n-up 'filename "PS preview mode")
!    (let ((file (pr-ps-file filename)))
!      (and (pr-ps-mode n-up file)
!         (not pr-spool-p)
!         (pr-ps-file-preview file)))))
  
  
  ;;;###autoload
***************
*** 3672,3683 ****
  
  See also `pr-ps-buffer-using-ghostscript'."
    (interactive (pr-interactive-n-up-file "PS print GS mode"))
!   (pr-set-n-up-and-filename 'n-up 'filename "PS print GS mode")
!   (let ((file (pr-ps-file filename)))
!     (when (and (pr-ps-mode n-up file)
!              (not pr-spool-p))
!       (pr-ps-file-using-ghostscript file)
!       (or filename (pr-delete-file file)))))
  
  
  ;;;###autoload
--- 3605,3617 ----
  
  See also `pr-ps-buffer-using-ghostscript'."
    (interactive (pr-interactive-n-up-file "PS print GS mode"))
!   (pr-save-interactive
!    (pr-set-n-up-and-filename 'n-up 'filename "PS print GS mode")
!    (let ((file (pr-ps-file filename)))
!      (when (and (pr-ps-mode n-up file)
!               (not pr-spool-p))
!        (pr-ps-file-using-ghostscript file)
!        (or filename (pr-delete-file file))))))
  
  
  ;;;###autoload
***************
*** 3686,3693 ****
  
  See also `pr-ps-buffer-print'."
    (interactive (pr-interactive-n-up-file "PS print mode"))
!   (pr-set-n-up-and-filename 'n-up 'filename "PS print mode")
!   (pr-ps-mode n-up filename))
  
  
  ;;;###autoload
--- 3620,3628 ----
  
  See also `pr-ps-buffer-print'."
    (interactive (pr-interactive-n-up-file "PS print mode"))
!   (pr-save-interactive
!    (pr-set-n-up-and-filename 'n-up 'filename "PS print mode")
!    (pr-ps-mode n-up filename)))
  
  
  ;;;###autoload
***************
*** 3696,3704 ****
  
  See also `pr-ps-buffer-ps-print'."
    (interactive (pr-interactive-n-up-file (pr-prompt-gs "PS print mode")))
!   (if (pr-using-ghostscript-p)
!       (pr-ps-mode-using-ghostscript n-up filename)
!     (pr-ps-mode-print n-up filename)))
  
  
  ;;;###autoload
--- 3631,3640 ----
  
  See also `pr-ps-buffer-ps-print'."
    (interactive (pr-interactive-n-up-file (pr-prompt-gs "PS print mode")))
!   (pr-save-interactive
!    (if (pr-using-ghostscript-p)
!        (pr-ps-mode-using-ghostscript n-up filename)
!      (pr-ps-mode-print n-up filename))))
  
  
  ;;;###autoload
***************
*** 3715,3722 ****
  
  See also documentation for `pr-list-directory'."
    (interactive (pr-interactive-dir-args "Printify dir"))
!   (pr-set-dir-args 'dir 'file-regexp "Printify dir")
!   (pr-file-list dir file-regexp 'pr-printify-buffer))
  
  
  ;;;###autoload
--- 3651,3659 ----
  
  See also documentation for `pr-list-directory'."
    (interactive (pr-interactive-dir-args "Printify dir"))
!   (pr-save-interactive
!    (pr-set-dir-args 'dir 'file-regexp "Printify dir")
!    (pr-file-list dir file-regexp 'pr-printify-buffer)))
  
  
  ;;;###autoload
***************
*** 3751,3758 ****
  
  See also documentation for `pr-list-directory'."
    (interactive (pr-interactive-dir-args "Print dir"))
!   (pr-set-dir-args 'dir 'file-regexp "Print dir")
!   (pr-file-list dir file-regexp 'pr-txt-buffer))
  
  
  ;;;###autoload
--- 3688,3696 ----
  
  See also documentation for `pr-list-directory'."
    (interactive (pr-interactive-dir-args "Print dir"))
!   (pr-save-interactive
!    (pr-set-dir-args 'dir 'file-regexp "Print dir")
!    (pr-file-list dir file-regexp 'pr-txt-buffer)))
  
  
  ;;;###autoload
***************
*** 3800,3809 ****
  save the image in a temporary file.  If FILENAME is a string, save the
  PostScript image in a file with that name."
    (interactive (list (ps-print-preprint current-prefix-arg)))
!   (let ((file (pr-ps-file filename)))
!     (when (stringp file)
!       (pr-despool-print file)
!       (pr-ps-file-preview file))))
  
  
  ;;;###autoload
--- 3738,3748 ----
  save the image in a temporary file.  If FILENAME is a string, save the
  PostScript image in a file with that name."
    (interactive (list (ps-print-preprint current-prefix-arg)))
!   (pr-save-interactive
!    (let ((file (pr-ps-file filename)))
!      (when (stringp file)
!        (pr-despool-print file)
!        (pr-ps-file-preview file)))))
  
  
  ;;;###autoload
***************
*** 3818,3828 ****
  send the image to the printer.  If FILENAME is a string, save the PostScript
  image in a file with that name."
    (interactive (list (ps-print-preprint current-prefix-arg)))
!   (let ((file (pr-ps-file filename)))
!     (when (stringp file)
!       (pr-despool-print file)
!       (pr-ps-file-using-ghostscript file)
!       (or filename (pr-delete-file file)))))
  
  
  ;;;###autoload
--- 3757,3768 ----
  send the image to the printer.  If FILENAME is a string, save the PostScript
  image in a file with that name."
    (interactive (list (ps-print-preprint current-prefix-arg)))
!   (pr-save-interactive
!    (let ((file (pr-ps-file filename)))
!      (when (stringp file)
!        (pr-despool-print file)
!        (pr-ps-file-using-ghostscript file)
!        (or filename (pr-delete-file file))))))
  
  
  ;;;###autoload
***************
*** 3837,3847 ****
  send the image to the printer.  If FILENAME is a string, save the PostScript
  image in a file with that name."
    (interactive (list (ps-print-preprint current-prefix-arg)))
!   (let ((ps-lpr-command         (pr-command pr-ps-command))
!       (ps-lpr-switches        pr-ps-switches)
!       (ps-printer-name-option pr-ps-printer-switch)
!       (ps-printer-name        pr-ps-printer))
!     (ps-despool filename)))
  
  
  ;;;###autoload
--- 3777,3789 ----
  send the image to the printer.  If FILENAME is a string, save the PostScript
  image in a file with that name."
    (interactive (list (ps-print-preprint current-prefix-arg)))
!   (pr-save-interactive
!    (pr-save-file-modes
!     (let ((ps-lpr-command         (pr-command pr-ps-command))
!         (ps-lpr-switches        pr-ps-switches)
!         (ps-printer-name-option pr-ps-printer-switch)
!         (ps-printer-name        pr-ps-printer))
!       (ps-despool filename)))))
  
  
  ;;;###autoload
***************
*** 3856,3864 ****
  send the image to the printer.  If FILENAME is a string, save the PostScript
  image in a file with that name."
    (interactive (list (ps-print-preprint current-prefix-arg)))
!   (if pr-print-using-ghostscript
!       (pr-despool-using-ghostscript filename)
!     (pr-despool-print filename)))
  
  
  ;;;###autoload
--- 3798,3807 ----
  send the image to the printer.  If FILENAME is a string, save the PostScript
  image in a file with that name."
    (interactive (list (ps-print-preprint current-prefix-arg)))
!   (pr-save-interactive
!    (if pr-print-using-ghostscript
!        (pr-despool-using-ghostscript filename)
!      (pr-despool-print filename))))
  
  
  ;;;###autoload
***************
*** 3873,3882 ****
  (defun pr-ps-file-up-preview (n-up ifilename &optional ofilename)
    "Preview PostScript file FILENAME."
    (interactive (pr-interactive-n-up-inout "PS preview"))
!   (let ((outfile (pr-ps-utility-args 'n-up 'ifilename 'ofilename
!                                    "PS preview ")))
!     (pr-ps-utility-process n-up ifilename outfile)
!     (pr-ps-file-preview outfile)))
  
  
  ;;;###autoload
--- 3816,3826 ----
  (defun pr-ps-file-up-preview (n-up ifilename &optional ofilename)
    "Preview PostScript file FILENAME."
    (interactive (pr-interactive-n-up-inout "PS preview"))
!   (pr-save-interactive
!    (let ((outfile (pr-ps-utility-args 'n-up 'ifilename 'ofilename
!                                     "PS preview ")))
!      (pr-ps-utility-process n-up ifilename outfile)
!      (pr-ps-file-preview outfile))))
  
  
  ;;;###autoload
***************
*** 3884,3903 ****
    "Print PostScript file FILENAME using ghostscript."
    (interactive (list (pr-ps-infile-preprint "Print preview ")))
    (and (stringp filename) (file-exists-p filename)
!        (let* ((file (pr-expand-file-name filename))
!             (tempfile (pr-dosify-file-name (make-temp-file file))))
!        ;; gs use
!        (pr-call-process pr-gs-command
!                         (format "-sDEVICE=%s" pr-gs-device)
!                         (format "-r%d" pr-gs-resolution)
!                         (pr-switches-string pr-gs-switches "pr-gs-switches")
!                         (format "-sOutputFile=\"%s\"" tempfile)
!                         file
!                         "-c quit")
!        ;; printing
!        (pr-ps-file-print tempfile)
!        ;; deleting
!        (pr-delete-file tempfile))))
  
  
  ;;;###autoload
--- 3828,3848 ----
    "Print PostScript file FILENAME using ghostscript."
    (interactive (list (pr-ps-infile-preprint "Print preview ")))
    (and (stringp filename) (file-exists-p filename)
!        (pr-save-interactive
!       (let* ((file (pr-expand-file-name filename))
!              (tempfile (pr-dosify-file-name (make-temp-file file))))
!         ;; gs use
!         (pr-call-process pr-gs-command
!                          (format "-sDEVICE=%s" pr-gs-device)
!                          (format "-r%d" pr-gs-resolution)
!                          (pr-switches-string pr-gs-switches "pr-gs-switches")
!                          (format "-sOutputFile=\"%s\"" tempfile)
!                          file
!                          "-c quit")
!         ;; printing
!         (pr-ps-file-print tempfile)
!         ;; deleting
!         (pr-delete-file tempfile)))))
  
  
  ;;;###autoload
***************
*** 3908,3919 ****
--- 3853,3866 ----
         ;; printing
         (let ((file (pr-expand-file-name filename)))
         (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)
                 (erase-buffer)
                 (insert-file-contents-literally file))
               (pr-despool-print))
+          ;; use `pr-ps-command' to print
           (apply 'pr-call-process
                  pr-ps-command
                  (pr-switches-string pr-ps-switches "pr-gs-switches")
***************
*** 3958,3979 ****
                (if pr-print-using-ghostscript
                    "PS print GS"
                  "PS print")))
!   (let ((outfile (pr-ps-utility-args 'n-up 'ifilename 'ofilename
!                                    (if pr-print-using-ghostscript
!                                        "PS print GS "
!                                      "PS print "))))
!     (pr-ps-utility-process n-up ifilename outfile)
!     (unless ofilename
!       (pr-ps-file-ps-print outfile)
!       (pr-delete-file outfile))))
  
  
  ;;;###autoload
  (defun pr-toggle-file-duplex ()
    "Toggle duplex for PostScript file."
    (interactive)
!   (pr-toggle 'pr-file-duplex "PS file duplex" nil 7 5 nil
!            '("PostScript Print" "File")))
  
  
  ;;;###autoload
--- 3905,3928 ----
                (if pr-print-using-ghostscript
                    "PS print GS"
                  "PS print")))
!   (pr-save-interactive
!    (let ((outfile (pr-ps-utility-args 'n-up 'ifilename 'ofilename
!                                     (if pr-print-using-ghostscript
!                                         "PS print GS "
!                                       "PS print "))))
!      (pr-ps-utility-process n-up ifilename outfile)
!      (unless ofilename
!        (pr-ps-file-ps-print outfile)
!        (pr-delete-file outfile)))))
  
  
  ;;;###autoload
  (defun pr-toggle-file-duplex ()
    "Toggle duplex for PostScript file."
    (interactive)
!   (pr-save-interactive
!    (pr-toggle 'pr-file-duplex "PS file duplex" nil 7 5 nil
!             '("PostScript Print" "File"))))
  
  
  ;;;###autoload
***************
*** 3985,4032 ****
  If tumble is on, produces a printing suitable for binding at the top or
  bottom."
    (interactive)
!   (pr-toggle 'pr-file-tumble "PS file tumble" nil 8 5 nil
!            '("PostScript Print" "File")))
  
  
  ;;;###autoload
  (defun pr-toggle-file-landscape ()
    "Toggle landscape for PostScript file."
    (interactive)
!   (pr-toggle 'pr-file-landscape "PS file landscape" nil 6 5 nil
!            '("PostScript Print" "File")))
  
  
  ;;;###autoload
  (defun pr-toggle-ghostscript ()
    "Toggle printing using ghostscript."
    (interactive)
!   (pr-toggle 'pr-print-using-ghostscript "Printing using ghostscript"
!            'postscript-process 2 12 'toggle))
  
  
  ;;;###autoload
  (defun pr-toggle-faces ()
    "Toggle printing with faces."
    (interactive)
!   (pr-toggle 'pr-faces-p "Printing with faces"
!            'postscript-process 1 12 'toggle))
  
  
  ;;;###autoload
  (defun pr-toggle-spool ()
    "Toggle spooling."
    (interactive)
!   (pr-toggle 'pr-spool-p "Spooling printing"
!            'postscript-process 0 12 'toggle))
  
  
  ;;;###autoload
  (defun pr-toggle-duplex ()
    "Toggle duplex."
    (interactive)
!   (pr-toggle 'ps-spool-duplex "Printing duplex"
!            'postcsript-options 5 12 'toggle))
  
  
  ;;;###autoload
--- 3934,3987 ----
  If tumble is on, produces a printing suitable for binding at the top or
  bottom."
    (interactive)
!   (pr-save-interactive
!    (pr-toggle 'pr-file-tumble "PS file tumble" nil 8 5 nil
!             '("PostScript Print" "File"))))
  
  
  ;;;###autoload
  (defun pr-toggle-file-landscape ()
    "Toggle landscape for PostScript file."
    (interactive)
!   (pr-save-interactive
!    (pr-toggle 'pr-file-landscape "PS file landscape" nil 6 5 nil
!             '("PostScript Print" "File"))))
  
  
  ;;;###autoload
  (defun pr-toggle-ghostscript ()
    "Toggle printing using ghostscript."
    (interactive)
!   (pr-save-interactive
!    (pr-toggle 'pr-print-using-ghostscript "Printing using ghostscript"
!             'postscript-process 2 12 'toggle)))
  
  
  ;;;###autoload
  (defun pr-toggle-faces ()
    "Toggle printing with faces."
    (interactive)
!   (pr-save-interactive
!    (pr-toggle 'pr-faces-p "Printing with faces"
!             'postscript-process 1 12 'toggle)))
  
  
  ;;;###autoload
  (defun pr-toggle-spool ()
    "Toggle spooling."
    (interactive)
!   (pr-save-interactive
!    (pr-toggle 'pr-spool-p "Spooling printing"
!             'postscript-process 0 12 'toggle)))
  
  
  ;;;###autoload
  (defun pr-toggle-duplex ()
    "Toggle duplex."
    (interactive)
!   (pr-save-interactive
!    (pr-toggle 'ps-spool-duplex "Printing duplex"
!             'postcsript-options 5 12 'toggle)))
  
  
  ;;;###autoload
***************
*** 4038,4117 ****
  If tumble is on, produces a printing suitable for binding at the top or
  bottom."
    (interactive)
!   (pr-toggle 'ps-spool-tumble "Tumble"
!            'postscript-options 6 12 'toggle))
  
  
  ;;;###autoload
  (defun pr-toggle-landscape ()
    "Toggle landscape."
    (interactive)
!   (pr-toggle 'ps-landscape-mode "Landscape"
!            'postscript-options 0 12 'toggle))
  
  
  ;;;###autoload
  (defun pr-toggle-upside-down ()
    "Toggle upside-down."
    (interactive)
!   (pr-toggle 'ps-print-upside-down "Upside-Down"
!            'postscript-options 7 12 'toggle))
  
  
  ;;;###autoload
  (defun pr-toggle-line ()
    "Toggle line number."
    (interactive)
!   (pr-toggle 'ps-line-number "Line number"
!            'postscript-options 3 12 'toggle))
  
  
  ;;;###autoload
  (defun pr-toggle-zebra ()
    "Toggle zebra stripes."
    (interactive)
!   (pr-toggle 'ps-zebra-stripes "Zebra stripe"
!            'postscript-options 4 12 'toggle))
  
  
  ;;;###autoload
  (defun pr-toggle-header ()
    "Toggle printing header."
    (interactive)
!   (pr-toggle 'ps-print-header "Print header"
!            'postscript-options 1 12 'toggle))
  
  
  ;;;###autoload
  (defun pr-toggle-header-frame ()
    "Toggle printing header frame."
    (interactive)
!   (pr-toggle 'ps-print-header-frame "Print header frame"
!            'postscript-options 2 12 'toggle))
  
  
  ;;;###autoload
  (defun pr-toggle-lock ()
    "Toggle menu lock."
    (interactive)
!   (pr-toggle 'pr-menu-lock "Menu lock"
!            'printing 2 12 'toggle))
  
  
  ;;;###autoload
  (defun pr-toggle-region ()
    "Toggle auto region."
    (interactive)
!   (pr-toggle 'pr-auto-region "Auto region"
!            'printing 0 12 'toggle))
  
  
  ;;;###autoload
  (defun pr-toggle-mode ()
    "Toggle auto mode."
    (interactive)
!   (pr-toggle 'pr-auto-mode "Auto mode"
!            'printing 1 12 'toggle))
  
  
  ;;;###autoload
--- 3993,4082 ----
  If tumble is on, produces a printing suitable for binding at the top or
  bottom."
    (interactive)
!   (pr-save-interactive
!    (pr-toggle 'ps-spool-tumble "Tumble"
!             'postscript-options 6 12 'toggle)))
  
  
  ;;;###autoload
  (defun pr-toggle-landscape ()
    "Toggle landscape."
    (interactive)
!   (pr-save-interactive
!    (pr-toggle 'ps-landscape-mode "Landscape"
!             'postscript-options 0 12 'toggle)))
  
  
  ;;;###autoload
  (defun pr-toggle-upside-down ()
    "Toggle upside-down."
    (interactive)
!   (pr-save-interactive
!    (pr-toggle 'ps-print-upside-down "Upside-Down"
!             'postscript-options 7 12 'toggle)))
  
  
  ;;;###autoload
  (defun pr-toggle-line ()
    "Toggle line number."
    (interactive)
!   (pr-save-interactive
!    (pr-toggle 'ps-line-number "Line number"
!             'postscript-options 3 12 'toggle)))
  
  
  ;;;###autoload
  (defun pr-toggle-zebra ()
    "Toggle zebra stripes."
    (interactive)
!   (pr-save-interactive
!    (pr-toggle 'ps-zebra-stripes "Zebra stripe"
!             'postscript-options 4 12 'toggle)))
  
  
  ;;;###autoload
  (defun pr-toggle-header ()
    "Toggle printing header."
    (interactive)
!   (pr-save-interactive
!    (pr-toggle 'ps-print-header "Print header"
!             'postscript-options 1 12 'toggle)))
  
  
  ;;;###autoload
  (defun pr-toggle-header-frame ()
    "Toggle printing header frame."
    (interactive)
!   (pr-save-interactive
!    (pr-toggle 'ps-print-header-frame "Print header frame"
!             'postscript-options 2 12 'toggle)))
  
  
  ;;;###autoload
  (defun pr-toggle-lock ()
    "Toggle menu lock."
    (interactive)
!   (pr-save-interactive
!    (pr-toggle 'pr-menu-lock "Menu lock"
!             'printing 2 12 'toggle)))
  
  
  ;;;###autoload
  (defun pr-toggle-region ()
    "Toggle auto region."
    (interactive)
!   (pr-save-interactive
!    (pr-toggle 'pr-auto-region "Auto region"
!             'printing 0 12 'toggle)))
  
  
  ;;;###autoload
  (defun pr-toggle-mode ()
    "Toggle auto mode."
    (interactive)
!   (pr-save-interactive
!    (pr-toggle 'pr-auto-mode "Auto mode"
!             'printing 1 12 'toggle)))
  
  
  ;;;###autoload
***************
*** 4139,4162 ****
  (defun pr-ps-name ()
    "Interactively select a PostScript printer."
    (interactive)
!   (pr-menu-set-ps-title
!    (pr-complete-alist "PostScript printer" pr-ps-printer-alist pr-ps-name)))
  
  
  ;;;###autoload
  (defun pr-txt-name ()
    "Interactively select a text printer."
    (interactive)
!   (pr-menu-set-txt-title
!    (pr-complete-alist "Text printer" pr-txt-printer-alist pr-txt-name)))
  
  
  ;;;###autoload
  (defun pr-ps-utility ()
    "Interactively select a PostScript utility."
    (interactive)
!   (pr-menu-set-utility-title
!    (pr-complete-alist "Postscript utility" pr-ps-utility-alist 
pr-ps-utility)))
  
  
  ;;;###autoload
--- 4104,4133 ----
  (defun pr-ps-name ()
    "Interactively select a PostScript printer."
    (interactive)
!   (pr-save-interactive
!    (pr-menu-set-ps-title
!     (pr-complete-alist "PostScript printer"
!                      pr-ps-printer-alist pr-ps-name))))
  
  
  ;;;###autoload
  (defun pr-txt-name ()
    "Interactively select a text printer."
    (interactive)
!   (pr-save-interactive
!    (pr-menu-set-txt-title
!     (pr-complete-alist "Text printer"
!                      pr-txt-printer-alist pr-txt-name))))
  
  
  ;;;###autoload
  (defun pr-ps-utility ()
    "Interactively select a PostScript utility."
    (interactive)
!   (pr-save-interactive
!    (pr-menu-set-utility-title
!     (pr-complete-alist "Postscript utility"
!                      pr-ps-utility-alist pr-ps-utility))))
  
  
  ;;;###autoload
***************
*** 4247,4274 ****
  are both set to t."
    (interactive (list (pr-interactive-n-up (pr-prompt-gs "PS print fast"))
                     current-prefix-arg))
!   (let ((pr-auto-region t)
!       (pr-auto-mode   t)
!       filename)
!     (cond ((null select))
!         ((listp select)
!          (pr-ps-name))
!         ((and (symbolp select)
!               (assq select pr-ps-printer-alist))
!          (pr-menu-set-ps-title select))
!         ((integerp select)
!          (and (/= select 1)
!               (pr-ps-name))
!          (and (>= select 1) (not pr-spool-p)
!               (setq filename (pr-ps-outfile-preprint
!                               (if pr-print-using-ghostscript
!                                   "Fast GS "
!                                 "Fast "))))))
!     (pr-ps-buffer-ps-print
!      (if (integerp n-up)
!        (min (max n-up 1) 100)
!        (error "n-up must be an integer greater than zero"))
!      filename)))
  
  
  ;;;###autoload
--- 4218,4246 ----
  are both set to t."
    (interactive (list (pr-interactive-n-up (pr-prompt-gs "PS print fast"))
                     current-prefix-arg))
!   (pr-save-interactive
!    (let ((pr-auto-region t)
!        (pr-auto-mode   t)
!        filename)
!      (cond ((null select))
!          ((listp select)
!           (pr-ps-name))
!          ((and (symbolp select)
!                (assq select pr-ps-printer-alist))
!           (pr-menu-set-ps-title select))
!          ((integerp select)
!           (and (/= select 1)
!                (pr-ps-name))
!           (and (>= select 1) (not pr-spool-p)
!                (setq filename (pr-ps-outfile-preprint
!                                (if pr-print-using-ghostscript
!                                    "Fast GS "
!                                  "Fast "))))))
!      (pr-ps-buffer-ps-print
!       (if (integerp n-up)
!         (min (max n-up 1) 100)
!       (error "n-up must be an integer greater than zero"))
!       filename))))
  
  
  ;;;###autoload
***************
*** 4296,4310 ****
  Note that this command always behaves as if `pr-auto-region' and 
`pr-auto-mode'
  are both set to t."
    (interactive (list current-prefix-arg))
!   (cond ((null select-printer))
!       ((and (symbolp select-printer)
!             (assq select-printer pr-txt-printer-alist))
!        (pr-menu-set-txt-title select-printer))
!       (t
!        (pr-txt-name)))
!   (let ((pr-auto-region t)
!       (pr-auto-mode   t))
!     (pr-txt-buffer)))
  
  
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
--- 4268,4283 ----
  Note that this command always behaves as if `pr-auto-region' and 
`pr-auto-mode'
  are both set to t."
    (interactive (list current-prefix-arg))
!   (pr-save-interactive
!    (cond ((null select-printer))
!        ((and (symbolp select-printer)
!              (assq select-printer pr-txt-printer-alist))
!         (pr-menu-set-txt-title select-printer))
!        (t
!         (pr-txt-name)))
!    (let ((pr-auto-region t)
!        (pr-auto-mode   t))
!      (pr-txt-buffer))))
  
  
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
***************
*** 4350,4355 ****
--- 4323,4329 ----
        nil
        '(20 . pr-temp-dir)
        '(20 . pr-ps-temp-file)
+       '(20 . pr-file-modes)
        '(20 . pr-delete-temp-file)
        '(20 . pr-list-directory)
        nil
***************
*** 4704,4710 ****
  
      ;; GNU Emacs
      (defun pr-menu-lock (entry index horizontal state path)
!       (when (and (not (interactive-p)) pr-menu-lock)
        (or (and pr-menu-position (eq state pr-menu-state))
            (setq pr-menu-position (pr-menu-position entry index horizontal)
                  pr-menu-state    state))
--- 4678,4684 ----
  
      ;; GNU Emacs
      (defun pr-menu-lock (entry index horizontal state path)
!       (when (and (not pr-interactive-p) pr-menu-lock)
        (or (and pr-menu-position (eq state pr-menu-state))
            (setq pr-menu-position (pr-menu-position entry index horizontal)
                  pr-menu-state    state))
***************
*** 4726,4732 ****
  
      ;; XEmacs
      (defun pr-menu-lock (entry index horizontal state path)
!       (when (and (not (interactive-p)) pr-menu-lock)
        (or (and pr-menu-position (eq state pr-menu-state))
            (setq pr-menu-position (pr-menu-position entry index horizontal)
                  pr-menu-state    state))
--- 4700,4706 ----
  
      ;; XEmacs
      (defun pr-menu-lock (entry index horizontal state path)
!       (when (and (not pr-interactive-p) pr-menu-lock)
        (or (and pr-menu-position (eq state pr-menu-state))
            (setq pr-menu-position (pr-menu-position entry index horizontal)
                  pr-menu-state    state))
***************
*** 4757,4766 ****
  non-nil, and update PostScript File menus iff `pr-ps-utility-menu-modified' is
  non-nil."
    (interactive "P")
!   (pr-update-var 'pr-ps-name pr-ps-printer-alist)
!   (pr-update-var 'pr-txt-name pr-txt-printer-alist)
!   (pr-update-var 'pr-ps-utility pr-ps-utility-alist)
!   (pr-do-update-menus force))
  
  
  (defvar pr-ps-printer-menu-modified  t
--- 4731,4741 ----
  non-nil, and update PostScript File menus iff `pr-ps-utility-menu-modified' is
  non-nil."
    (interactive "P")
!   (pr-save-interactive
!    (pr-update-var 'pr-ps-name pr-ps-printer-alist)
!    (pr-update-var 'pr-txt-name pr-txt-printer-alist)
!    (pr-update-var 'pr-ps-utility pr-ps-utility-alist)
!    (pr-do-update-menus force)))
  
  
  (defvar pr-ps-printer-menu-modified  t
***************
*** 5280,5286 ****
    (or (symbol-value n-up-sym)
        (set n-up-sym (pr-interactive-n-up prompt)))
    (and (eq (symbol-value infile-sym) t)
!        (set infile-sym (and (not (interactive-p))
                            (pr-ps-infile-preprint prompt))))
    ;; input file
    (or (symbol-value infile-sym)
--- 5255,5261 ----
    (or (symbol-value n-up-sym)
        (set n-up-sym (pr-interactive-n-up prompt)))
    (and (eq (symbol-value infile-sym) t)
!        (set infile-sym (and (not pr-interactive-p)
                            (pr-ps-infile-preprint prompt))))
    ;; input file
    (or (symbol-value infile-sym)
***************
*** 5288,5294 ****
    (set infile-sym (pr-dosify-file-name (symbol-value infile-sym)))
    ;; output file
    (and (eq (symbol-value outfile-sym) t)
!        (set outfile-sym (and (not (interactive-p))
                             current-prefix-arg
                             (pr-ps-outfile-preprint prompt))))
    (and (symbol-value outfile-sym)
--- 5263,5269 ----
    (set infile-sym (pr-dosify-file-name (symbol-value infile-sym)))
    ;; output file
    (and (eq (symbol-value outfile-sym) t)
!        (set outfile-sym (and (not pr-interactive-p)
                             current-prefix-arg
                             (pr-ps-outfile-preprint prompt))))
    (and (symbol-value outfile-sym)
***************
*** 5331,5353 ****
  
  
  (defun pr-call-process (command &rest args)
!   (let ((buffer (get-buffer-create "*Printing Command Output*"))
!       (cmd    (pr-command command))
!       status)
!     (setq args (pr-remove-nil-from-list args))
!     (save-excursion
!       (set-buffer buffer)
!       (goto-char (point-max))
!       (insert (format "%s %S\n" cmd args)))
!     (setq status
!         (condition-case data
!             (apply 'call-process cmd nil buffer nil args)
!           ((quit error)
!            (error-message-string data))))
!     (save-excursion
!       (set-buffer buffer)
!       (goto-char (point-max))
!       (insert (format "Exit status: %s\n" status)))))
  
  
  (defun pr-txt-print (from to)
--- 5306,5329 ----
  
  
  (defun pr-call-process (command &rest args)
!   (pr-save-file-modes
!    (let ((buffer (get-buffer-create "*Printing Command Output*"))
!        (cmd    (pr-command command))
!        status)
!      (setq args (pr-remove-nil-from-list args))
!      (save-excursion
!        (set-buffer buffer)
!        (goto-char (point-max))
!        (insert (format "%s %S\n" cmd args)))
!      (setq status
!          (condition-case data
!              (apply 'call-process cmd nil buffer nil args)
!            ((quit error)
!             (error-message-string data))))
!      (save-excursion
!        (set-buffer buffer)
!        (goto-char (point-max))
!        (insert (format "Exit status: %s\n" status))))))
  
  
  (defun pr-txt-print (from to)
***************
*** 5485,5491 ****
  (defun pr-set-outfilename (filename-sym)
    (and (not pr-spool-p)
         (eq (symbol-value filename-sym) t)
!        (set filename-sym (and (not (interactive-p))
                              current-prefix-arg
                              (ps-print-preprint current-prefix-arg))))
    (and (symbol-value filename-sym)
--- 5461,5467 ----
  (defun pr-set-outfilename (filename-sym)
    (and (not pr-spool-p)
         (eq (symbol-value filename-sym) t)
!        (set filename-sym (and (not pr-interactive-p)
                              current-prefix-arg
                              (ps-print-preprint current-prefix-arg))))
    (and (symbol-value filename-sym)
***************
*** 5580,5620 ****
  
  
  (defun pr-text2ps (kind n-up filename &optional from to)
!   (let ((ps-n-up-printing n-up)
!       (ps-spool-config (and (eq ps-spool-config 'setpagedevice)
!                             'setpagedevice)))
!     (pr-delete-file-if-exists filename)
!     (cond (pr-faces-p
!          (cond (pr-spool-p
!                 ;; pr-faces-p and pr-spool-p
!                 ;; here FILENAME arg is ignored
!                 (cond ((eq kind 'buffer)
!                        (ps-spool-buffer-with-faces))
!                       ((eq kind 'region)
!                        (ps-spool-region-with-faces (or from (point))
!                                                    (or to (mark))))
!                       ))
                  ;; pr-faces-p and not pr-spool-p
!                ((eq kind 'buffer)
!                 (ps-print-buffer-with-faces filename))
!                ((eq kind 'region)
!                 (ps-print-region-with-faces (or from (point))
!                                             (or to (mark)) filename))
!                ))
!         (pr-spool-p
!          ;; not pr-faces-p and pr-spool-p
!          ;; here FILENAME arg is ignored
!          (cond ((eq kind 'buffer)
!                 (ps-spool-buffer))
!                ((eq kind 'region)
!                 (ps-spool-region (or from (point)) (or to (mark))))
!                ))
!         ;; not pr-faces-p and not pr-spool-p
!         ((eq kind 'buffer)
!          (ps-print-buffer filename))
!         ((eq kind 'region)
!          (ps-print-region (or from (point)) (or to (mark)) filename))
!         )))
  
  
  (defun pr-command (command)
--- 5556,5597 ----
  
  
  (defun pr-text2ps (kind n-up filename &optional from to)
!   (pr-save-file-modes
!    (let ((ps-n-up-printing n-up)
!        (ps-spool-config (and (eq ps-spool-config 'setpagedevice)
!                              'setpagedevice)))
!      (pr-delete-file-if-exists filename)
!      (cond (pr-faces-p
!           (cond (pr-spool-p
!                  ;; pr-faces-p and pr-spool-p
!                  ;; here FILENAME arg is ignored
!                  (cond ((eq kind 'buffer)
!                         (ps-spool-buffer-with-faces))
!                        ((eq kind 'region)
!                         (ps-spool-region-with-faces (or from (point))
!                                                     (or to (mark))))
!                        ))
                  ;; pr-faces-p and not pr-spool-p
!                 ((eq kind 'buffer)
!                  (ps-print-buffer-with-faces filename))
!                 ((eq kind 'region)
!                  (ps-print-region-with-faces (or from (point))
!                                              (or to (mark)) filename))
!                 ))
!          (pr-spool-p
!           ;; not pr-faces-p and pr-spool-p
!           ;; here FILENAME arg is ignored
!           (cond ((eq kind 'buffer)
!                  (ps-spool-buffer))
!                 ((eq kind 'region)
!                  (ps-spool-region (or from (point)) (or to (mark))))
!                 ))
!          ;; not pr-faces-p and not pr-spool-p
!          ((eq kind 'buffer)
!           (ps-print-buffer filename))
!          ((eq kind 'region)
!           (ps-print-region (or from (point)) (or to (mark)) filename))
!          ))))
  
  
  (defun pr-command (command)
***************
*** 6154,6172 ****
  (defun pr-interface-ps-print (&rest ignore)
    "Print using ps-print package."
    (interactive)
!   (pr-interface-ps 'pr-despool-ps-print 'pr-ps-directory-ps-print
!                  'pr-ps-file-ps-print 'pr-ps-file-up-ps-print
!                  'pr-ps-region-ps-print 'pr-ps-mode-ps-print
!                  'pr-ps-buffer-ps-print))
  
  
  (defun pr-interface-preview (&rest ignore)
    "Preview a PostScript file."
    (interactive)
!   (pr-interface-ps 'pr-despool-preview 'pr-ps-directory-preview
!                  'pr-ps-file-preview 'pr-ps-file-up-preview
!                  'pr-ps-region-preview 'pr-ps-mode-preview
!                  'pr-ps-buffer-preview))
  
  
  (defun pr-interface-ps (ps-despool ps-directory ps-file ps-file-up ps-region
--- 6131,6151 ----
  (defun pr-interface-ps-print (&rest ignore)
    "Print using ps-print package."
    (interactive)
!   (pr-save-interactive
!    (pr-interface-ps 'pr-despool-ps-print 'pr-ps-directory-ps-print
!                   'pr-ps-file-ps-print 'pr-ps-file-up-ps-print
!                   'pr-ps-region-ps-print 'pr-ps-mode-ps-print
!                   'pr-ps-buffer-ps-print)))
  
  
  (defun pr-interface-preview (&rest ignore)
    "Preview a PostScript file."
    (interactive)
!   (pr-save-interactive
!    (pr-interface-ps 'pr-despool-preview 'pr-ps-directory-preview
!                   'pr-ps-file-preview 'pr-ps-file-up-preview
!                   'pr-ps-region-preview 'pr-ps-mode-preview
!                   'pr-ps-buffer-preview)))
  
  
  (defun pr-interface-ps (ps-despool ps-directory ps-file ps-file-up ps-region




reply via email to

[Prev in Thread] Current Thread [Next in Thread]