diff options
| author | Vinicius Jose Latorre | 2004-11-18 00:11:32 +0000 |
|---|---|---|
| committer | Vinicius Jose Latorre | 2004-11-18 00:11:32 +0000 |
| commit | 9f7a99189edb8acfb1ca1f9df4004db740b466d4 (patch) | |
| tree | 0b40791e5ef2fd3debd33f1fdcabb6adcd21e033 | |
| parent | 6abf3a2767ac6f6639cbdca581cb09328451dc5c (diff) | |
| download | emacs-9f7a99189edb8acfb1ca1f9df4004db740b466d4.tar.gz emacs-9f7a99189edb8acfb1ca1f9df4004db740b466d4.zip | |
interactive-p & eval-and-compile
| -rw-r--r-- | lisp/ChangeLog | 40 | ||||
| -rw-r--r-- | lisp/printing.el | 1994 |
2 files changed, 1059 insertions, 975 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 14dc9454b26..ab6386f2e49 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,43 @@ | |||
| 1 | 2004-11-17 Vinicius Jose Latorre <viniciusjl@ig.com.br> | ||
| 2 | |||
| 3 | * printing.el: Eliminate use of interactive-p and eval-and-compile. | ||
| 4 | Use of (featurep 'xemacs) instead of (eq ps-print-emacs-type 'xemacs). | ||
| 5 | Use make-temp-file to generate PostScript files in any situation. | ||
| 6 | (pr-ps-temp-file): Now specify a prefix to generate temporary files. | ||
| 7 | (pr-interactive-p): Eliminated var. | ||
| 8 | (pr-save-interactive): Eliminated macro. | ||
| 9 | (pr-interface, pr-ps-directory-preview) | ||
| 10 | (pr-ps-directory-using-ghostscript, pr-ps-directory-print) | ||
| 11 | (pr-ps-directory-ps-print, pr-ps-buffer-preview) | ||
| 12 | (pr-ps-buffer-using-ghostscript, pr-ps-buffer-print) | ||
| 13 | (pr-ps-buffer-ps-print, pr-ps-region-preview) | ||
| 14 | (pr-ps-region-using-ghostscript, pr-ps-region-print) | ||
| 15 | (pr-ps-region-ps-print, pr-ps-mode-preview) | ||
| 16 | (pr-ps-mode-using-ghostscript, pr-ps-mode-print, pr-ps-mode-ps-print) | ||
| 17 | (pr-printify-directory, pr-txt-directory, pr-despool-preview) | ||
| 18 | (pr-despool-using-ghostscript, pr-despool-print, pr-despool-ps-print) | ||
| 19 | (pr-ps-file-up-preview, pr-ps-file-using-ghostscript) | ||
| 20 | (pr-ps-file-up-ps-print, pr-toggle-file-duplex, pr-toggle-file-tumble) | ||
| 21 | (pr-toggle-file-landscape, pr-toggle-ghostscript, pr-toggle-faces) | ||
| 22 | (pr-toggle-spool, pr-toggle-duplex, pr-toggle-tumble) | ||
| 23 | (pr-toggle-landscape, pr-toggle-upside-down, pr-toggle-line) | ||
| 24 | (pr-toggle-zebra, pr-toggle-header, pr-toggle-header-frame) | ||
| 25 | (pr-toggle-lock, pr-toggle-region, pr-toggle-mode, pr-ps-name) | ||
| 26 | (pr-txt-name, pr-ps-utility, pr-ps-fast-fire, pr-txt-fast-fire) | ||
| 27 | (pr-update-menus, pr-interface-ps-prin, pr-interface-preview): | ||
| 28 | Eliminate pr-save-interactive usage. | ||
| 29 | (pr-menu-lock, pr-ps-utility-args, pr-set-outfilename): Eliminate | ||
| 30 | pr-interactive-p usage. | ||
| 31 | (pr-toggle-file-duplex-menu, pr-toggle-file-tumble-menu) | ||
| 32 | (pr-toggle-file-landscape-menu, pr-toggle-ghostscript-menu) | ||
| 33 | (pr-toggle-faces-menu, pr-toggle-spool-menu, pr-toggle-duplex-menu) | ||
| 34 | (pr-toggle-tumble-menu, pr-toggle-landscape-menu) | ||
| 35 | (pr-toggle-upside-down-menu, pr-toggle-line-menu, pr-toggle-zebra-menu) | ||
| 36 | (pr-toggle-header-menu, pr-toggle-header-frame-menu) | ||
| 37 | (pr-toggle-lock-menu, pr-toggle-region-menu, pr-toggle-mode-menu): New | ||
| 38 | funs. | ||
| 39 | (pr-ps-file): Use make-temp-file to generate a temporary file. | ||
| 40 | |||
| 1 | 2004-11-17 Jay Belanger <belanger@truman.edu> | 41 | 2004-11-17 Jay Belanger <belanger@truman.edu> |
| 2 | 42 | ||
| 3 | * calc/calc-alg.el (calc-poly-div): Make calc-poly-div-remainder | 43 | * calc/calc-alg.el (calc-poly-div): Make calc-poly-div-remainder |
diff --git a/lisp/printing.el b/lisp/printing.el index f988120d037..639ecbbbdf2 100644 --- a/lisp/printing.el +++ b/lisp/printing.el | |||
| @@ -5,13 +5,13 @@ | |||
| 5 | 5 | ||
| 6 | ;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br> | 6 | ;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br> |
| 7 | ;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br> | 7 | ;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br> |
| 8 | ;; Time-stamp: <2004/11/15 17:23:32 vinicius> | 8 | ;; Time-stamp: <2004/11/17 19:27:57 vinicius> |
| 9 | ;; Keywords: wp, print, PostScript | 9 | ;; Keywords: wp, print, PostScript |
| 10 | ;; Version: 6.8.3 | 10 | ;; Version: 6.8.3 |
| 11 | ;; X-URL: http://www.cpqd.com.br/~vinicius/emacs/ | 11 | ;; X-URL: http://www.cpqd.com.br/~vinicius/emacs/ |
| 12 | 12 | ||
| 13 | (defconst pr-version "6.8.3" | 13 | (defconst pr-version "6.8.3" |
| 14 | "printing.el, v 6.8.3 <2004/11/14 vinicius> | 14 | "printing.el, v 6.8.3 <2004/11/17 vinicius> |
| 15 | 15 | ||
| 16 | Please send all bug fixes and enhancements to | 16 | Please send all bug fixes and enhancements to |
| 17 | Vinicius Jose Latorre <viniciusjl@ig.com.br> | 17 | Vinicius Jose Latorre <viniciusjl@ig.com.br> |
| @@ -488,7 +488,7 @@ Please send all bug fixes and enhancements to | |||
| 488 | ;; `pr-temp-dir' Specify a directory for temporary files during | 488 | ;; `pr-temp-dir' Specify a directory for temporary files during |
| 489 | ;; printing. | 489 | ;; printing. |
| 490 | ;; | 490 | ;; |
| 491 | ;; `pr-ps-temp-file' Specify PostScript temporary file name. | 491 | ;; `pr-ps-temp-file' Specify PostScript temporary file name prefix. |
| 492 | ;; | 492 | ;; |
| 493 | ;; `pr-file-modes' Specify the file permission bits for newly | 493 | ;; `pr-file-modes' Specify the file permission bits for newly |
| 494 | ;; created files. | 494 | ;; created files. |
| @@ -1003,69 +1003,112 @@ Please send all bug fixes and enhancements to | |||
| 1003 | (error "`printing' requires `ps-print' package version 6.6.4 or later")) | 1003 | (error "`printing' requires `ps-print' package version 6.6.4 or later")) |
| 1004 | 1004 | ||
| 1005 | 1005 | ||
| 1006 | (eval-and-compile | 1006 | (defconst pr-cygwin-system |
| 1007 | (defconst pr-cygwin-system | 1007 | (and ps-windows-system (getenv "OSTYPE") |
| 1008 | (and ps-windows-system (getenv "OSTYPE") | 1008 | (string-match "cygwin" (getenv "OSTYPE")))) |
| 1009 | (string-match "cygwin" (getenv "OSTYPE"))))) | ||
| 1010 | 1009 | ||
| 1011 | 1010 | ||
| 1012 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 1011 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 1013 | ;; To avoid compilation gripes | 1012 | ;; To avoid compilation gripes |
| 1014 | 1013 | ||
| 1015 | 1014 | ||
| 1016 | (eval-and-compile | 1015 | (or (fboundp 'easy-menu-intern) ; hacked from easymenu.el |
| 1016 | (defsubst easy-menu-intern (s) | ||
| 1017 | (if (stringp s) (intern s) s))) | ||
| 1017 | 1018 | ||
| 1018 | (or (fboundp 'subst-char-in-string) | 1019 | |
| 1019 | (defun subst-char-in-string (fromchar tochar string &optional inplace) | 1020 | |
| 1020 | "Replace FROMCHAR with TOCHAR in STRING each time it occurs. | 1021 | (or (fboundp 'subst-char-in-string) ; hacked from subr.el |
| 1022 | (defun subst-char-in-string (fromchar tochar string &optional inplace) | ||
| 1023 | "Replace FROMCHAR with TOCHAR in STRING each time it occurs. | ||
| 1021 | Unless optional argument INPLACE is non-nil, return a new string." | 1024 | Unless optional argument INPLACE is non-nil, return a new string." |
| 1022 | (let ((i (length string)) | 1025 | (let ((i (length string)) |
| 1023 | (newstr (if inplace string (copy-sequence string)))) | 1026 | (newstr (if inplace string (copy-sequence string)))) |
| 1024 | (while (> (setq i (1- i)) 0) | 1027 | (while (> (setq i (1- i)) 0) |
| 1025 | (if (eq (aref newstr i) fromchar) | 1028 | (if (eq (aref newstr i) fromchar) |
| 1026 | (aset newstr i tochar))) | 1029 | (aset newstr i tochar))) |
| 1027 | newstr))) | 1030 | newstr))) |
| 1031 | |||
| 1032 | |||
| 1033 | (or (fboundp 'make-temp-file) ; hacked from subr.el | ||
| 1034 | (defun make-temp-file (prefix &optional dir-flag suffix) | ||
| 1035 | "Create a temporary file. | ||
| 1036 | The returned file name (created by appending some random characters at the end | ||
| 1037 | of PREFIX, and expanding against `temporary-file-directory' if necessary), | ||
| 1038 | is guaranteed to point to a newly created empty file. | ||
| 1039 | You can then use `write-region' to write new data into the file. | ||
| 1040 | |||
| 1041 | If DIR-FLAG is non-nil, create a new empty directory instead of a file. | ||
| 1042 | |||
| 1043 | If SUFFIX is non-nil, add that at the end of the file name." | ||
| 1044 | (let ((umask (default-file-modes)) | ||
| 1045 | file) | ||
| 1046 | (unwind-protect | ||
| 1047 | (progn | ||
| 1048 | ;; Create temp files with strict access rights. It's easy to | ||
| 1049 | ;; loosen them later, whereas it's impossible to close the | ||
| 1050 | ;; time-window of loose permissions otherwise. | ||
| 1051 | (set-default-file-modes ?\700) | ||
| 1052 | (while (condition-case () | ||
| 1053 | (progn | ||
| 1054 | (setq file | ||
| 1055 | (make-temp-name | ||
| 1056 | (expand-file-name prefix temporary-file-directory))) | ||
| 1057 | (if suffix | ||
| 1058 | (setq file (concat file suffix))) | ||
| 1059 | (if dir-flag | ||
| 1060 | (make-directory file) | ||
| 1061 | (write-region "" nil file nil 'silent nil 'excl)) | ||
| 1062 | nil) | ||
| 1063 | (file-already-exists t)) | ||
| 1064 | ;; the file was somehow created by someone else between | ||
| 1065 | ;; `make-temp-name' and `write-region', let's try again. | ||
| 1066 | nil) | ||
| 1067 | file) | ||
| 1068 | ;; Reset the umask. | ||
| 1069 | (set-default-file-modes umask))))) | ||
| 1028 | 1070 | ||
| 1029 | ;; GNU Emacs | ||
| 1030 | (defalias 'pr-e-frame-char-height 'frame-char-height) | ||
| 1031 | (defalias 'pr-e-frame-char-width 'frame-char-width) | ||
| 1032 | (defalias 'pr-e-mouse-pixel-position 'mouse-pixel-position) | ||
| 1033 | ;; XEmacs | ||
| 1034 | (defalias 'pr-x-add-submenu 'add-submenu) | ||
| 1035 | (defalias 'pr-x-event-function 'event-function) | ||
| 1036 | (defalias 'pr-x-event-object 'event-object) | ||
| 1037 | (defalias 'pr-x-find-menu-item 'find-menu-item) | ||
| 1038 | (defalias 'pr-x-font-height 'font-height) | ||
| 1039 | (defalias 'pr-x-font-width 'font-width) | ||
| 1040 | (defalias 'pr-x-get-popup-menu-response 'get-popup-menu-response) | ||
| 1041 | (defalias 'pr-x-make-event 'make-event) | ||
| 1042 | (defalias 'pr-x-misc-user-event-p 'misc-user-event-p) | ||
| 1043 | (defalias 'pr-x-relabel-menu-item 'relabel-menu-item) | ||
| 1044 | (defalias 'pr-x-event-x-pixel 'event-x-pixel) | ||
| 1045 | (defalias 'pr-x-event-y-pixel 'event-y-pixel) | ||
| 1046 | 1071 | ||
| 1047 | (cond | 1072 | ;; GNU Emacs |
| 1048 | ((eq ps-print-emacs-type 'emacs) ; GNU Emacs | 1073 | (defalias 'pr-e-frame-char-height 'frame-char-height) |
| 1049 | (defvar deactivate-mark nil) | 1074 | (defalias 'pr-e-frame-char-width 'frame-char-width) |
| 1050 | (defalias 'pr-f-set-keymap-parents 'set-keymap-parent) | 1075 | (defalias 'pr-e-mouse-pixel-position 'mouse-pixel-position) |
| 1051 | (defalias 'pr-f-set-keymap-name 'ignore) | 1076 | ;; XEmacs |
| 1052 | (defalias 'pr-f-read-string 'read-string) | 1077 | (defalias 'pr-x-add-submenu 'add-submenu) |
| 1053 | (defun pr-keep-region-active () | 1078 | (defalias 'pr-x-event-function 'event-function) |
| 1054 | (setq deactivate-mark nil))) | 1079 | (defalias 'pr-x-event-object 'event-object) |
| 1055 | 1080 | (defalias 'pr-x-find-menu-item 'find-menu-item) | |
| 1056 | ((eq ps-print-emacs-type 'xemacs) ; XEmacs | 1081 | (defalias 'pr-x-font-height 'font-height) |
| 1057 | (defvar current-menubar nil) | 1082 | (defalias 'pr-x-font-width 'font-width) |
| 1058 | (defvar current-mouse-event nil) | 1083 | (defalias 'pr-x-get-popup-menu-response 'get-popup-menu-response) |
| 1059 | (defvar zmacs-region-stays nil) | 1084 | (defalias 'pr-x-make-event 'make-event) |
| 1060 | (defalias 'pr-f-set-keymap-parents 'set-keymap-parents) | 1085 | (defalias 'pr-x-misc-user-event-p 'misc-user-event-p) |
| 1061 | (defalias 'pr-f-set-keymap-name 'set-keymap-name) | 1086 | (defalias 'pr-x-relabel-menu-item 'relabel-menu-item) |
| 1062 | (defun pr-f-read-string (prompt initial history default) | 1087 | (defalias 'pr-x-event-x-pixel 'event-x-pixel) |
| 1063 | (let ((str (read-string prompt initial))) | 1088 | (defalias 'pr-x-event-y-pixel 'event-y-pixel) |
| 1064 | (if (and str (not (string= str ""))) | 1089 | |
| 1065 | str | 1090 | (cond |
| 1066 | default))) | 1091 | ((featurep 'xemacs) ; XEmacs |
| 1067 | (defun pr-keep-region-active () | 1092 | (defvar current-menubar nil) |
| 1068 | (setq zmacs-region-stays t))))) | 1093 | (defvar current-mouse-event nil) |
| 1094 | (defvar zmacs-region-stays nil) | ||
| 1095 | (defalias 'pr-f-set-keymap-parents 'set-keymap-parents) | ||
| 1096 | (defalias 'pr-f-set-keymap-name 'set-keymap-name) | ||
| 1097 | (defun pr-f-read-string (prompt initial history default) | ||
| 1098 | (let ((str (read-string prompt initial))) | ||
| 1099 | (if (and str (not (string= str ""))) | ||
| 1100 | str | ||
| 1101 | default))) | ||
| 1102 | (defun pr-keep-region-active () | ||
| 1103 | (setq zmacs-region-stays t))) | ||
| 1104 | |||
| 1105 | (t ; GNU Emacs | ||
| 1106 | (defvar deactivate-mark nil) | ||
| 1107 | (defalias 'pr-f-set-keymap-parents 'set-keymap-parent) | ||
| 1108 | (defalias 'pr-f-set-keymap-name 'ignore) | ||
| 1109 | (defalias 'pr-f-read-string 'read-string) | ||
| 1110 | (defun pr-keep-region-active () | ||
| 1111 | (setq deactivate-mark nil)))) | ||
| 1069 | 1112 | ||
| 1070 | 1113 | ||
| 1071 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 1114 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| @@ -1602,12 +1645,12 @@ See also `pr-ps-temp-file' and `pr-file-modes'." | |||
| 1602 | :group 'printing) | 1645 | :group 'printing) |
| 1603 | 1646 | ||
| 1604 | 1647 | ||
| 1605 | (defcustom pr-ps-temp-file "prspool.ps" | 1648 | (defcustom pr-ps-temp-file "prspool-" |
| 1606 | "*Specify PostScript temporary file name. | 1649 | "*Specify PostScript temporary file name prefix. |
| 1607 | 1650 | ||
| 1608 | See also `pr-temp-dir' and `pr-file-modes'." | 1651 | See also `pr-temp-dir' and `pr-file-modes'." |
| 1609 | :type '(file :tag "PostScript Temporary File Name") | 1652 | :type '(file :tag "PostScript Temporary File Name") |
| 1610 | :version "20" | 1653 | :version "21" |
| 1611 | :group 'printing) | 1654 | :group 'printing) |
| 1612 | 1655 | ||
| 1613 | 1656 | ||
| @@ -2203,10 +2246,10 @@ See also `pr-menu-char-height' and `pr-menu-char-width'." | |||
| 2203 | 2246 | ||
| 2204 | 2247 | ||
| 2205 | (defcustom pr-menu-char-height | 2248 | (defcustom pr-menu-char-height |
| 2206 | (cond ((eq ps-print-emacs-type 'emacs) ; GNU Emacs | 2249 | (cond ((featurep 'xemacs) ; XEmacs |
| 2207 | (pr-e-frame-char-height)) | 2250 | (pr-x-font-height (face-font 'default))) |
| 2208 | ((eq ps-print-emacs-type 'xemacs) ; XEmacs | 2251 | (t ; GNU Emacs |
| 2209 | (pr-x-font-height (face-font 'default)))) | 2252 | (pr-e-frame-char-height))) |
| 2210 | "*Specify menu char height in pixels. | 2253 | "*Specify menu char height in pixels. |
| 2211 | 2254 | ||
| 2212 | This variable is used to guess which vertical position should be locked the | 2255 | This variable is used to guess which vertical position should be locked the |
| @@ -2219,10 +2262,10 @@ See also `pr-menu-lock' and `pr-menu-char-width'." | |||
| 2219 | 2262 | ||
| 2220 | 2263 | ||
| 2221 | (defcustom pr-menu-char-width | 2264 | (defcustom pr-menu-char-width |
| 2222 | (cond ((eq ps-print-emacs-type 'emacs) ; GNU Emacs | 2265 | (cond ((featurep 'xemacs) ; XEmacs |
| 2223 | (pr-e-frame-char-width)) | 2266 | (pr-x-font-width (face-font 'default))) |
| 2224 | ((eq ps-print-emacs-type 'xemacs) ; XEmacs | 2267 | (t ; GNU Emacs |
| 2225 | (pr-x-font-width (face-font 'default)))) | 2268 | (pr-e-frame-char-width))) |
| 2226 | "*Specify menu char width in pixels. | 2269 | "*Specify menu char width in pixels. |
| 2227 | 2270 | ||
| 2228 | This variable is used to guess which horizontal position should be locked the | 2271 | This variable is used to guess which horizontal position should be locked the |
| @@ -2510,20 +2553,6 @@ See `pr-ps-printer-alist'.") | |||
| 2510 | ;; Macros | 2553 | ;; Macros |
| 2511 | 2554 | ||
| 2512 | 2555 | ||
| 2513 | (defvar pr-interactive-p nil | ||
| 2514 | "Save the `interactive-p' result value. | ||
| 2515 | |||
| 2516 | It's used by `pr-save-interactive' (which see).") | ||
| 2517 | |||
| 2518 | |||
| 2519 | (defmacro pr-save-interactive (&rest body) | ||
| 2520 | "Save the `interactive-p' result value using `let'. | ||
| 2521 | |||
| 2522 | It uses `pr-interactive-p' var (which see)." | ||
| 2523 | `(let ((pr-interactive-p (or pr-interactive-p (interactive-p)))) | ||
| 2524 | ,@body)) | ||
| 2525 | |||
| 2526 | |||
| 2527 | (defmacro pr-save-file-modes (&rest body) | 2556 | (defmacro pr-save-file-modes (&rest body) |
| 2528 | "Set temporally file modes to `pr-file-modes'." | 2557 | "Set temporally file modes to `pr-file-modes'." |
| 2529 | `(let ((pr--default-file-modes (default-file-modes))) ; save default | 2558 | `(let ((pr--default-file-modes (default-file-modes))) ; save default |
| @@ -2561,315 +2590,313 @@ It uses `pr-interactive-p' var (which see)." | |||
| 2561 | (and pr-print-using-ghostscript (not pr-spool-p))) | 2590 | (and pr-print-using-ghostscript (not pr-spool-p))) |
| 2562 | 2591 | ||
| 2563 | 2592 | ||
| 2564 | (eval-and-compile | 2593 | (defun pr-get-symbol (name) |
| 2565 | (defun pr-get-symbol (name) | 2594 | (easy-menu-intern name)) |
| 2566 | (easy-menu-intern name)) | 2595 | |
| 2567 | 2596 | (cond | |
| 2568 | (cond | 2597 | ((featurep 'xemacs) ; XEmacs |
| 2569 | ((eq ps-print-emacs-type 'emacs) ; GNU Emacs | 2598 | (defvar zmacs-region-stays nil) ; to avoid compilation gripes |
| 2570 | (defun pr-region-active-p () | 2599 | (defun pr-region-active-p () |
| 2571 | (and pr-auto-region transient-mark-mode mark-active))) | 2600 | (and pr-auto-region (not zmacs-region-stays) (ps-mark-active-p)))) |
| 2572 | 2601 | ||
| 2573 | ((eq ps-print-emacs-type 'xemacs) ; XEmacs | 2602 | (t ; GNU Emacs |
| 2574 | (defvar zmacs-region-stays nil) ; to avoid compilation gripes | 2603 | (defun pr-region-active-p () |
| 2575 | (defun pr-region-active-p () | 2604 | (and pr-auto-region transient-mark-mode mark-active)))) |
| 2576 | (and pr-auto-region (not zmacs-region-stays) (ps-mark-active-p))))) | 2605 | |
| 2577 | 2606 | ||
| 2578 | 2607 | (defconst pr-menu-spec | |
| 2579 | (defconst pr-menu-spec | 2608 | ;; Menu mapping: |
| 2580 | ;; Menu mapping: | 2609 | ;; unfortunately XEmacs doesn't support :active for submenus, |
| 2581 | ;; unfortunately XEmacs doesn't support :active for submenus, | 2610 | ;; only for items. |
| 2582 | ;; only for items. | 2611 | ;; So, it uses :included instead of :active. |
| 2583 | ;; So, it uses :included instead of :active. | 2612 | ;; Also, XEmacs doesn't support :help tag. |
| 2584 | ;; Also, XEmacs doesn't support :help tag. | 2613 | (let ((pr-:active (if (featurep 'xemacs) |
| 2585 | (let ((pr-:active (if (eq ps-print-emacs-type 'emacs) | 2614 | :included ; XEmacs |
| 2586 | :active ; GNU Emacs | 2615 | :active)) ; GNU Emacs |
| 2587 | :included)) ; XEmacs | 2616 | (pr-:help (if (featurep 'xemacs) |
| 2588 | (pr-:help (if (eq ps-print-emacs-type 'emacs) | 2617 | 'ignore ; XEmacs |
| 2589 | #'(lambda (text) (list :help text)) ; GNU Emacs | 2618 | #'(lambda (text) (list :help text))))) ; GNU Emacs |
| 2590 | 'ignore))) ; XEmacs | 2619 | `( |
| 2591 | `( | 2620 | ["Printing Interface" pr-interface |
| 2592 | ["Printing Interface" pr-interface | 2621 | ,@(funcall |
| 2622 | pr-:help "Use buffer interface instead of menu interface")] | ||
| 2623 | "--" | ||
| 2624 | ("PostScript Preview" :included (pr-visible-p 'postscript) | ||
| 2625 | ,@(funcall | ||
| 2626 | pr-:help "Preview PostScript instead of sending to printer") | ||
| 2627 | ("Directory" ,pr-:active (not pr-spool-p) | ||
| 2628 | ["1-up" (pr-ps-directory-preview 1 nil nil t) t] | ||
| 2629 | ["2-up" (pr-ps-directory-preview 2 nil nil t) t] | ||
| 2630 | ["4-up" (pr-ps-directory-preview 4 nil nil t) t] | ||
| 2631 | ["Other..." (pr-ps-directory-preview nil nil nil t) | ||
| 2632 | :keys "\\[pr-ps-buffer-preview]"]) | ||
| 2633 | ("Buffer" ,pr-:active (not pr-spool-p) | ||
| 2634 | ["1-up" (pr-ps-buffer-preview 1 t) t] | ||
| 2635 | ["2-up" (pr-ps-buffer-preview 2 t) t] | ||
| 2636 | ["4-up" (pr-ps-buffer-preview 4 t) t] | ||
| 2637 | ["Other..." (pr-ps-buffer-preview nil t) | ||
| 2638 | :keys "\\[pr-ps-buffer-preview]"]) | ||
| 2639 | ("Region" ,pr-:active (and (not pr-spool-p) (ps-mark-active-p)) | ||
| 2640 | ["1-up" (pr-ps-region-preview 1 t) t] | ||
| 2641 | ["2-up" (pr-ps-region-preview 2 t) t] | ||
| 2642 | ["4-up" (pr-ps-region-preview 4 t) t] | ||
| 2643 | ["Other..." (pr-ps-region-preview nil t) | ||
| 2644 | :keys "\\[pr-ps-region-preview]"]) | ||
| 2645 | ("Mode" ,pr-:active (and (not pr-spool-p) (pr-mode-alist-p)) | ||
| 2646 | ["1-up" (pr-ps-mode-preview 1 t) t] | ||
| 2647 | ["2-up" (pr-ps-mode-preview 2 t) t] | ||
| 2648 | ["4-up" (pr-ps-mode-preview 4 t) t] | ||
| 2649 | ["Other..." (pr-ps-mode-preview nil t) | ||
| 2650 | :keys "\\[pr-ps-mode-preview]"]) | ||
| 2651 | ("File" | ||
| 2652 | ["No Preprocessing..." (call-interactively 'pr-ps-file-preview) | ||
| 2653 | :keys "\\[pr-ps-file-preview]" | ||
| 2593 | ,@(funcall | 2654 | ,@(funcall |
| 2594 | pr-:help "Use buffer interface instead of menu interface")] | 2655 | pr-:help "Preview PostScript file")] |
| 2595 | "--" | 2656 | "--" |
| 2596 | ("PostScript Preview" :included (pr-visible-p 'postscript) | 2657 | ["PostScript Utility" pr-update-menus :active pr-ps-utility-alist |
| 2597 | ,@(funcall | 2658 | ,@(funcall |
| 2598 | pr-:help "Preview PostScript instead of sending to printer") | 2659 | pr-:help "Select PostScript utility")] |
| 2599 | ("Directory" ,pr-:active (not pr-spool-p) | 2660 | "--" |
| 2600 | ["1-up" (pr-ps-directory-preview 1 nil nil t) t] | 2661 | ["1-up..." (pr-ps-file-up-preview 1 t t) pr-ps-utility-alist] |
| 2601 | ["2-up" (pr-ps-directory-preview 2 nil nil t) t] | 2662 | ["2-up..." (pr-ps-file-up-preview 2 t t) pr-ps-utility-alist] |
| 2602 | ["4-up" (pr-ps-directory-preview 4 nil nil t) t] | 2663 | ["4-up..." (pr-ps-file-up-preview 4 t t) pr-ps-utility-alist] |
| 2603 | ["Other..." (pr-ps-directory-preview nil nil nil t) | 2664 | ["Other..." (pr-ps-file-up-preview nil t t) |
| 2604 | :keys "\\[pr-ps-buffer-preview]"]) | 2665 | :keys "\\[pr-ps-file-up-preview]" :active pr-ps-utility-alist] |
| 2605 | ("Buffer" ,pr-:active (not pr-spool-p) | ||
| 2606 | ["1-up" (pr-ps-buffer-preview 1 t) t] | ||
| 2607 | ["2-up" (pr-ps-buffer-preview 2 t) t] | ||
| 2608 | ["4-up" (pr-ps-buffer-preview 4 t) t] | ||
| 2609 | ["Other..." (pr-ps-buffer-preview nil t) | ||
| 2610 | :keys "\\[pr-ps-buffer-preview]"]) | ||
| 2611 | ("Region" ,pr-:active (and (not pr-spool-p) (ps-mark-active-p)) | ||
| 2612 | ["1-up" (pr-ps-region-preview 1 t) t] | ||
| 2613 | ["2-up" (pr-ps-region-preview 2 t) t] | ||
| 2614 | ["4-up" (pr-ps-region-preview 4 t) t] | ||
| 2615 | ["Other..." (pr-ps-region-preview nil t) | ||
| 2616 | :keys "\\[pr-ps-region-preview]"]) | ||
| 2617 | ("Mode" ,pr-:active (and (not pr-spool-p) (pr-mode-alist-p)) | ||
| 2618 | ["1-up" (pr-ps-mode-preview 1 t) t] | ||
| 2619 | ["2-up" (pr-ps-mode-preview 2 t) t] | ||
| 2620 | ["4-up" (pr-ps-mode-preview 4 t) t] | ||
| 2621 | ["Other..." (pr-ps-mode-preview nil t) | ||
| 2622 | :keys "\\[pr-ps-mode-preview]"]) | ||
| 2623 | ("File" | ||
| 2624 | ["No Preprocessing..." (call-interactively 'pr-ps-file-preview) | ||
| 2625 | :keys "\\[pr-ps-file-preview]" | ||
| 2626 | ,@(funcall | ||
| 2627 | pr-:help "Preview PostScript file")] | ||
| 2628 | "--" | ||
| 2629 | ["PostScript Utility" pr-update-menus :active pr-ps-utility-alist | ||
| 2630 | ,@(funcall | ||
| 2631 | pr-:help "Select PostScript utility")] | ||
| 2632 | "--" | ||
| 2633 | ["1-up..." (pr-ps-file-up-preview 1 t t) pr-ps-utility-alist] | ||
| 2634 | ["2-up..." (pr-ps-file-up-preview 2 t t) pr-ps-utility-alist] | ||
| 2635 | ["4-up..." (pr-ps-file-up-preview 4 t t) pr-ps-utility-alist] | ||
| 2636 | ["Other..." (pr-ps-file-up-preview nil t t) | ||
| 2637 | :keys "\\[pr-ps-file-up-preview]" :active pr-ps-utility-alist] | ||
| 2638 | "--" | ||
| 2639 | ["Landscape" pr-toggle-file-landscape | ||
| 2640 | :style toggle :selected pr-file-landscape | ||
| 2641 | ,@(funcall | ||
| 2642 | pr-:help "Toggle landscape for PostScript file") | ||
| 2643 | :active pr-ps-utility-alist] | ||
| 2644 | ["Duplex" pr-toggle-file-duplex | ||
| 2645 | :style toggle :selected pr-file-duplex | ||
| 2646 | ,@(funcall | ||
| 2647 | pr-:help "Toggle duplex for PostScript file") | ||
| 2648 | :active pr-ps-utility-alist] | ||
| 2649 | ["Tumble" pr-toggle-file-tumble | ||
| 2650 | :style toggle :selected pr-file-tumble | ||
| 2651 | ,@(funcall | ||
| 2652 | pr-:help "Toggle tumble for PostScript file") | ||
| 2653 | :active (and pr-file-duplex pr-ps-utility-alist)]) | ||
| 2654 | ["Despool..." (call-interactively 'pr-despool-preview) | ||
| 2655 | :active pr-spool-p :keys "\\[pr-despool-preview]" | ||
| 2656 | ,@(funcall | ||
| 2657 | pr-:help "Despool PostScript buffer to printer or file (C-u)")]) | ||
| 2658 | ("PostScript Print" :included (pr-visible-p 'postscript) | ||
| 2659 | ,@(funcall | ||
| 2660 | pr-:help "Send PostScript to printer or file (C-u)") | ||
| 2661 | ("Directory" | ||
| 2662 | ["1-up" (pr-ps-directory-ps-print 1 nil nil t) t] | ||
| 2663 | ["2-up" (pr-ps-directory-ps-print 2 nil nil t) t] | ||
| 2664 | ["4-up" (pr-ps-directory-ps-print 4 nil nil t) t] | ||
| 2665 | ["Other..." (pr-ps-directory-ps-print nil nil nil t) | ||
| 2666 | :keys "\\[pr-ps-buffer-ps-print]"]) | ||
| 2667 | ("Buffer" | ||
| 2668 | ["1-up" (pr-ps-buffer-ps-print 1 t) t] | ||
| 2669 | ["2-up" (pr-ps-buffer-ps-print 2 t) t] | ||
| 2670 | ["4-up" (pr-ps-buffer-ps-print 4 t) t] | ||
| 2671 | ["Other..." (pr-ps-buffer-ps-print nil t) | ||
| 2672 | :keys "\\[pr-ps-buffer-ps-print]"]) | ||
| 2673 | ("Region" ,pr-:active (ps-mark-active-p) | ||
| 2674 | ["1-up" (pr-ps-region-ps-print 1 t) t] | ||
| 2675 | ["2-up" (pr-ps-region-ps-print 2 t) t] | ||
| 2676 | ["4-up" (pr-ps-region-ps-print 4 t) t] | ||
| 2677 | ["Other..." (pr-ps-region-ps-print nil t) | ||
| 2678 | :keys "\\[pr-ps-region-ps-print]"]) | ||
| 2679 | ("Mode" ,pr-:active (pr-mode-alist-p) | ||
| 2680 | ["1-up" (pr-ps-mode-ps-print 1 t) t] | ||
| 2681 | ["2-up" (pr-ps-mode-ps-print 2 t) t] | ||
| 2682 | ["4-up" (pr-ps-mode-ps-print 4 t) t] | ||
| 2683 | ["Other..." (pr-ps-mode-ps-print nil t) | ||
| 2684 | :keys "\\[pr-ps-mode-ps-print]"]) | ||
| 2685 | ("File" | ||
| 2686 | ["No Preprocessing..." (call-interactively 'pr-ps-file-ps-print) | ||
| 2687 | :keys "\\[pr-ps-file-ps-print]" | ||
| 2688 | ,@(funcall | ||
| 2689 | pr-:help "Send PostScript file to printer")] | ||
| 2690 | "--" | ||
| 2691 | ["PostScript Utility" pr-update-menus :active pr-ps-utility-alist | ||
| 2692 | ,@(funcall | ||
| 2693 | pr-:help "Select PostScript utility")] | ||
| 2694 | "--" | ||
| 2695 | ["1-up..." (pr-ps-file-up-ps-print 1 t t) pr-ps-utility-alist] | ||
| 2696 | ["2-up..." (pr-ps-file-up-ps-print 2 t t) pr-ps-utility-alist] | ||
| 2697 | ["4-up..." (pr-ps-file-up-ps-print 4 t t) pr-ps-utility-alist] | ||
| 2698 | ["Other..." (pr-ps-file-up-ps-print nil t t) | ||
| 2699 | :keys "\\[pr-ps-file-up-ps-print]" :active pr-ps-utility-alist] | ||
| 2700 | "--" | ||
| 2701 | ["Landscape" pr-toggle-file-landscape | ||
| 2702 | :style toggle :selected pr-file-landscape | ||
| 2703 | ,@(funcall | ||
| 2704 | pr-:help "Toggle landscape for PostScript file") | ||
| 2705 | :active pr-ps-utility-alist] | ||
| 2706 | ["Duplex" pr-toggle-file-duplex | ||
| 2707 | :style toggle :selected pr-file-duplex | ||
| 2708 | ,@(funcall | ||
| 2709 | pr-:help "Toggle duplex for PostScript file") | ||
| 2710 | :active pr-ps-utility-alist] | ||
| 2711 | ["Tumble" pr-toggle-file-tumble | ||
| 2712 | :style toggle :selected pr-file-tumble | ||
| 2713 | ,@(funcall | ||
| 2714 | pr-:help "Toggle tumble for PostScript file") | ||
| 2715 | :active (and pr-file-duplex pr-ps-utility-alist)]) | ||
| 2716 | ["Despool..." (call-interactively 'pr-despool-ps-print) | ||
| 2717 | :active pr-spool-p :keys "\\[pr-despool-ps-print]" | ||
| 2718 | ,@(funcall | ||
| 2719 | pr-:help "Despool PostScript buffer to printer or file (C-u)")]) | ||
| 2720 | ["PostScript Printers" pr-update-menus | ||
| 2721 | :active pr-ps-printer-alist :included (pr-visible-p 'postscript) | ||
| 2722 | ,@(funcall | ||
| 2723 | pr-:help "Select PostScript printer")] | ||
| 2724 | "--" | 2666 | "--" |
| 2725 | ("Printify" :included (pr-visible-p 'text) | 2667 | ["Landscape" pr-toggle-file-landscape-menu |
| 2668 | :style toggle :selected pr-file-landscape | ||
| 2726 | ,@(funcall | 2669 | ,@(funcall |
| 2727 | pr-:help | 2670 | pr-:help "Toggle landscape for PostScript file") |
| 2728 | "Replace non-printing chars with printable representations.") | 2671 | :active pr-ps-utility-alist] |
| 2729 | ["Directory" pr-printify-directory t] | 2672 | ["Duplex" pr-toggle-file-duplex-menu |
| 2730 | ["Buffer" pr-printify-buffer t] | 2673 | :style toggle :selected pr-file-duplex |
| 2731 | ["Region" pr-printify-region (ps-mark-active-p)]) | ||
| 2732 | ("Print" :included (pr-visible-p 'text) | ||
| 2733 | ,@(funcall | 2674 | ,@(funcall |
| 2734 | pr-:help "Send text to printer") | 2675 | pr-:help "Toggle duplex for PostScript file") |
| 2735 | ["Directory" pr-txt-directory t] | 2676 | :active pr-ps-utility-alist] |
| 2736 | ["Buffer" pr-txt-buffer t] | 2677 | ["Tumble" pr-toggle-file-tumble-menu |
| 2737 | ["Region" pr-txt-region (ps-mark-active-p)] | 2678 | :style toggle :selected pr-file-tumble |
| 2738 | ["Mode" pr-txt-mode (pr-mode-alist-p)]) | ||
| 2739 | ["Text Printers" pr-update-menus | ||
| 2740 | :active pr-txt-printer-alist :included (pr-visible-p 'text) | ||
| 2741 | ,@(funcall | 2679 | ,@(funcall |
| 2742 | pr-:help "Select text printer")] | 2680 | pr-:help "Toggle tumble for PostScript file") |
| 2681 | :active (and pr-file-duplex pr-ps-utility-alist)]) | ||
| 2682 | ["Despool..." (call-interactively 'pr-despool-preview) | ||
| 2683 | :active pr-spool-p :keys "\\[pr-despool-preview]" | ||
| 2684 | ,@(funcall | ||
| 2685 | pr-:help "Despool PostScript buffer to printer or file (C-u)")]) | ||
| 2686 | ("PostScript Print" :included (pr-visible-p 'postscript) | ||
| 2687 | ,@(funcall | ||
| 2688 | pr-:help "Send PostScript to printer or file (C-u)") | ||
| 2689 | ("Directory" | ||
| 2690 | ["1-up" (pr-ps-directory-ps-print 1 nil nil t) t] | ||
| 2691 | ["2-up" (pr-ps-directory-ps-print 2 nil nil t) t] | ||
| 2692 | ["4-up" (pr-ps-directory-ps-print 4 nil nil t) t] | ||
| 2693 | ["Other..." (pr-ps-directory-ps-print nil nil nil t) | ||
| 2694 | :keys "\\[pr-ps-buffer-ps-print]"]) | ||
| 2695 | ("Buffer" | ||
| 2696 | ["1-up" (pr-ps-buffer-ps-print 1 t) t] | ||
| 2697 | ["2-up" (pr-ps-buffer-ps-print 2 t) t] | ||
| 2698 | ["4-up" (pr-ps-buffer-ps-print 4 t) t] | ||
| 2699 | ["Other..." (pr-ps-buffer-ps-print nil t) | ||
| 2700 | :keys "\\[pr-ps-buffer-ps-print]"]) | ||
| 2701 | ("Region" ,pr-:active (ps-mark-active-p) | ||
| 2702 | ["1-up" (pr-ps-region-ps-print 1 t) t] | ||
| 2703 | ["2-up" (pr-ps-region-ps-print 2 t) t] | ||
| 2704 | ["4-up" (pr-ps-region-ps-print 4 t) t] | ||
| 2705 | ["Other..." (pr-ps-region-ps-print nil t) | ||
| 2706 | :keys "\\[pr-ps-region-ps-print]"]) | ||
| 2707 | ("Mode" ,pr-:active (pr-mode-alist-p) | ||
| 2708 | ["1-up" (pr-ps-mode-ps-print 1 t) t] | ||
| 2709 | ["2-up" (pr-ps-mode-ps-print 2 t) t] | ||
| 2710 | ["4-up" (pr-ps-mode-ps-print 4 t) t] | ||
| 2711 | ["Other..." (pr-ps-mode-ps-print nil t) | ||
| 2712 | :keys "\\[pr-ps-mode-ps-print]"]) | ||
| 2713 | ("File" | ||
| 2714 | ["No Preprocessing..." (call-interactively 'pr-ps-file-ps-print) | ||
| 2715 | :keys "\\[pr-ps-file-ps-print]" | ||
| 2716 | ,@(funcall | ||
| 2717 | pr-:help "Send PostScript file to printer")] | ||
| 2743 | "--" | 2718 | "--" |
| 2744 | ["Landscape" pr-toggle-landscape | 2719 | ["PostScript Utility" pr-update-menus :active pr-ps-utility-alist |
| 2745 | :style toggle :selected ps-landscape-mode | ||
| 2746 | :included (pr-visible-p 'postscript-options)] | ||
| 2747 | ["Print Header" pr-toggle-header | ||
| 2748 | :style toggle :selected ps-print-header | ||
| 2749 | :included (pr-visible-p 'postscript-options)] | ||
| 2750 | ["Print Header Frame" pr-toggle-header-frame | ||
| 2751 | :style toggle :selected ps-print-header-frame :active ps-print-header | ||
| 2752 | :included (pr-visible-p 'postscript-options)] | ||
| 2753 | ["Line Number" pr-toggle-line | ||
| 2754 | :style toggle :selected ps-line-number | ||
| 2755 | :included (pr-visible-p 'postscript-options)] | ||
| 2756 | ["Zebra Stripes" pr-toggle-zebra | ||
| 2757 | :style toggle :selected ps-zebra-stripes | ||
| 2758 | :included (pr-visible-p 'postscript-options)] | ||
| 2759 | ["Duplex" pr-toggle-duplex | ||
| 2760 | :style toggle :selected ps-spool-duplex | ||
| 2761 | :included (pr-visible-p 'postscript-options)] | ||
| 2762 | ["Tumble" pr-toggle-tumble | ||
| 2763 | :style toggle :selected ps-spool-tumble :active ps-spool-duplex | ||
| 2764 | :included (pr-visible-p 'postscript-options)] | ||
| 2765 | ["Upside-Down" pr-toggle-upside-down | ||
| 2766 | :style toggle :selected ps-print-upside-down | ||
| 2767 | :included (pr-visible-p 'postscript-options)] | ||
| 2768 | ("Print All Pages" :included (pr-visible-p 'postscript-options) | ||
| 2769 | ,@(funcall | 2720 | ,@(funcall |
| 2770 | pr-:help "Select odd/even pages/sheets to print") | 2721 | pr-:help "Select PostScript utility")] |
| 2771 | ["All Pages" (pr-even-or-odd-pages nil) | 2722 | "--" |
| 2772 | :style radio :selected (eq ps-even-or-odd-pages nil)] | 2723 | ["1-up..." (pr-ps-file-up-ps-print 1 t t) pr-ps-utility-alist] |
| 2773 | ["Even Pages" (pr-even-or-odd-pages 'even-page) | 2724 | ["2-up..." (pr-ps-file-up-ps-print 2 t t) pr-ps-utility-alist] |
| 2774 | :style radio :selected (eq ps-even-or-odd-pages 'even-page)] | 2725 | ["4-up..." (pr-ps-file-up-ps-print 4 t t) pr-ps-utility-alist] |
| 2775 | ["Odd Pages" (pr-even-or-odd-pages 'odd-page) | 2726 | ["Other..." (pr-ps-file-up-ps-print nil t t) |
| 2776 | :style radio :selected (eq ps-even-or-odd-pages 'odd-page)] | 2727 | :keys "\\[pr-ps-file-up-ps-print]" :active pr-ps-utility-alist] |
| 2777 | ["Even Sheets" (pr-even-or-odd-pages 'even-sheet) | ||
| 2778 | :style radio :selected (eq ps-even-or-odd-pages 'even-sheet)] | ||
| 2779 | ["Odd Sheets" (pr-even-or-odd-pages 'odd-sheet) | ||
| 2780 | :style radio :selected (eq ps-even-or-odd-pages 'odd-sheet)]) | ||
| 2781 | "--" | 2728 | "--" |
| 2782 | ["Spool Buffer" pr-toggle-spool | 2729 | ["Landscape" pr-toggle-file-landscape-menu |
| 2783 | :style toggle :selected pr-spool-p | 2730 | :style toggle :selected pr-file-landscape |
| 2784 | :included (pr-visible-p 'postscript-process) | ||
| 2785 | ,@(funcall | 2731 | ,@(funcall |
| 2786 | pr-:help "Toggle PostScript spooling")] | 2732 | pr-:help "Toggle landscape for PostScript file") |
| 2787 | ["Print with faces" pr-toggle-faces | 2733 | :active pr-ps-utility-alist] |
| 2788 | :style toggle :selected pr-faces-p | 2734 | ["Duplex" pr-toggle-file-duplex-menu |
| 2789 | :included (pr-visible-p 'postscript-process) | 2735 | :style toggle :selected pr-file-duplex |
| 2790 | ,@(funcall | 2736 | ,@(funcall |
| 2791 | pr-:help "Toggle PostScript printing with faces")] | 2737 | pr-:help "Toggle duplex for PostScript file") |
| 2792 | ["Print via Ghostscript" pr-toggle-ghostscript | 2738 | :active pr-ps-utility-alist] |
| 2793 | :style toggle :selected pr-print-using-ghostscript | 2739 | ["Tumble" pr-toggle-file-tumble-menu |
| 2794 | :included (pr-visible-p 'postscript-process) | 2740 | :style toggle :selected pr-file-tumble |
| 2795 | ,@(funcall | 2741 | ,@(funcall |
| 2796 | pr-:help "Toggle PostScript generation using ghostscript")] | 2742 | pr-:help "Toggle tumble for PostScript file") |
| 2797 | "--" | 2743 | :active (and pr-file-duplex pr-ps-utility-alist)]) |
| 2798 | ["Auto Region" pr-toggle-region | 2744 | ["Despool..." (call-interactively 'pr-despool-ps-print) |
| 2799 | :style toggle :selected pr-auto-region | 2745 | :active pr-spool-p :keys "\\[pr-despool-ps-print]" |
| 2800 | :included (pr-visible-p 'printing)] | 2746 | ,@(funcall |
| 2801 | ["Auto Mode" pr-toggle-mode | 2747 | pr-:help "Despool PostScript buffer to printer or file (C-u)")]) |
| 2802 | :style toggle :selected pr-auto-mode | 2748 | ["PostScript Printers" pr-update-menus |
| 2803 | :included (pr-visible-p 'printing)] | 2749 | :active pr-ps-printer-alist :included (pr-visible-p 'postscript) |
| 2804 | ["Menu Lock" pr-toggle-lock | 2750 | ,@(funcall |
| 2805 | :style toggle :selected pr-menu-lock | 2751 | pr-:help "Select PostScript printer")] |
| 2806 | :included (pr-visible-p 'printing)] | 2752 | "--" |
| 2807 | "--" | 2753 | ("Printify" :included (pr-visible-p 'text) |
| 2808 | ("Customize" :included (pr-visible-p 'help) | 2754 | ,@(funcall |
| 2809 | ["printing" pr-customize t] | 2755 | pr-:help |
| 2810 | ["ps-print" ps-print-customize t] | 2756 | "Replace non-printing chars with printable representations.") |
| 2811 | ["lpr" lpr-customize t]) | 2757 | ["Directory" pr-printify-directory t] |
| 2812 | ("Show Settings" :included (pr-visible-p 'help) | 2758 | ["Buffer" pr-printify-buffer t] |
| 2813 | ["printing" pr-show-pr-setup t] | 2759 | ["Region" pr-printify-region (ps-mark-active-p)]) |
| 2814 | ["ps-print" pr-show-ps-setup t] | 2760 | ("Print" :included (pr-visible-p 'text) |
| 2815 | ["lpr" pr-show-lpr-setup t]) | 2761 | ,@(funcall |
| 2816 | ["Help" pr-help :active t :included (pr-visible-p 'help)] | 2762 | pr-:help "Send text to printer") |
| 2817 | ))) | 2763 | ["Directory" pr-txt-directory t] |
| 2764 | ["Buffer" pr-txt-buffer t] | ||
| 2765 | ["Region" pr-txt-region (ps-mark-active-p)] | ||
| 2766 | ["Mode" pr-txt-mode (pr-mode-alist-p)]) | ||
| 2767 | ["Text Printers" pr-update-menus | ||
| 2768 | :active pr-txt-printer-alist :included (pr-visible-p 'text) | ||
| 2769 | ,@(funcall | ||
| 2770 | pr-:help "Select text printer")] | ||
| 2771 | "--" | ||
| 2772 | ["Landscape" pr-toggle-landscape-menu | ||
| 2773 | :style toggle :selected ps-landscape-mode | ||
| 2774 | :included (pr-visible-p 'postscript-options)] | ||
| 2775 | ["Print Header" pr-toggle-header-menu | ||
| 2776 | :style toggle :selected ps-print-header | ||
| 2777 | :included (pr-visible-p 'postscript-options)] | ||
| 2778 | ["Print Header Frame" pr-toggle-header-frame-menu | ||
| 2779 | :style toggle :selected ps-print-header-frame :active ps-print-header | ||
| 2780 | :included (pr-visible-p 'postscript-options)] | ||
| 2781 | ["Line Number" pr-toggle-line-menu | ||
| 2782 | :style toggle :selected ps-line-number | ||
| 2783 | :included (pr-visible-p 'postscript-options)] | ||
| 2784 | ["Zebra Stripes" pr-toggle-zebra-menu | ||
| 2785 | :style toggle :selected ps-zebra-stripes | ||
| 2786 | :included (pr-visible-p 'postscript-options)] | ||
| 2787 | ["Duplex" pr-toggle-duplex-menu | ||
| 2788 | :style toggle :selected ps-spool-duplex | ||
| 2789 | :included (pr-visible-p 'postscript-options)] | ||
| 2790 | ["Tumble" pr-toggle-tumble-menu | ||
| 2791 | :style toggle :selected ps-spool-tumble :active ps-spool-duplex | ||
| 2792 | :included (pr-visible-p 'postscript-options)] | ||
| 2793 | ["Upside-Down" pr-toggle-upside-down-menu | ||
| 2794 | :style toggle :selected ps-print-upside-down | ||
| 2795 | :included (pr-visible-p 'postscript-options)] | ||
| 2796 | ("Print All Pages" :included (pr-visible-p 'postscript-options) | ||
| 2797 | ,@(funcall | ||
| 2798 | pr-:help "Select odd/even pages/sheets to print") | ||
| 2799 | ["All Pages" (pr-even-or-odd-pages nil) | ||
| 2800 | :style radio :selected (eq ps-even-or-odd-pages nil)] | ||
| 2801 | ["Even Pages" (pr-even-or-odd-pages 'even-page) | ||
| 2802 | :style radio :selected (eq ps-even-or-odd-pages 'even-page)] | ||
| 2803 | ["Odd Pages" (pr-even-or-odd-pages 'odd-page) | ||
| 2804 | :style radio :selected (eq ps-even-or-odd-pages 'odd-page)] | ||
| 2805 | ["Even Sheets" (pr-even-or-odd-pages 'even-sheet) | ||
| 2806 | :style radio :selected (eq ps-even-or-odd-pages 'even-sheet)] | ||
| 2807 | ["Odd Sheets" (pr-even-or-odd-pages 'odd-sheet) | ||
| 2808 | :style radio :selected (eq ps-even-or-odd-pages 'odd-sheet)]) | ||
| 2809 | "--" | ||
| 2810 | ["Spool Buffer" pr-toggle-spool-menu | ||
| 2811 | :style toggle :selected pr-spool-p | ||
| 2812 | :included (pr-visible-p 'postscript-process) | ||
| 2813 | ,@(funcall | ||
| 2814 | pr-:help "Toggle PostScript spooling")] | ||
| 2815 | ["Print with faces" pr-toggle-faces-menu | ||
| 2816 | :style toggle :selected pr-faces-p | ||
| 2817 | :included (pr-visible-p 'postscript-process) | ||
| 2818 | ,@(funcall | ||
| 2819 | pr-:help "Toggle PostScript printing with faces")] | ||
| 2820 | ["Print via Ghostscript" pr-toggle-ghostscript-menu | ||
| 2821 | :style toggle :selected pr-print-using-ghostscript | ||
| 2822 | :included (pr-visible-p 'postscript-process) | ||
| 2823 | ,@(funcall | ||
| 2824 | pr-:help "Toggle PostScript generation using ghostscript")] | ||
| 2825 | "--" | ||
| 2826 | ["Auto Region" pr-toggle-region-menu | ||
| 2827 | :style toggle :selected pr-auto-region | ||
| 2828 | :included (pr-visible-p 'printing)] | ||
| 2829 | ["Auto Mode" pr-toggle-mode-menu | ||
| 2830 | :style toggle :selected pr-auto-mode | ||
| 2831 | :included (pr-visible-p 'printing)] | ||
| 2832 | ["Menu Lock" pr-toggle-lock-menu | ||
| 2833 | :style toggle :selected pr-menu-lock | ||
| 2834 | :included (pr-visible-p 'printing)] | ||
| 2835 | "--" | ||
| 2836 | ("Customize" :included (pr-visible-p 'help) | ||
| 2837 | ["printing" pr-customize t] | ||
| 2838 | ["ps-print" ps-print-customize t] | ||
| 2839 | ["lpr" lpr-customize t]) | ||
| 2840 | ("Show Settings" :included (pr-visible-p 'help) | ||
| 2841 | ["printing" pr-show-pr-setup t] | ||
| 2842 | ["ps-print" pr-show-ps-setup t] | ||
| 2843 | ["lpr" pr-show-lpr-setup t]) | ||
| 2844 | ["Help" pr-help :active t :included (pr-visible-p 'help)] | ||
| 2845 | ))) | ||
| 2846 | |||
| 2847 | |||
| 2848 | (cond | ||
| 2849 | ((featurep 'xemacs) ; XEmacs | ||
| 2850 | ;; Menu binding | ||
| 2851 | (pr-xemacs-global-menubar | ||
| 2852 | (pr-x-add-submenu nil (cons "Printing" pr-menu-spec) "Apps"))) | ||
| 2818 | 2853 | ||
| 2819 | 2854 | ||
| 2855 | (t ; GNU Emacs | ||
| 2856 | ;; Menu binding | ||
| 2857 | (require 'easymenu) | ||
| 2858 | ;; Replace existing "print" item by "Printing" item. | ||
| 2859 | ;; If you're changing this file, you'll load it a second, | ||
| 2860 | ;; third... time, but "print" item exists only in the first load. | ||
| 2861 | (defvar pr-menu-print-item "print") | ||
| 2820 | (cond | 2862 | (cond |
| 2821 | ((eq ps-print-emacs-type 'emacs) ; GNU Emacs | 2863 | ;; Emacs 20 |
| 2822 | ;; Menu binding | 2864 | ((string< emacs-version "21.") |
| 2823 | (require 'easymenu) | 2865 | (easy-menu-change '("tools") "Printing" pr-menu-spec pr-menu-print-item) |
| 2824 | ;; Replace existing "print" item by "Printing" item. | 2866 | (when pr-menu-print-item |
| 2825 | ;; If you're changing this file, you'll load it a second, | 2867 | (easy-menu-remove-item nil '("tools") pr-menu-print-item) |
| 2826 | ;; third... time, but "print" item exists only in the first load. | 2868 | (setq pr-menu-print-item nil |
| 2827 | (defvar pr-menu-print-item "print") | 2869 | pr-menu-bar (vector 'menu-bar 'tools |
| 2828 | (cond | 2870 | (pr-get-symbol "Printing"))))) |
| 2829 | ;; Emacs 20 | 2871 | ;; Emacs 21 |
| 2830 | ((string< emacs-version "21.") | 2872 | (pr-menu-print-item |
| 2831 | (easy-menu-change '("tools") "Printing" pr-menu-spec pr-menu-print-item) | 2873 | (easy-menu-change '("file") "Print" pr-menu-spec "print-buffer") |
| 2832 | (when pr-menu-print-item | 2874 | (let ((items '("print-buffer" "print-region" |
| 2833 | (easy-menu-remove-item nil '("tools") pr-menu-print-item) | 2875 | "ps-print-buffer-faces" "ps-print-region-faces" |
| 2834 | (setq pr-menu-print-item nil | 2876 | "ps-print-buffer" "ps-print-region"))) |
| 2835 | pr-menu-bar (vector 'menu-bar 'tools | 2877 | (while items |
| 2836 | (pr-get-symbol "Printing"))))) | 2878 | (easy-menu-remove-item nil '("file") (car items)) |
| 2837 | ;; Emacs 21 | 2879 | (setq items (cdr items))) |
| 2838 | (pr-menu-print-item | 2880 | (setq pr-menu-print-item nil |
| 2839 | (easy-menu-change '("file") "Print" pr-menu-spec "print-buffer") | 2881 | pr-menu-bar (vector 'menu-bar 'file |
| 2840 | (let ((items '("print-buffer" "print-region" | 2882 | (pr-get-symbol "Print"))))) |
| 2841 | "ps-print-buffer-faces" "ps-print-region-faces" | 2883 | (t |
| 2842 | "ps-print-buffer" "ps-print-region"))) | 2884 | (easy-menu-change '("file") "Print" pr-menu-spec))))) |
| 2843 | (while items | ||
| 2844 | (easy-menu-remove-item nil '("file") (car items)) | ||
| 2845 | (setq items (cdr items))) | ||
| 2846 | (setq pr-menu-print-item nil | ||
| 2847 | pr-menu-bar (vector 'menu-bar 'file | ||
| 2848 | (pr-get-symbol "Print"))))) | ||
| 2849 | (t | ||
| 2850 | (easy-menu-change '("file") "Print" pr-menu-spec)))) | ||
| 2851 | |||
| 2852 | |||
| 2853 | ((eq ps-print-emacs-type 'xemacs) ; XEmacs | ||
| 2854 | ;; Menu binding | ||
| 2855 | (pr-xemacs-global-menubar | ||
| 2856 | (pr-x-add-submenu nil (cons "Printing" pr-menu-spec) "Apps")))) | ||
| 2857 | 2885 | ||
| 2858 | 2886 | ||
| 2859 | ;; Key binding | 2887 | ;; Key binding |
| 2860 | (let ((pr-print-key (if (eq ps-print-emacs-type 'emacs) | 2888 | (let ((pr-print-key (if (featurep 'xemacs) |
| 2861 | 'print ; GNU Emacs | 2889 | 'f22 ; XEmacs |
| 2862 | 'f22))) ; XEmacs | 2890 | 'print))) ; GNU Emacs |
| 2863 | (global-set-key `[,pr-print-key] 'pr-ps-fast-fire) | 2891 | (global-set-key `[,pr-print-key] 'pr-ps-fast-fire) |
| 2864 | ;; Well, M-print and S-print are used because in my keyboard S-print works | 2892 | ;; Well, M-print and S-print are used because in my keyboard S-print works |
| 2865 | ;; and M-print doesn't. But M-print can work in other keyboard. | 2893 | ;; and M-print doesn't. But M-print can work in other keyboard. |
| 2866 | (global-set-key `[(meta ,pr-print-key)] 'pr-ps-mode-using-ghostscript) | 2894 | (global-set-key `[(meta ,pr-print-key)] 'pr-ps-mode-using-ghostscript) |
| 2867 | (global-set-key `[(shift ,pr-print-key)] 'pr-ps-mode-using-ghostscript) | 2895 | (global-set-key `[(shift ,pr-print-key)] 'pr-ps-mode-using-ghostscript) |
| 2868 | ;; Well, C-print and C-M-print are used because in my keyboard C-M-print works | 2896 | ;; Well, C-print and C-M-print are used because in my keyboard C-M-print works |
| 2869 | ;; and C-print doesn't. But C-print can work in other keyboard. | 2897 | ;; and C-print doesn't. But C-print can work in other keyboard. |
| 2870 | (global-set-key `[(control ,pr-print-key)] 'pr-txt-fast-fire) | 2898 | (global-set-key `[(control ,pr-print-key)] 'pr-txt-fast-fire) |
| 2871 | (global-set-key `[(control meta ,pr-print-key)] 'pr-txt-fast-fire) | 2899 | (global-set-key `[(control meta ,pr-print-key)] 'pr-txt-fast-fire)) |
| 2872 | )) | ||
| 2873 | 2900 | ||
| 2874 | 2901 | ||
| 2875 | ;;; You can also use something like: | 2902 | ;;; You can also use something like: |
| @@ -3345,10 +3372,9 @@ If BUFFER is nil, the current buffer is used for printing. | |||
| 3345 | 3372 | ||
| 3346 | For more information, type \\[pr-interface-help]." | 3373 | For more information, type \\[pr-interface-help]." |
| 3347 | (interactive) | 3374 | (interactive) |
| 3348 | (pr-save-interactive | 3375 | (save-excursion |
| 3349 | (save-excursion | 3376 | (set-buffer (or buffer (current-buffer))) |
| 3350 | (set-buffer (or buffer (current-buffer))) | 3377 | (pr-create-interface))) |
| 3351 | (pr-create-interface)))) | ||
| 3352 | 3378 | ||
| 3353 | 3379 | ||
| 3354 | ;;;###autoload | 3380 | ;;;###autoload |
| @@ -3369,13 +3395,12 @@ file name. | |||
| 3369 | 3395 | ||
| 3370 | See also documentation for `pr-list-directory'." | 3396 | See also documentation for `pr-list-directory'." |
| 3371 | (interactive (pr-interactive-ps-dir-args (pr-prompt "PS preview dir"))) | 3397 | (interactive (pr-interactive-ps-dir-args (pr-prompt "PS preview dir"))) |
| 3372 | (pr-save-interactive | 3398 | (pr-set-ps-dir-args 'n-up 'dir 'file-regexp 'filename |
| 3373 | (pr-set-ps-dir-args 'n-up 'dir 'file-regexp 'filename | 3399 | (pr-prompt "PS preview dir")) |
| 3374 | (pr-prompt "PS preview dir")) | 3400 | (setq filename (pr-ps-file filename)) |
| 3375 | (setq filename (pr-ps-file filename)) | 3401 | (pr-ps-file-list n-up dir file-regexp filename) |
| 3376 | (pr-ps-file-list n-up dir file-regexp filename) | 3402 | (or pr-spool-p |
| 3377 | (or pr-spool-p | 3403 | (pr-ps-file-preview filename))) |
| 3378 | (pr-ps-file-preview filename)))) | ||
| 3379 | 3404 | ||
| 3380 | 3405 | ||
| 3381 | ;;;###autoload | 3406 | ;;;###autoload |
| @@ -3396,13 +3421,12 @@ file name. | |||
| 3396 | 3421 | ||
| 3397 | See also documentation for `pr-list-directory'." | 3422 | See also documentation for `pr-list-directory'." |
| 3398 | (interactive (pr-interactive-ps-dir-args (pr-prompt "PS print dir GS"))) | 3423 | (interactive (pr-interactive-ps-dir-args (pr-prompt "PS print dir GS"))) |
| 3399 | (pr-save-interactive | 3424 | (pr-set-ps-dir-args 'n-up 'dir 'file-regexp 'filename |
| 3400 | (pr-set-ps-dir-args 'n-up 'dir 'file-regexp 'filename | 3425 | (pr-prompt "PS print dir GS")) |
| 3401 | (pr-prompt "PS print dir GS")) | 3426 | (let ((file (pr-ps-file filename))) |
| 3402 | (let ((file (pr-ps-file filename))) | 3427 | (pr-ps-file-list n-up dir file-regexp file) |
| 3403 | (pr-ps-file-list n-up dir file-regexp file) | 3428 | (pr-ps-file-using-ghostscript file) |
| 3404 | (pr-ps-file-using-ghostscript file) | 3429 | (or filename (pr-delete-file file)))) |
| 3405 | (or filename (pr-delete-file file))))) | ||
| 3406 | 3430 | ||
| 3407 | 3431 | ||
| 3408 | ;;;###autoload | 3432 | ;;;###autoload |
| @@ -3423,13 +3447,12 @@ file name. | |||
| 3423 | 3447 | ||
| 3424 | See also documentation for `pr-list-directory'." | 3448 | See also documentation for `pr-list-directory'." |
| 3425 | (interactive (pr-interactive-ps-dir-args (pr-prompt "PS print dir"))) | 3449 | (interactive (pr-interactive-ps-dir-args (pr-prompt "PS print dir"))) |
| 3426 | (pr-save-interactive | 3450 | (pr-set-ps-dir-args 'n-up 'dir 'file-regexp 'filename |
| 3427 | (pr-set-ps-dir-args 'n-up 'dir 'file-regexp 'filename | 3451 | (pr-prompt "PS print dir")) |
| 3428 | (pr-prompt "PS print dir")) | 3452 | (let ((file (pr-ps-file filename))) |
| 3429 | (let ((file (pr-ps-file filename))) | 3453 | (pr-ps-file-list n-up dir file-regexp file) |
| 3430 | (pr-ps-file-list n-up dir file-regexp file) | 3454 | (pr-ps-file-print file) |
| 3431 | (pr-ps-file-print file) | 3455 | (or filename (pr-delete-file file)))) |
| 3432 | (or filename (pr-delete-file file))))) | ||
| 3433 | 3456 | ||
| 3434 | 3457 | ||
| 3435 | ;;;###autoload | 3458 | ;;;###autoload |
| @@ -3453,12 +3476,11 @@ file name. | |||
| 3453 | See also documentation for `pr-list-directory'." | 3476 | See also documentation for `pr-list-directory'." |
| 3454 | (interactive (pr-interactive-ps-dir-args | 3477 | (interactive (pr-interactive-ps-dir-args |
| 3455 | (pr-prompt (pr-prompt-gs "PS print dir")))) | 3478 | (pr-prompt (pr-prompt-gs "PS print dir")))) |
| 3456 | (pr-save-interactive | 3479 | (pr-set-ps-dir-args 'n-up 'dir 'file-regexp 'filename |
| 3457 | (pr-set-ps-dir-args 'n-up 'dir 'file-regexp 'filename | 3480 | (pr-prompt (pr-prompt-gs "PS print dir"))) |
| 3458 | (pr-prompt (pr-prompt-gs "PS print dir"))) | 3481 | (if (pr-using-ghostscript-p) |
| 3459 | (if (pr-using-ghostscript-p) | 3482 | (pr-ps-directory-using-ghostscript n-up dir file-regexp filename) |
| 3460 | (pr-ps-directory-using-ghostscript n-up dir file-regexp filename) | 3483 | (pr-ps-directory-print n-up dir file-regexp filename))) |
| 3461 | (pr-ps-directory-print n-up dir file-regexp filename)))) | ||
| 3462 | 3484 | ||
| 3463 | 3485 | ||
| 3464 | ;;;###autoload | 3486 | ;;;###autoload |
| @@ -3474,11 +3496,10 @@ argument FILENAME is treated as follows: if it's nil, save the image in a | |||
| 3474 | temporary file. If FILENAME is a string, save the PostScript image in a file | 3496 | temporary file. If FILENAME is a string, save the PostScript image in a file |
| 3475 | with that name. If FILENAME is t, prompts for a file name." | 3497 | with that name. If FILENAME is t, prompts for a file name." |
| 3476 | (interactive (pr-interactive-n-up-file (pr-prompt "PS preview"))) | 3498 | (interactive (pr-interactive-n-up-file (pr-prompt "PS preview"))) |
| 3477 | (pr-save-interactive | 3499 | (if (pr-auto-mode-p) |
| 3478 | (if (pr-auto-mode-p) | 3500 | (pr-ps-mode-preview n-up filename) |
| 3479 | (pr-ps-mode-preview n-up filename) | 3501 | (pr-ps-preview (pr-region-active-symbol) n-up filename |
| 3480 | (pr-ps-preview (pr-region-active-symbol) n-up filename | 3502 | (pr-region-active-string "PS preview")))) |
| 3481 | (pr-region-active-string "PS preview"))))) | ||
| 3482 | 3503 | ||
| 3483 | 3504 | ||
| 3484 | ;;;###autoload | 3505 | ;;;###autoload |
| @@ -3494,11 +3515,10 @@ argument FILENAME is treated as follows: if it's nil, send the image to the | |||
| 3494 | printer. If FILENAME is a string, save the PostScript image in a file with | 3515 | printer. If FILENAME is a string, save the PostScript image in a file with |
| 3495 | that name. If FILENAME is t, prompts for a file name." | 3516 | that name. If FILENAME is t, prompts for a file name." |
| 3496 | (interactive (pr-interactive-n-up-file (pr-prompt "PS print GS"))) | 3517 | (interactive (pr-interactive-n-up-file (pr-prompt "PS print GS"))) |
| 3497 | (pr-save-interactive | 3518 | (if (pr-auto-mode-p) |
| 3498 | (if (pr-auto-mode-p) | 3519 | (pr-ps-mode-using-ghostscript n-up filename) |
| 3499 | (pr-ps-mode-using-ghostscript n-up filename) | 3520 | (pr-ps-using-ghostscript (pr-region-active-symbol) n-up filename |
| 3500 | (pr-ps-using-ghostscript (pr-region-active-symbol) n-up filename | 3521 | (pr-region-active-string "PS print GS")))) |
| 3501 | (pr-region-active-string "PS print GS"))))) | ||
| 3502 | 3522 | ||
| 3503 | 3523 | ||
| 3504 | ;;;###autoload | 3524 | ;;;###autoload |
| @@ -3514,11 +3534,10 @@ argument FILENAME is treated as follows: if it's nil, send the image to the | |||
| 3514 | printer. If FILENAME is a string, save the PostScript image in a file with | 3534 | printer. If FILENAME is a string, save the PostScript image in a file with |
| 3515 | that name. If FILENAME is t, prompts for a file name." | 3535 | that name. If FILENAME is t, prompts for a file name." |
| 3516 | (interactive (pr-interactive-n-up-file (pr-prompt "PS print"))) | 3536 | (interactive (pr-interactive-n-up-file (pr-prompt "PS print"))) |
| 3517 | (pr-save-interactive | 3537 | (if (pr-auto-mode-p) |
| 3518 | (if (pr-auto-mode-p) | 3538 | (pr-ps-mode-print n-up filename) |
| 3519 | (pr-ps-mode-print n-up filename) | 3539 | (pr-ps-print (pr-region-active-symbol) n-up filename |
| 3520 | (pr-ps-print (pr-region-active-symbol) n-up filename | 3540 | (pr-region-active-string "PS print")))) |
| 3521 | (pr-region-active-string "PS print"))))) | ||
| 3522 | 3541 | ||
| 3523 | 3542 | ||
| 3524 | ;;;###autoload | 3543 | ;;;###autoload |
| @@ -3537,15 +3556,14 @@ printer. If FILENAME is a string, save the PostScript image in a file with | |||
| 3537 | that name. If FILENAME is t, prompts for a file name." | 3556 | that name. If FILENAME is t, prompts for a file name." |
| 3538 | (interactive (pr-interactive-n-up-file | 3557 | (interactive (pr-interactive-n-up-file |
| 3539 | (pr-prompt (pr-prompt-gs "PS print")))) | 3558 | (pr-prompt (pr-prompt-gs "PS print")))) |
| 3540 | (pr-save-interactive | 3559 | (cond ((pr-auto-mode-p) |
| 3541 | (cond ((pr-auto-mode-p) | 3560 | (pr-ps-mode-ps-print n-up filename)) |
| 3542 | (pr-ps-mode-ps-print n-up filename)) | 3561 | ((pr-using-ghostscript-p) |
| 3543 | ((pr-using-ghostscript-p) | 3562 | (pr-ps-using-ghostscript (pr-region-active-symbol) n-up filename |
| 3544 | (pr-ps-using-ghostscript (pr-region-active-symbol) n-up filename | 3563 | (pr-region-active-string "PS print GS"))) |
| 3545 | (pr-region-active-string "PS print GS"))) | 3564 | (t |
| 3546 | (t | 3565 | (pr-ps-print (pr-region-active-symbol) n-up filename |
| 3547 | (pr-ps-print (pr-region-active-symbol) n-up filename | 3566 | (pr-region-active-string "PS print"))))) |
| 3548 | (pr-region-active-string "PS print")))))) | ||
| 3549 | 3567 | ||
| 3550 | 3568 | ||
| 3551 | ;;;###autoload | 3569 | ;;;###autoload |
| @@ -3554,11 +3572,10 @@ that name. If FILENAME is t, prompts for a file name." | |||
| 3554 | 3572 | ||
| 3555 | See also `pr-ps-buffer-preview'." | 3573 | See also `pr-ps-buffer-preview'." |
| 3556 | (interactive (pr-interactive-n-up-file (pr-prompt-region "PS preview"))) | 3574 | (interactive (pr-interactive-n-up-file (pr-prompt-region "PS preview"))) |
| 3557 | (pr-save-interactive | 3575 | (if (pr-auto-mode-p) |
| 3558 | (if (pr-auto-mode-p) | 3576 | (let ((pr-auto-region t)) |
| 3559 | (let ((pr-auto-region t)) | 3577 | (pr-ps-mode-preview n-up filename)) |
| 3560 | (pr-ps-mode-preview n-up filename)) | 3578 | (pr-ps-preview 'region n-up filename "PS preview region"))) |
| 3561 | (pr-ps-preview 'region n-up filename "PS preview region")))) | ||
| 3562 | 3579 | ||
| 3563 | 3580 | ||
| 3564 | ;;;###autoload | 3581 | ;;;###autoload |
| @@ -3567,11 +3584,10 @@ See also `pr-ps-buffer-preview'." | |||
| 3567 | 3584 | ||
| 3568 | See also `pr-ps-buffer-using-ghostscript'." | 3585 | See also `pr-ps-buffer-using-ghostscript'." |
| 3569 | (interactive (pr-interactive-n-up-file (pr-prompt-region "PS print GS"))) | 3586 | (interactive (pr-interactive-n-up-file (pr-prompt-region "PS print GS"))) |
| 3570 | (pr-save-interactive | 3587 | (if (pr-auto-mode-p) |
| 3571 | (if (pr-auto-mode-p) | 3588 | (let ((pr-auto-region t)) |
| 3572 | (let ((pr-auto-region t)) | 3589 | (pr-ps-mode-using-ghostscript n-up filename)) |
| 3573 | (pr-ps-mode-using-ghostscript n-up filename)) | 3590 | (pr-ps-using-ghostscript 'region n-up filename "PS print GS region"))) |
| 3574 | (pr-ps-using-ghostscript 'region n-up filename "PS print GS region")))) | ||
| 3575 | 3591 | ||
| 3576 | 3592 | ||
| 3577 | ;;;###autoload | 3593 | ;;;###autoload |
| @@ -3580,11 +3596,10 @@ See also `pr-ps-buffer-using-ghostscript'." | |||
| 3580 | 3596 | ||
| 3581 | See also `pr-ps-buffer-print'." | 3597 | See also `pr-ps-buffer-print'." |
| 3582 | (interactive (pr-interactive-n-up-file (pr-prompt-region "PS print"))) | 3598 | (interactive (pr-interactive-n-up-file (pr-prompt-region "PS print"))) |
| 3583 | (pr-save-interactive | 3599 | (if (pr-auto-mode-p) |
| 3584 | (if (pr-auto-mode-p) | 3600 | (let ((pr-auto-region t)) |
| 3585 | (let ((pr-auto-region t)) | 3601 | (pr-ps-mode-print n-up filename)) |
| 3586 | (pr-ps-mode-print n-up filename)) | 3602 | (pr-ps-print 'region n-up filename "PS print region"))) |
| 3587 | (pr-ps-print 'region n-up filename "PS print region")))) | ||
| 3588 | 3603 | ||
| 3589 | 3604 | ||
| 3590 | ;;;###autoload | 3605 | ;;;###autoload |
| @@ -3594,14 +3609,13 @@ See also `pr-ps-buffer-print'." | |||
| 3594 | See also `pr-ps-buffer-ps-print'." | 3609 | See also `pr-ps-buffer-ps-print'." |
| 3595 | (interactive (pr-interactive-n-up-file | 3610 | (interactive (pr-interactive-n-up-file |
| 3596 | (pr-prompt-region (pr-prompt-gs "PS print")))) | 3611 | (pr-prompt-region (pr-prompt-gs "PS print")))) |
| 3597 | (pr-save-interactive | 3612 | (cond ((pr-auto-mode-p) |
| 3598 | (cond ((pr-auto-mode-p) | 3613 | (let ((pr-auto-region t)) |
| 3599 | (let ((pr-auto-region t)) | 3614 | (pr-ps-mode-ps-print n-up filename))) |
| 3600 | (pr-ps-mode-ps-print n-up filename))) | 3615 | ((pr-using-ghostscript-p) |
| 3601 | ((pr-using-ghostscript-p) | 3616 | (pr-ps-using-ghostscript 'region n-up filename "PS print GS region")) |
| 3602 | (pr-ps-using-ghostscript 'region n-up filename "PS print GS region")) | 3617 | (t |
| 3603 | (t | 3618 | (pr-ps-print 'region n-up filename "PS print region")))) |
| 3604 | (pr-ps-print 'region n-up filename "PS print region"))))) | ||
| 3605 | 3619 | ||
| 3606 | 3620 | ||
| 3607 | ;;;###autoload | 3621 | ;;;###autoload |
| @@ -3610,12 +3624,11 @@ See also `pr-ps-buffer-ps-print'." | |||
| 3610 | 3624 | ||
| 3611 | See also `pr-ps-buffer-preview'." | 3625 | See also `pr-ps-buffer-preview'." |
| 3612 | (interactive (pr-interactive-n-up-file "PS preview mode")) | 3626 | (interactive (pr-interactive-n-up-file "PS preview mode")) |
| 3613 | (pr-save-interactive | 3627 | (pr-set-n-up-and-filename 'n-up 'filename "PS preview mode") |
| 3614 | (pr-set-n-up-and-filename 'n-up 'filename "PS preview mode") | 3628 | (let ((file (pr-ps-file filename))) |
| 3615 | (let ((file (pr-ps-file filename))) | 3629 | (and (pr-ps-mode n-up file) |
| 3616 | (and (pr-ps-mode n-up file) | 3630 | (not pr-spool-p) |
| 3617 | (not pr-spool-p) | 3631 | (pr-ps-file-preview file)))) |
| 3618 | (pr-ps-file-preview file))))) | ||
| 3619 | 3632 | ||
| 3620 | 3633 | ||
| 3621 | ;;;###autoload | 3634 | ;;;###autoload |
| @@ -3624,13 +3637,12 @@ See also `pr-ps-buffer-preview'." | |||
| 3624 | 3637 | ||
| 3625 | See also `pr-ps-buffer-using-ghostscript'." | 3638 | See also `pr-ps-buffer-using-ghostscript'." |
| 3626 | (interactive (pr-interactive-n-up-file "PS print GS mode")) | 3639 | (interactive (pr-interactive-n-up-file "PS print GS mode")) |
| 3627 | (pr-save-interactive | 3640 | (pr-set-n-up-and-filename 'n-up 'filename "PS print GS mode") |
| 3628 | (pr-set-n-up-and-filename 'n-up 'filename "PS print GS mode") | 3641 | (let ((file (pr-ps-file filename))) |
| 3629 | (let ((file (pr-ps-file filename))) | 3642 | (when (and (pr-ps-mode n-up file) |
| 3630 | (when (and (pr-ps-mode n-up file) | 3643 | (not pr-spool-p)) |
| 3631 | (not pr-spool-p)) | 3644 | (pr-ps-file-using-ghostscript file) |
| 3632 | (pr-ps-file-using-ghostscript file) | 3645 | (or filename (pr-delete-file file))))) |
| 3633 | (or filename (pr-delete-file file)))))) | ||
| 3634 | 3646 | ||
| 3635 | 3647 | ||
| 3636 | ;;;###autoload | 3648 | ;;;###autoload |
| @@ -3639,9 +3651,8 @@ See also `pr-ps-buffer-using-ghostscript'." | |||
| 3639 | 3651 | ||
| 3640 | See also `pr-ps-buffer-print'." | 3652 | See also `pr-ps-buffer-print'." |
| 3641 | (interactive (pr-interactive-n-up-file "PS print mode")) | 3653 | (interactive (pr-interactive-n-up-file "PS print mode")) |
| 3642 | (pr-save-interactive | 3654 | (pr-set-n-up-and-filename 'n-up 'filename "PS print mode") |
| 3643 | (pr-set-n-up-and-filename 'n-up 'filename "PS print mode") | 3655 | (pr-ps-mode n-up filename)) |
| 3644 | (pr-ps-mode n-up filename))) | ||
| 3645 | 3656 | ||
| 3646 | 3657 | ||
| 3647 | ;;;###autoload | 3658 | ;;;###autoload |
| @@ -3650,10 +3661,9 @@ See also `pr-ps-buffer-print'." | |||
| 3650 | 3661 | ||
| 3651 | See also `pr-ps-buffer-ps-print'." | 3662 | See also `pr-ps-buffer-ps-print'." |
| 3652 | (interactive (pr-interactive-n-up-file (pr-prompt-gs "PS print mode"))) | 3663 | (interactive (pr-interactive-n-up-file (pr-prompt-gs "PS print mode"))) |
| 3653 | (pr-save-interactive | 3664 | (if (pr-using-ghostscript-p) |
| 3654 | (if (pr-using-ghostscript-p) | 3665 | (pr-ps-mode-using-ghostscript n-up filename) |
| 3655 | (pr-ps-mode-using-ghostscript n-up filename) | 3666 | (pr-ps-mode-print n-up filename))) |
| 3656 | (pr-ps-mode-print n-up filename)))) | ||
| 3657 | 3667 | ||
| 3658 | 3668 | ||
| 3659 | ;;;###autoload | 3669 | ;;;###autoload |
| @@ -3670,9 +3680,8 @@ prompts for FILE(name)-REGEXP. | |||
| 3670 | 3680 | ||
| 3671 | See also documentation for `pr-list-directory'." | 3681 | See also documentation for `pr-list-directory'." |
| 3672 | (interactive (pr-interactive-dir-args "Printify dir")) | 3682 | (interactive (pr-interactive-dir-args "Printify dir")) |
| 3673 | (pr-save-interactive | 3683 | (pr-set-dir-args 'dir 'file-regexp "Printify dir") |
| 3674 | (pr-set-dir-args 'dir 'file-regexp "Printify dir") | 3684 | (pr-file-list dir file-regexp 'pr-printify-buffer)) |
| 3675 | (pr-file-list dir file-regexp 'pr-printify-buffer))) | ||
| 3676 | 3685 | ||
| 3677 | 3686 | ||
| 3678 | ;;;###autoload | 3687 | ;;;###autoload |
| @@ -3707,9 +3716,8 @@ prompts for FILE(name)-REGEXP. | |||
| 3707 | 3716 | ||
| 3708 | See also documentation for `pr-list-directory'." | 3717 | See also documentation for `pr-list-directory'." |
| 3709 | (interactive (pr-interactive-dir-args "Print dir")) | 3718 | (interactive (pr-interactive-dir-args "Print dir")) |
| 3710 | (pr-save-interactive | 3719 | (pr-set-dir-args 'dir 'file-regexp "Print dir") |
| 3711 | (pr-set-dir-args 'dir 'file-regexp "Print dir") | 3720 | (pr-file-list dir file-regexp 'pr-txt-buffer)) |
| 3712 | (pr-file-list dir file-regexp 'pr-txt-buffer))) | ||
| 3713 | 3721 | ||
| 3714 | 3722 | ||
| 3715 | ;;;###autoload | 3723 | ;;;###autoload |
| @@ -3757,11 +3765,10 @@ Noninteractively, the argument FILENAME is treated as follows: if it is nil, | |||
| 3757 | save the image in a temporary file. If FILENAME is a string, save the | 3765 | save the image in a temporary file. If FILENAME is a string, save the |
| 3758 | PostScript image in a file with that name." | 3766 | PostScript image in a file with that name." |
| 3759 | (interactive (list (ps-print-preprint current-prefix-arg))) | 3767 | (interactive (list (ps-print-preprint current-prefix-arg))) |
| 3760 | (pr-save-interactive | 3768 | (let ((file (pr-ps-file filename))) |
| 3761 | (let ((file (pr-ps-file filename))) | 3769 | (when (stringp file) |
| 3762 | (when (stringp file) | 3770 | (pr-despool-print file) |
| 3763 | (pr-despool-print file) | 3771 | (pr-ps-file-preview file)))) |
| 3764 | (pr-ps-file-preview file))))) | ||
| 3765 | 3772 | ||
| 3766 | 3773 | ||
| 3767 | ;;;###autoload | 3774 | ;;;###autoload |
| @@ -3776,12 +3783,11 @@ Noninteractively, the argument FILENAME is treated as follows: if it is nil, | |||
| 3776 | send the image to the printer. If FILENAME is a string, save the PostScript | 3783 | send the image to the printer. If FILENAME is a string, save the PostScript |
| 3777 | image in a file with that name." | 3784 | image in a file with that name." |
| 3778 | (interactive (list (ps-print-preprint current-prefix-arg))) | 3785 | (interactive (list (ps-print-preprint current-prefix-arg))) |
| 3779 | (pr-save-interactive | 3786 | (let ((file (pr-ps-file filename))) |
| 3780 | (let ((file (pr-ps-file filename))) | 3787 | (when (stringp file) |
| 3781 | (when (stringp file) | 3788 | (pr-despool-print file) |
| 3782 | (pr-despool-print file) | 3789 | (pr-ps-file-using-ghostscript file) |
| 3783 | (pr-ps-file-using-ghostscript file) | 3790 | (or filename (pr-delete-file file))))) |
| 3784 | (or filename (pr-delete-file file)))))) | ||
| 3785 | 3791 | ||
| 3786 | 3792 | ||
| 3787 | ;;;###autoload | 3793 | ;;;###autoload |
| @@ -3796,13 +3802,12 @@ Noninteractively, the argument FILENAME is treated as follows: if it is nil, | |||
| 3796 | send the image to the printer. If FILENAME is a string, save the PostScript | 3802 | send the image to the printer. If FILENAME is a string, save the PostScript |
| 3797 | image in a file with that name." | 3803 | image in a file with that name." |
| 3798 | (interactive (list (ps-print-preprint current-prefix-arg))) | 3804 | (interactive (list (ps-print-preprint current-prefix-arg))) |
| 3799 | (pr-save-interactive | 3805 | (pr-save-file-modes |
| 3800 | (pr-save-file-modes | 3806 | (let ((ps-lpr-command (pr-command pr-ps-command)) |
| 3801 | (let ((ps-lpr-command (pr-command pr-ps-command)) | 3807 | (ps-lpr-switches pr-ps-switches) |
| 3802 | (ps-lpr-switches pr-ps-switches) | 3808 | (ps-printer-name-option pr-ps-printer-switch) |
| 3803 | (ps-printer-name-option pr-ps-printer-switch) | 3809 | (ps-printer-name pr-ps-printer)) |
| 3804 | (ps-printer-name pr-ps-printer)) | 3810 | (ps-despool filename)))) |
| 3805 | (ps-despool filename))))) | ||
| 3806 | 3811 | ||
| 3807 | 3812 | ||
| 3808 | ;;;###autoload | 3813 | ;;;###autoload |
| @@ -3817,10 +3822,9 @@ Noninteractively, the argument FILENAME is treated as follows: if it is nil, | |||
| 3817 | send the image to the printer. If FILENAME is a string, save the PostScript | 3822 | send the image to the printer. If FILENAME is a string, save the PostScript |
| 3818 | image in a file with that name." | 3823 | image in a file with that name." |
| 3819 | (interactive (list (ps-print-preprint current-prefix-arg))) | 3824 | (interactive (list (ps-print-preprint current-prefix-arg))) |
| 3820 | (pr-save-interactive | 3825 | (if pr-print-using-ghostscript |
| 3821 | (if pr-print-using-ghostscript | 3826 | (pr-despool-using-ghostscript filename) |
| 3822 | (pr-despool-using-ghostscript filename) | 3827 | (pr-despool-print filename))) |
| 3823 | (pr-despool-print filename)))) | ||
| 3824 | 3828 | ||
| 3825 | 3829 | ||
| 3826 | ;;;###autoload | 3830 | ;;;###autoload |
| @@ -3835,11 +3839,10 @@ image in a file with that name." | |||
| 3835 | (defun pr-ps-file-up-preview (n-up ifilename &optional ofilename) | 3839 | (defun pr-ps-file-up-preview (n-up ifilename &optional ofilename) |
| 3836 | "Preview PostScript file FILENAME." | 3840 | "Preview PostScript file FILENAME." |
| 3837 | (interactive (pr-interactive-n-up-inout "PS preview")) | 3841 | (interactive (pr-interactive-n-up-inout "PS preview")) |
| 3838 | (pr-save-interactive | 3842 | (let ((outfile (pr-ps-utility-args 'n-up 'ifilename 'ofilename |
| 3839 | (let ((outfile (pr-ps-utility-args 'n-up 'ifilename 'ofilename | 3843 | "PS preview "))) |
| 3840 | "PS preview "))) | 3844 | (pr-ps-utility-process n-up ifilename outfile) |
| 3841 | (pr-ps-utility-process n-up ifilename outfile) | 3845 | (pr-ps-file-preview outfile))) |
| 3842 | (pr-ps-file-preview outfile)))) | ||
| 3843 | 3846 | ||
| 3844 | 3847 | ||
| 3845 | ;;;###autoload | 3848 | ;;;###autoload |
| @@ -3847,21 +3850,20 @@ image in a file with that name." | |||
| 3847 | "Print PostScript file FILENAME using ghostscript." | 3850 | "Print PostScript file FILENAME using ghostscript." |
| 3848 | (interactive (list (pr-ps-infile-preprint "Print preview "))) | 3851 | (interactive (list (pr-ps-infile-preprint "Print preview "))) |
| 3849 | (and (stringp filename) (file-exists-p filename) | 3852 | (and (stringp filename) (file-exists-p filename) |
| 3850 | (pr-save-interactive | 3853 | (let* ((file (pr-expand-file-name filename)) |
| 3851 | (let* ((file (pr-expand-file-name filename)) | 3854 | (tempfile (pr-dosify-file-name (make-temp-file file)))) |
| 3852 | (tempfile (pr-dosify-file-name (make-temp-file file)))) | 3855 | ;; gs use |
| 3853 | ;; gs use | 3856 | (pr-call-process pr-gs-command |
| 3854 | (pr-call-process pr-gs-command | 3857 | (format "-sDEVICE=%s" pr-gs-device) |
| 3855 | (format "-sDEVICE=%s" pr-gs-device) | 3858 | (format "-r%d" pr-gs-resolution) |
| 3856 | (format "-r%d" pr-gs-resolution) | 3859 | (pr-switches-string pr-gs-switches "pr-gs-switches") |
| 3857 | (pr-switches-string pr-gs-switches "pr-gs-switches") | 3860 | (format "-sOutputFile=\"%s\"" tempfile) |
| 3858 | (format "-sOutputFile=\"%s\"" tempfile) | 3861 | file |
| 3859 | file | 3862 | "-c quit") |
| 3860 | "-c quit") | 3863 | ;; printing |
| 3861 | ;; printing | 3864 | (pr-ps-file-print tempfile) |
| 3862 | (pr-ps-file-print tempfile) | 3865 | ;; deleting |
| 3863 | ;; deleting | 3866 | (pr-delete-file tempfile)))) |
| 3864 | (pr-delete-file tempfile))))) | ||
| 3865 | 3867 | ||
| 3866 | 3868 | ||
| 3867 | ;;;###autoload | 3869 | ;;;###autoload |
| @@ -3924,24 +3926,21 @@ file name." | |||
| 3924 | (if pr-print-using-ghostscript | 3926 | (if pr-print-using-ghostscript |
| 3925 | "PS print GS" | 3927 | "PS print GS" |
| 3926 | "PS print"))) | 3928 | "PS print"))) |
| 3927 | (pr-save-interactive | 3929 | (let ((outfile (pr-ps-utility-args 'n-up 'ifilename 'ofilename |
| 3928 | (let ((outfile (pr-ps-utility-args 'n-up 'ifilename 'ofilename | 3930 | (if pr-print-using-ghostscript |
| 3929 | (if pr-print-using-ghostscript | 3931 | "PS print GS " |
| 3930 | "PS print GS " | 3932 | "PS print ")))) |
| 3931 | "PS print ")))) | 3933 | (pr-ps-utility-process n-up ifilename outfile) |
| 3932 | (pr-ps-utility-process n-up ifilename outfile) | 3934 | (unless ofilename |
| 3933 | (unless ofilename | 3935 | (pr-ps-file-ps-print outfile) |
| 3934 | (pr-ps-file-ps-print outfile) | 3936 | (pr-delete-file outfile)))) |
| 3935 | (pr-delete-file outfile))))) | ||
| 3936 | 3937 | ||
| 3937 | 3938 | ||
| 3938 | ;;;###autoload | 3939 | ;;;###autoload |
| 3939 | (defun pr-toggle-file-duplex () | 3940 | (defun pr-toggle-file-duplex () |
| 3940 | "Toggle duplex for PostScript file." | 3941 | "Toggle duplex for PostScript file." |
| 3941 | (interactive) | 3942 | (interactive) |
| 3942 | (pr-save-interactive | 3943 | (pr-toggle-file-duplex-menu t)) |
| 3943 | (pr-toggle 'pr-file-duplex "PS file duplex" nil 7 5 nil | ||
| 3944 | '("PostScript Print" "File")))) | ||
| 3945 | 3944 | ||
| 3946 | 3945 | ||
| 3947 | ;;;###autoload | 3946 | ;;;###autoload |
| @@ -3953,54 +3952,42 @@ right. | |||
| 3953 | If tumble is on, produces a printing suitable for binding at the top or | 3952 | If tumble is on, produces a printing suitable for binding at the top or |
| 3954 | bottom." | 3953 | bottom." |
| 3955 | (interactive) | 3954 | (interactive) |
| 3956 | (pr-save-interactive | 3955 | (pr-toggle-file-tumble-menu t)) |
| 3957 | (pr-toggle 'pr-file-tumble "PS file tumble" nil 8 5 nil | ||
| 3958 | '("PostScript Print" "File")))) | ||
| 3959 | 3956 | ||
| 3960 | 3957 | ||
| 3961 | ;;;###autoload | 3958 | ;;;###autoload |
| 3962 | (defun pr-toggle-file-landscape () | 3959 | (defun pr-toggle-file-landscape () |
| 3963 | "Toggle landscape for PostScript file." | 3960 | "Toggle landscape for PostScript file." |
| 3964 | (interactive) | 3961 | (interactive) |
| 3965 | (pr-save-interactive | 3962 | (pr-toggle-file-landscape-menu t)) |
| 3966 | (pr-toggle 'pr-file-landscape "PS file landscape" nil 6 5 nil | ||
| 3967 | '("PostScript Print" "File")))) | ||
| 3968 | 3963 | ||
| 3969 | 3964 | ||
| 3970 | ;;;###autoload | 3965 | ;;;###autoload |
| 3971 | (defun pr-toggle-ghostscript () | 3966 | (defun pr-toggle-ghostscript () |
| 3972 | "Toggle printing using ghostscript." | 3967 | "Toggle printing using ghostscript." |
| 3973 | (interactive) | 3968 | (interactive) |
| 3974 | (pr-save-interactive | 3969 | (pr-toggle-ghostscript-menu t)) |
| 3975 | (pr-toggle 'pr-print-using-ghostscript "Printing using ghostscript" | ||
| 3976 | 'postscript-process 2 12 'toggle))) | ||
| 3977 | 3970 | ||
| 3978 | 3971 | ||
| 3979 | ;;;###autoload | 3972 | ;;;###autoload |
| 3980 | (defun pr-toggle-faces () | 3973 | (defun pr-toggle-faces () |
| 3981 | "Toggle printing with faces." | 3974 | "Toggle printing with faces." |
| 3982 | (interactive) | 3975 | (interactive) |
| 3983 | (pr-save-interactive | 3976 | (pr-toggle-faces-menu t)) |
| 3984 | (pr-toggle 'pr-faces-p "Printing with faces" | ||
| 3985 | 'postscript-process 1 12 'toggle))) | ||
| 3986 | 3977 | ||
| 3987 | 3978 | ||
| 3988 | ;;;###autoload | 3979 | ;;;###autoload |
| 3989 | (defun pr-toggle-spool () | 3980 | (defun pr-toggle-spool () |
| 3990 | "Toggle spooling." | 3981 | "Toggle spooling." |
| 3991 | (interactive) | 3982 | (interactive) |
| 3992 | (pr-save-interactive | 3983 | (pr-toggle-spool-menu t)) |
| 3993 | (pr-toggle 'pr-spool-p "Spooling printing" | ||
| 3994 | 'postscript-process 0 12 'toggle))) | ||
| 3995 | 3984 | ||
| 3996 | 3985 | ||
| 3997 | ;;;###autoload | 3986 | ;;;###autoload |
| 3998 | (defun pr-toggle-duplex () | 3987 | (defun pr-toggle-duplex () |
| 3999 | "Toggle duplex." | 3988 | "Toggle duplex." |
| 4000 | (interactive) | 3989 | (interactive) |
| 4001 | (pr-save-interactive | 3990 | (pr-toggle-duplex-menu t)) |
| 4002 | (pr-toggle 'ps-spool-duplex "Printing duplex" | ||
| 4003 | 'postscript-options 5 12 'toggle))) | ||
| 4004 | 3991 | ||
| 4005 | 3992 | ||
| 4006 | ;;;###autoload | 3993 | ;;;###autoload |
| @@ -4012,90 +3999,70 @@ right. | |||
| 4012 | If tumble is on, produces a printing suitable for binding at the top or | 3999 | If tumble is on, produces a printing suitable for binding at the top or |
| 4013 | bottom." | 4000 | bottom." |
| 4014 | (interactive) | 4001 | (interactive) |
| 4015 | (pr-save-interactive | 4002 | (pr-toggle-tumble-menu t)) |
| 4016 | (pr-toggle 'ps-spool-tumble "Tumble" | ||
| 4017 | 'postscript-options 6 12 'toggle))) | ||
| 4018 | 4003 | ||
| 4019 | 4004 | ||
| 4020 | ;;;###autoload | 4005 | ;;;###autoload |
| 4021 | (defun pr-toggle-landscape () | 4006 | (defun pr-toggle-landscape () |
| 4022 | "Toggle landscape." | 4007 | "Toggle landscape." |
| 4023 | (interactive) | 4008 | (interactive) |
| 4024 | (pr-save-interactive | 4009 | (pr-toggle-landscape-menu t)) |
| 4025 | (pr-toggle 'ps-landscape-mode "Landscape" | ||
| 4026 | 'postscript-options 0 12 'toggle))) | ||
| 4027 | 4010 | ||
| 4028 | 4011 | ||
| 4029 | ;;;###autoload | 4012 | ;;;###autoload |
| 4030 | (defun pr-toggle-upside-down () | 4013 | (defun pr-toggle-upside-down () |
| 4031 | "Toggle upside-down." | 4014 | "Toggle upside-down." |
| 4032 | (interactive) | 4015 | (interactive) |
| 4033 | (pr-save-interactive | 4016 | (pr-toggle-upside-down-menu t)) |
| 4034 | (pr-toggle 'ps-print-upside-down "Upside-Down" | ||
| 4035 | 'postscript-options 7 12 'toggle))) | ||
| 4036 | 4017 | ||
| 4037 | 4018 | ||
| 4038 | ;;;###autoload | 4019 | ;;;###autoload |
| 4039 | (defun pr-toggle-line () | 4020 | (defun pr-toggle-line () |
| 4040 | "Toggle line number." | 4021 | "Toggle line number." |
| 4041 | (interactive) | 4022 | (interactive) |
| 4042 | (pr-save-interactive | 4023 | (pr-toggle-line-menu t)) |
| 4043 | (pr-toggle 'ps-line-number "Line number" | ||
| 4044 | 'postscript-options 3 12 'toggle))) | ||
| 4045 | 4024 | ||
| 4046 | 4025 | ||
| 4047 | ;;;###autoload | 4026 | ;;;###autoload |
| 4048 | (defun pr-toggle-zebra () | 4027 | (defun pr-toggle-zebra () |
| 4049 | "Toggle zebra stripes." | 4028 | "Toggle zebra stripes." |
| 4050 | (interactive) | 4029 | (interactive) |
| 4051 | (pr-save-interactive | 4030 | (pr-toggle-zebra-menu t)) |
| 4052 | (pr-toggle 'ps-zebra-stripes "Zebra stripe" | ||
| 4053 | 'postscript-options 4 12 'toggle))) | ||
| 4054 | 4031 | ||
| 4055 | 4032 | ||
| 4056 | ;;;###autoload | 4033 | ;;;###autoload |
| 4057 | (defun pr-toggle-header () | 4034 | (defun pr-toggle-header () |
| 4058 | "Toggle printing header." | 4035 | "Toggle printing header." |
| 4059 | (interactive) | 4036 | (interactive) |
| 4060 | (pr-save-interactive | 4037 | (pr-toggle-header-menu t)) |
| 4061 | (pr-toggle 'ps-print-header "Print header" | ||
| 4062 | 'postscript-options 1 12 'toggle))) | ||
| 4063 | 4038 | ||
| 4064 | 4039 | ||
| 4065 | ;;;###autoload | 4040 | ;;;###autoload |
| 4066 | (defun pr-toggle-header-frame () | 4041 | (defun pr-toggle-header-frame () |
| 4067 | "Toggle printing header frame." | 4042 | "Toggle printing header frame." |
| 4068 | (interactive) | 4043 | (interactive) |
| 4069 | (pr-save-interactive | 4044 | (pr-toggle-header-frame-menu t)) |
| 4070 | (pr-toggle 'ps-print-header-frame "Print header frame" | ||
| 4071 | 'postscript-options 2 12 'toggle))) | ||
| 4072 | 4045 | ||
| 4073 | 4046 | ||
| 4074 | ;;;###autoload | 4047 | ;;;###autoload |
| 4075 | (defun pr-toggle-lock () | 4048 | (defun pr-toggle-lock () |
| 4076 | "Toggle menu lock." | 4049 | "Toggle menu lock." |
| 4077 | (interactive) | 4050 | (interactive) |
| 4078 | (pr-save-interactive | 4051 | (pr-toggle-lock-menu t)) |
| 4079 | (pr-toggle 'pr-menu-lock "Menu lock" | ||
| 4080 | 'printing 2 12 'toggle))) | ||
| 4081 | 4052 | ||
| 4082 | 4053 | ||
| 4083 | ;;;###autoload | 4054 | ;;;###autoload |
| 4084 | (defun pr-toggle-region () | 4055 | (defun pr-toggle-region () |
| 4085 | "Toggle auto region." | 4056 | "Toggle auto region." |
| 4086 | (interactive) | 4057 | (interactive) |
| 4087 | (pr-save-interactive | 4058 | (pr-toggle-region-menu t)) |
| 4088 | (pr-toggle 'pr-auto-region "Auto region" | ||
| 4089 | 'printing 0 12 'toggle))) | ||
| 4090 | 4059 | ||
| 4091 | 4060 | ||
| 4092 | ;;;###autoload | 4061 | ;;;###autoload |
| 4093 | (defun pr-toggle-mode () | 4062 | (defun pr-toggle-mode () |
| 4094 | "Toggle auto mode." | 4063 | "Toggle auto mode." |
| 4095 | (interactive) | 4064 | (interactive) |
| 4096 | (pr-save-interactive | 4065 | (pr-toggle-mode-menu t)) |
| 4097 | (pr-toggle 'pr-auto-mode "Auto mode" | ||
| 4098 | 'printing 1 12 'toggle))) | ||
| 4099 | 4066 | ||
| 4100 | 4067 | ||
| 4101 | ;;;###autoload | 4068 | ;;;###autoload |
| @@ -4123,30 +4090,27 @@ bottom." | |||
| 4123 | (defun pr-ps-name () | 4090 | (defun pr-ps-name () |
| 4124 | "Interactively select a PostScript printer." | 4091 | "Interactively select a PostScript printer." |
| 4125 | (interactive) | 4092 | (interactive) |
| 4126 | (pr-save-interactive | 4093 | (pr-menu-set-ps-title |
| 4127 | (pr-menu-set-ps-title | 4094 | (pr-complete-alist "PostScript printer" |
| 4128 | (pr-complete-alist "PostScript printer" | 4095 | pr-ps-printer-alist pr-ps-name))) |
| 4129 | pr-ps-printer-alist pr-ps-name)))) | ||
| 4130 | 4096 | ||
| 4131 | 4097 | ||
| 4132 | ;;;###autoload | 4098 | ;;;###autoload |
| 4133 | (defun pr-txt-name () | 4099 | (defun pr-txt-name () |
| 4134 | "Interactively select a text printer." | 4100 | "Interactively select a text printer." |
| 4135 | (interactive) | 4101 | (interactive) |
| 4136 | (pr-save-interactive | 4102 | (pr-menu-set-txt-title |
| 4137 | (pr-menu-set-txt-title | 4103 | (pr-complete-alist "Text printer" |
| 4138 | (pr-complete-alist "Text printer" | 4104 | pr-txt-printer-alist pr-txt-name))) |
| 4139 | pr-txt-printer-alist pr-txt-name)))) | ||
| 4140 | 4105 | ||
| 4141 | 4106 | ||
| 4142 | ;;;###autoload | 4107 | ;;;###autoload |
| 4143 | (defun pr-ps-utility () | 4108 | (defun pr-ps-utility () |
| 4144 | "Interactively select a PostScript utility." | 4109 | "Interactively select a PostScript utility." |
| 4145 | (interactive) | 4110 | (interactive) |
| 4146 | (pr-save-interactive | 4111 | (pr-menu-set-utility-title |
| 4147 | (pr-menu-set-utility-title | 4112 | (pr-complete-alist "Postscript utility" |
| 4148 | (pr-complete-alist "Postscript utility" | 4113 | pr-ps-utility-alist pr-ps-utility))) |
| 4149 | pr-ps-utility-alist pr-ps-utility)))) | ||
| 4150 | 4114 | ||
| 4151 | 4115 | ||
| 4152 | ;;;###autoload | 4116 | ;;;###autoload |
| @@ -4237,29 +4201,28 @@ Note that this command always behaves as if `pr-auto-region' and `pr-auto-mode' | |||
| 4237 | are both set to t." | 4201 | are both set to t." |
| 4238 | (interactive (list (pr-interactive-n-up (pr-prompt-gs "PS print fast")) | 4202 | (interactive (list (pr-interactive-n-up (pr-prompt-gs "PS print fast")) |
| 4239 | current-prefix-arg)) | 4203 | current-prefix-arg)) |
| 4240 | (pr-save-interactive | 4204 | (let ((pr-auto-region t) |
| 4241 | (let ((pr-auto-region t) | 4205 | (pr-auto-mode t) |
| 4242 | (pr-auto-mode t) | 4206 | filename) |
| 4243 | filename) | 4207 | (cond ((null select)) |
| 4244 | (cond ((null select)) | 4208 | ((listp select) |
| 4245 | ((listp select) | 4209 | (pr-ps-name)) |
| 4246 | (pr-ps-name)) | 4210 | ((and (symbolp select) |
| 4247 | ((and (symbolp select) | 4211 | (assq select pr-ps-printer-alist)) |
| 4248 | (assq select pr-ps-printer-alist)) | 4212 | (pr-menu-set-ps-title select)) |
| 4249 | (pr-menu-set-ps-title select)) | 4213 | ((integerp select) |
| 4250 | ((integerp select) | 4214 | (and (/= select 1) |
| 4251 | (and (/= select 1) | 4215 | (pr-ps-name)) |
| 4252 | (pr-ps-name)) | 4216 | (and (>= select 1) (not pr-spool-p) |
| 4253 | (and (>= select 1) (not pr-spool-p) | 4217 | (setq filename (pr-ps-outfile-preprint |
| 4254 | (setq filename (pr-ps-outfile-preprint | 4218 | (if pr-print-using-ghostscript |
| 4255 | (if pr-print-using-ghostscript | 4219 | "Fast GS " |
| 4256 | "Fast GS " | 4220 | "Fast ")))))) |
| 4257 | "Fast ")))))) | 4221 | (pr-ps-buffer-ps-print |
| 4258 | (pr-ps-buffer-ps-print | 4222 | (if (integerp n-up) |
| 4259 | (if (integerp n-up) | 4223 | (min (max n-up 1) 100) |
| 4260 | (min (max n-up 1) 100) | 4224 | (error "n-up must be an integer greater than zero")) |
| 4261 | (error "n-up must be an integer greater than zero")) | 4225 | filename))) |
| 4262 | filename)))) | ||
| 4263 | 4226 | ||
| 4264 | 4227 | ||
| 4265 | ;;;###autoload | 4228 | ;;;###autoload |
| @@ -4287,16 +4250,15 @@ Noninteractively, the argument SELECT-PRINTER is treated as follows: | |||
| 4287 | Note that this command always behaves as if `pr-auto-region' and `pr-auto-mode' | 4250 | Note that this command always behaves as if `pr-auto-region' and `pr-auto-mode' |
| 4288 | are both set to t." | 4251 | are both set to t." |
| 4289 | (interactive (list current-prefix-arg)) | 4252 | (interactive (list current-prefix-arg)) |
| 4290 | (pr-save-interactive | 4253 | (cond ((null select-printer)) |
| 4291 | (cond ((null select-printer)) | 4254 | ((and (symbolp select-printer) |
| 4292 | ((and (symbolp select-printer) | 4255 | (assq select-printer pr-txt-printer-alist)) |
| 4293 | (assq select-printer pr-txt-printer-alist)) | 4256 | (pr-menu-set-txt-title select-printer)) |
| 4294 | (pr-menu-set-txt-title select-printer)) | 4257 | (t |
| 4295 | (t | 4258 | (pr-txt-name))) |
| 4296 | (pr-txt-name))) | 4259 | (let ((pr-auto-region t) |
| 4297 | (let ((pr-auto-region t) | 4260 | (pr-auto-mode t)) |
| 4298 | (pr-auto-mode t)) | 4261 | (pr-txt-buffer))) |
| 4299 | (pr-txt-buffer)))) | ||
| 4300 | 4262 | ||
| 4301 | 4263 | ||
| 4302 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 4264 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| @@ -4645,90 +4607,88 @@ See `pr-visible-entry-alist'.") | |||
| 4645 | (defvar pr-menu-state nil) | 4607 | (defvar pr-menu-state nil) |
| 4646 | 4608 | ||
| 4647 | 4609 | ||
| 4648 | (eval-and-compile | 4610 | (cond |
| 4649 | (cond | 4611 | ((featurep 'xemacs) |
| 4650 | ((eq ps-print-emacs-type 'xemacs) | 4612 | ;; XEmacs |
| 4651 | ;; XEmacs | 4613 | (defvar current-mouse-event nil) ; to avoid compilation gripes |
| 4652 | (defvar current-mouse-event nil) ; to avoid compilation gripes | 4614 | (defun pr-menu-position (entry index horizontal) |
| 4653 | (defun pr-menu-position (entry index horizontal) | 4615 | (pr-x-make-event |
| 4654 | (pr-x-make-event | 4616 | 'button-release |
| 4655 | 'button-release | 4617 | (list 'button 1 |
| 4656 | (list 'button 1 | 4618 | 'x (- (pr-x-event-x-pixel current-mouse-event) ; X |
| 4657 | 'x (- (pr-x-event-x-pixel current-mouse-event) ; X | 4619 | (* horizontal pr-menu-char-width)) |
| 4658 | (* horizontal pr-menu-char-width)) | 4620 | 'y (- (pr-x-event-y-pixel current-mouse-event) ; Y |
| 4659 | 'y (- (pr-x-event-y-pixel current-mouse-event) ; Y | 4621 | (* (pr-menu-index entry index) pr-menu-char-height))))) |
| 4660 | (* (pr-menu-index entry index) pr-menu-char-height))))) | 4622 | ) |
| 4661 | ) | 4623 | (ps-windows-system |
| 4662 | (ps-windows-system | 4624 | ;; GNU Emacs for Windows 9x/NT |
| 4663 | ;; GNU Emacs for Windows 9x/NT | 4625 | (defun pr-menu-position (entry index horizontal) |
| 4664 | (defun pr-menu-position (entry index horizontal) | 4626 | (let ((pos (cdr (pr-e-mouse-pixel-position)))) |
| 4665 | (let ((pos (cdr (pr-e-mouse-pixel-position)))) | 4627 | (list |
| 4666 | (list | 4628 | (list (or (car pos) 0) ; X |
| 4667 | (list (or (car pos) 0) ; X | 4629 | (- (or (cdr pos) 0) ; Y |
| 4668 | (- (or (cdr pos) 0) ; Y | 4630 | (* (pr-menu-index entry index) pr-menu-char-height))) |
| 4669 | (* (pr-menu-index entry index) pr-menu-char-height))) | 4631 | (selected-frame)))) ; frame |
| 4670 | (selected-frame)))) ; frame | 4632 | ) |
| 4671 | ) | 4633 | (t |
| 4672 | (t | 4634 | ;; GNU Emacs |
| 4673 | ;; GNU Emacs | 4635 | (defun pr-menu-position (entry index horizontal) |
| 4674 | (defun pr-menu-position (entry index horizontal) | 4636 | (let ((pos (cdr (pr-e-mouse-pixel-position)))) |
| 4675 | (let ((pos (cdr (pr-e-mouse-pixel-position)))) | 4637 | (list |
| 4676 | (list | 4638 | (list (- (or (car pos) 0) ; X |
| 4677 | (list (- (or (car pos) 0) ; X | 4639 | (* horizontal pr-menu-char-width)) |
| 4678 | (* horizontal pr-menu-char-width)) | 4640 | (- (or (cdr pos) 0) ; Y |
| 4679 | (- (or (cdr pos) 0) ; Y | 4641 | (* (pr-menu-index entry index) pr-menu-char-height))) |
| 4680 | (* (pr-menu-index entry index) pr-menu-char-height))) | 4642 | (selected-frame)))) ; frame |
| 4681 | (selected-frame)))) ; frame | 4643 | )) |
| 4682 | )) | 4644 | |
| 4645 | (cond | ||
| 4646 | ((featurep 'xemacs) | ||
| 4647 | ;; XEmacs | ||
| 4648 | (defvar current-menubar nil) ; to avoid compilation gripes | ||
| 4649 | (defun pr-menu-lookup (path) | ||
| 4650 | (car (pr-x-find-menu-item current-menubar (cons "Printing" path)))) | ||
| 4683 | 4651 | ||
| 4684 | (cond | 4652 | ;; XEmacs |
| 4685 | ((eq ps-print-emacs-type 'emacs) | 4653 | (defun pr-menu-lock (entry index horizontal state path) |
| 4686 | ;; GNU Emacs | 4654 | (when pr-menu-lock |
| 4687 | (defun pr-menu-lookup (path) | 4655 | (or (and pr-menu-position (eq state pr-menu-state)) |
| 4688 | (let ((ipath pr-menu-bar)) | 4656 | (setq pr-menu-position (pr-menu-position entry index horizontal) |
| 4689 | (lookup-key global-map | 4657 | pr-menu-state state)) |
| 4690 | (if path | 4658 | (let* ((menu (pr-menu-lookup path)) |
| 4691 | (vconcat ipath | 4659 | (result (pr-x-get-popup-menu-response menu pr-menu-position))) |
| 4692 | (mapcar 'pr-get-symbol | 4660 | (and (pr-x-misc-user-event-p result) |
| 4693 | (if (listp path) | 4661 | (funcall (pr-x-event-function result) |
| 4694 | path | 4662 | (pr-x-event-object result)))) |
| 4695 | (list path)))) | 4663 | (setq pr-menu-position nil)))) |
| 4696 | ipath)))) | 4664 | |
| 4697 | 4665 | ||
| 4698 | ;; GNU Emacs | 4666 | (t |
| 4699 | (defun pr-menu-lock (entry index horizontal state path) | 4667 | ;; GNU Emacs |
| 4700 | (when (and (not pr-interactive-p) pr-menu-lock) | 4668 | (defun pr-menu-lookup (path) |
| 4701 | (or (and pr-menu-position (eq state pr-menu-state)) | 4669 | (lookup-key global-map |
| 4702 | (setq pr-menu-position (pr-menu-position entry index horizontal) | 4670 | (if path |
| 4703 | pr-menu-state state)) | 4671 | (vconcat pr-menu-bar |
| 4704 | (let* ((menu (pr-menu-lookup path)) | 4672 | (mapcar 'pr-get-symbol |
| 4705 | (result (x-popup-menu pr-menu-position menu))) | 4673 | (if (listp path) |
| 4706 | (and result | 4674 | path |
| 4707 | (let ((command (lookup-key menu (vconcat result)))) | 4675 | (list path)))) |
| 4708 | (if (fboundp command) | 4676 | pr-menu-bar))) |
| 4709 | (funcall command) | 4677 | |
| 4710 | (eval command))))) | 4678 | ;; GNU Emacs |
| 4711 | (setq pr-menu-position nil)))) | 4679 | (defun pr-menu-lock (entry index horizontal state path) |
| 4712 | 4680 | (when pr-menu-lock | |
| 4713 | 4681 | (or (and pr-menu-position (eq state pr-menu-state)) | |
| 4714 | ((eq ps-print-emacs-type 'xemacs) | 4682 | (setq pr-menu-position (pr-menu-position entry index horizontal) |
| 4715 | ;; XEmacs | 4683 | pr-menu-state state)) |
| 4716 | (defvar current-menubar nil) ; to avoid compilation gripes | 4684 | (let* ((menu (pr-menu-lookup path)) |
| 4717 | (defun pr-menu-lookup (path) | 4685 | (result (x-popup-menu pr-menu-position menu))) |
| 4718 | (car (pr-x-find-menu-item current-menubar (cons "Printing" path)))) | 4686 | (and result |
| 4719 | 4687 | (let ((command (lookup-key menu (vconcat result)))) | |
| 4720 | ;; XEmacs | 4688 | (if (fboundp command) |
| 4721 | (defun pr-menu-lock (entry index horizontal state path) | 4689 | (funcall command) |
| 4722 | (when (and (not pr-interactive-p) pr-menu-lock) | 4690 | (eval command))))) |
| 4723 | (or (and pr-menu-position (eq state pr-menu-state)) | 4691 | (setq pr-menu-position nil))))) |
| 4724 | (setq pr-menu-position (pr-menu-position entry index horizontal) | ||
| 4725 | pr-menu-state state)) | ||
| 4726 | (let* ((menu (pr-menu-lookup path)) | ||
| 4727 | (result (pr-x-get-popup-menu-response menu pr-menu-position))) | ||
| 4728 | (and (pr-x-misc-user-event-p result) | ||
| 4729 | (funcall (pr-x-event-function result) | ||
| 4730 | (pr-x-event-object result)))) | ||
| 4731 | (setq pr-menu-position nil)))))) | ||
| 4732 | 4692 | ||
| 4733 | 4693 | ||
| 4734 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 4694 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| @@ -4750,11 +4710,10 @@ non-nil, update text printer menu iff `pr-txt-printer-menu-modified' is | |||
| 4750 | non-nil, and update PostScript File menus iff `pr-ps-utility-menu-modified' is | 4710 | non-nil, and update PostScript File menus iff `pr-ps-utility-menu-modified' is |
| 4751 | non-nil." | 4711 | non-nil." |
| 4752 | (interactive "P") | 4712 | (interactive "P") |
| 4753 | (pr-save-interactive | 4713 | (pr-update-var 'pr-ps-name pr-ps-printer-alist) |
| 4754 | (pr-update-var 'pr-ps-name pr-ps-printer-alist) | 4714 | (pr-update-var 'pr-txt-name pr-txt-printer-alist) |
| 4755 | (pr-update-var 'pr-txt-name pr-txt-printer-alist) | 4715 | (pr-update-var 'pr-ps-utility pr-ps-utility-alist) |
| 4756 | (pr-update-var 'pr-ps-utility pr-ps-utility-alist) | 4716 | (pr-do-update-menus force)) |
| 4757 | (pr-do-update-menus force))) | ||
| 4758 | 4717 | ||
| 4759 | 4718 | ||
| 4760 | (defvar pr-ps-printer-menu-modified t | 4719 | (defvar pr-ps-printer-menu-modified t |
| @@ -4786,252 +4745,235 @@ non-nil." | |||
| 4786 | alist))) | 4745 | alist))) |
| 4787 | 4746 | ||
| 4788 | 4747 | ||
| 4789 | (eval-and-compile | 4748 | (cond |
| 4790 | (cond | 4749 | ((featurep 'xemacs) |
| 4791 | ((eq ps-print-emacs-type 'emacs) | 4750 | ;; XEmacs |
| 4792 | ;; GNU Emacs | 4751 | (defalias 'pr-update-mode-line 'set-menubar-dirty-flag) |
| 4793 | (defalias 'pr-update-mode-line 'force-mode-line-update) | 4752 | |
| 4794 | 4753 | ;; XEmacs | |
| 4795 | ;; GNU Emacs | 4754 | (defvar pr-ps-name-old "PostScript Printers") |
| 4796 | (defun pr-do-update-menus (&optional force) | 4755 | (defvar pr-txt-name-old "Text Printers") |
| 4797 | (pr-menu-alist pr-ps-printer-alist | 4756 | (defvar pr-ps-utility-old "PostScript Utility") |
| 4798 | 'pr-ps-name | 4757 | (defvar pr-even-or-odd-old "Print All Pages") |
| 4799 | 'pr-menu-set-ps-title | 4758 | |
| 4800 | "PostScript Printers" | 4759 | ;; XEmacs |
| 4801 | 'pr-ps-printer-menu-modified | 4760 | (defun pr-do-update-menus (&optional force) |
| 4802 | force | 4761 | (pr-menu-alist pr-ps-printer-alist |
| 4803 | "PostScript Printers" | 4762 | 'pr-ps-name |
| 4804 | 'postscript 2) | 4763 | 'pr-menu-set-ps-title |
| 4805 | (pr-menu-alist pr-txt-printer-alist | 4764 | '("Printing") |
| 4806 | 'pr-txt-name | 4765 | 'pr-ps-printer-menu-modified |
| 4807 | 'pr-menu-set-txt-title | 4766 | force |
| 4808 | "Text Printers" | 4767 | pr-ps-name-old |
| 4809 | 'pr-txt-printer-menu-modified | 4768 | 'postscript 2) |
| 4810 | force | 4769 | (pr-menu-alist pr-txt-printer-alist |
| 4811 | "Text Printers" | 4770 | 'pr-txt-name |
| 4812 | 'text 2) | 4771 | 'pr-menu-set-txt-title |
| 4813 | (let ((save-var pr-ps-utility-menu-modified)) | 4772 | '("Printing") |
| 4814 | (pr-menu-alist pr-ps-utility-alist | 4773 | 'pr-txt-printer-menu-modified |
| 4815 | 'pr-ps-utility | 4774 | force |
| 4816 | 'pr-menu-set-utility-title | 4775 | pr-txt-name-old |
| 4817 | '("PostScript Print" "File" "PostScript Utility") | 4776 | 'text 2) |
| 4818 | 'save-var | 4777 | (let ((save-var pr-ps-utility-menu-modified)) |
| 4819 | force | ||
| 4820 | "PostScript Utility" | ||
| 4821 | nil 1)) | ||
| 4822 | (pr-menu-alist pr-ps-utility-alist | 4778 | (pr-menu-alist pr-ps-utility-alist |
| 4823 | 'pr-ps-utility | 4779 | 'pr-ps-utility |
| 4824 | 'pr-menu-set-utility-title | 4780 | 'pr-menu-set-utility-title |
| 4825 | '("PostScript Preview" "File" "PostScript Utility") | 4781 | '("Printing" "PostScript Print" "File") |
| 4826 | 'pr-ps-utility-menu-modified | 4782 | 'save-var |
| 4827 | force | ||
| 4828 | "PostScript Utility" | ||
| 4829 | nil 1) | ||
| 4830 | (pr-even-or-odd-pages ps-even-or-odd-pages force)) | ||
| 4831 | |||
| 4832 | ;; GNU Emacs | ||
| 4833 | (defvar pr-temp-menu nil) | ||
| 4834 | |||
| 4835 | ;; GNU Emacs | ||
| 4836 | (defun pr-menu-alist (alist var-sym fun menu-path modified-sym force name | ||
| 4837 | entry index) | ||
| 4838 | (when (and alist (or force (symbol-value modified-sym))) | ||
| 4839 | (easy-menu-define pr-temp-menu nil "" | ||
| 4840 | (pr-menu-create name alist var-sym fun entry index)) | ||
| 4841 | (let ((item (pr-menu-get-item menu-path))) | ||
| 4842 | (and item | ||
| 4843 | (let* ((binding (nthcdr 3 item)) | ||
| 4844 | (key-binding (cdr binding))) | ||
| 4845 | (setcar binding pr-temp-menu) | ||
| 4846 | (and key-binding (listp (car key-binding)) | ||
| 4847 | (setcdr binding (cdr key-binding))) ; skip KEY-BINDING | ||
| 4848 | (funcall fun (symbol-value var-sym) item)))) | ||
| 4849 | (set modified-sym nil))) | ||
| 4850 | |||
| 4851 | ;; GNU Emacs | ||
| 4852 | (defun pr-menu-set-ps-title (value &optional item entry index) | ||
| 4853 | (pr-menu-set-item-name (or item | ||
| 4854 | (pr-menu-get-item "PostScript Printers")) | ||
| 4855 | (format "PostScript Printer: %s" value)) | ||
| 4856 | (pr-ps-set-printer value) | ||
| 4857 | (and index | ||
| 4858 | (pr-menu-lock entry index 12 'toggle nil))) | ||
| 4859 | |||
| 4860 | ;; GNU Emacs | ||
| 4861 | (defun pr-menu-set-txt-title (value &optional item entry index) | ||
| 4862 | (pr-menu-set-item-name (or item | ||
| 4863 | (pr-menu-get-item "Text Printers")) | ||
| 4864 | (format "Text Printer: %s" value)) | ||
| 4865 | (pr-txt-set-printer value) | ||
| 4866 | (and index | ||
| 4867 | (pr-menu-lock entry index 12 'toggle nil))) | ||
| 4868 | |||
| 4869 | ;; GNU Emacs | ||
| 4870 | (defun pr-menu-set-utility-title (value &optional item entry index) | ||
| 4871 | (let ((name (symbol-name value))) | ||
| 4872 | (if item | ||
| 4873 | (pr-menu-set-item-name item name) | ||
| 4874 | (pr-menu-set-item-name | ||
| 4875 | (pr-menu-get-item | ||
| 4876 | '("PostScript Print" "File" "PostScript Utility")) | ||
| 4877 | name) | ||
| 4878 | (pr-menu-set-item-name | ||
| 4879 | (pr-menu-get-item | ||
| 4880 | '("PostScript Preview" "File" "PostScript Utility")) | ||
| 4881 | name))) | ||
| 4882 | (pr-ps-set-utility value) | ||
| 4883 | (and index | ||
| 4884 | (pr-menu-lock entry index 5 nil '("PostScript Print" "File")))) | ||
| 4885 | |||
| 4886 | ;; GNU Emacs | ||
| 4887 | (defun pr-even-or-odd-pages (value &optional no-lock) | ||
| 4888 | (pr-menu-set-item-name (pr-menu-get-item "Print All Pages") | ||
| 4889 | (cdr (assq value pr-even-or-odd-alist))) | ||
| 4890 | (setq ps-even-or-odd-pages value) | ||
| 4891 | (or no-lock | ||
| 4892 | (pr-menu-lock 'postscript-options 8 12 'toggle nil)))) | ||
| 4893 | |||
| 4894 | |||
| 4895 | ((eq ps-print-emacs-type 'xemacs) | ||
| 4896 | ;; XEmacs | ||
| 4897 | (defalias 'pr-update-mode-line 'set-menubar-dirty-flag) | ||
| 4898 | |||
| 4899 | ;; XEmacs | ||
| 4900 | (defvar pr-ps-name-old "PostScript Printers") | ||
| 4901 | (defvar pr-txt-name-old "Text Printers") | ||
| 4902 | (defvar pr-ps-utility-old "PostScript Utility") | ||
| 4903 | (defvar pr-even-or-odd-old "Print All Pages") | ||
| 4904 | |||
| 4905 | ;; XEmacs | ||
| 4906 | (defun pr-do-update-menus (&optional force) | ||
| 4907 | (pr-menu-alist pr-ps-printer-alist | ||
| 4908 | 'pr-ps-name | ||
| 4909 | 'pr-menu-set-ps-title | ||
| 4910 | '("Printing") | ||
| 4911 | 'pr-ps-printer-menu-modified | ||
| 4912 | force | 4783 | force |
| 4913 | pr-ps-name-old | 4784 | pr-ps-utility-old |
| 4914 | 'postscript 2) | 4785 | nil 1)) |
| 4915 | (pr-menu-alist pr-txt-printer-alist | 4786 | (pr-menu-alist pr-ps-utility-alist |
| 4916 | 'pr-txt-name | 4787 | 'pr-ps-utility |
| 4917 | 'pr-menu-set-txt-title | 4788 | 'pr-menu-set-utility-title |
| 4918 | '("Printing") | 4789 | '("Printing" "PostScript Preview" "File") |
| 4919 | 'pr-txt-printer-menu-modified | 4790 | 'pr-ps-utility-menu-modified |
| 4920 | force | 4791 | force |
| 4921 | pr-txt-name-old | 4792 | pr-ps-utility-old |
| 4922 | 'text 2) | 4793 | nil 1) |
| 4923 | (let ((save-var pr-ps-utility-menu-modified)) | 4794 | (pr-even-or-odd-pages ps-even-or-odd-pages force)) |
| 4924 | (pr-menu-alist pr-ps-utility-alist | 4795 | |
| 4925 | 'pr-ps-utility | 4796 | ;; XEmacs |
| 4926 | 'pr-menu-set-utility-title | 4797 | (defun pr-menu-alist (alist var-sym fun menu-path modified-sym force name |
| 4927 | '("Printing" "PostScript Print" "File") | 4798 | entry index) |
| 4928 | 'save-var | 4799 | (when (and alist (or force (symbol-value modified-sym))) |
| 4929 | force | 4800 | (pr-xemacs-global-menubar |
| 4930 | pr-ps-utility-old | 4801 | (pr-x-add-submenu menu-path |
| 4931 | nil 1)) | 4802 | (pr-menu-create name alist var-sym |
| 4803 | fun entry index))) | ||
| 4804 | (funcall fun (symbol-value var-sym)) | ||
| 4805 | (set modified-sym nil))) | ||
| 4806 | |||
| 4807 | ;; XEmacs | ||
| 4808 | (defun pr-relabel-menu-item (newname var-sym) | ||
| 4809 | (pr-xemacs-global-menubar | ||
| 4810 | (pr-x-relabel-menu-item | ||
| 4811 | (list "Printing" (symbol-value var-sym)) | ||
| 4812 | newname) | ||
| 4813 | (set var-sym newname))) | ||
| 4814 | |||
| 4815 | ;; XEmacs | ||
| 4816 | (defun pr-menu-set-ps-title (value &optional item entry index) | ||
| 4817 | (pr-relabel-menu-item (format "PostScript Printer: %s" value) | ||
| 4818 | 'pr-ps-name-old) | ||
| 4819 | (pr-ps-set-printer value) | ||
| 4820 | (and index | ||
| 4821 | (pr-menu-lock entry index 12 'toggle nil))) | ||
| 4822 | |||
| 4823 | ;; XEmacs | ||
| 4824 | (defun pr-menu-set-txt-title (value &optional item entry index) | ||
| 4825 | (pr-relabel-menu-item (format "Text Printer: %s" value) | ||
| 4826 | 'pr-txt-name-old) | ||
| 4827 | (pr-txt-set-printer value) | ||
| 4828 | (and index | ||
| 4829 | (pr-menu-lock entry index 12 'toggle nil))) | ||
| 4830 | |||
| 4831 | ;; XEmacs | ||
| 4832 | (defun pr-menu-set-utility-title (value &optional item entry index) | ||
| 4833 | (pr-xemacs-global-menubar | ||
| 4834 | (let ((newname (format "%s" value))) | ||
| 4835 | (pr-x-relabel-menu-item | ||
| 4836 | (list "Printing" "PostScript Print" "File" pr-ps-utility-old) | ||
| 4837 | newname) | ||
| 4838 | (pr-x-relabel-menu-item | ||
| 4839 | (list "Printing" "PostScript Preview" "File" pr-ps-utility-old) | ||
| 4840 | newname) | ||
| 4841 | (setq pr-ps-utility-old newname))) | ||
| 4842 | (pr-ps-set-utility value) | ||
| 4843 | (and index | ||
| 4844 | (pr-menu-lock entry index 5 nil '("PostScript Print" "File")))) | ||
| 4845 | |||
| 4846 | ;; XEmacs | ||
| 4847 | (defun pr-even-or-odd-pages (value &optional no-lock) | ||
| 4848 | (pr-relabel-menu-item (cdr (assq value pr-even-or-odd-alist)) | ||
| 4849 | 'pr-even-or-odd-old) | ||
| 4850 | (setq ps-even-or-odd-pages value) | ||
| 4851 | (or no-lock | ||
| 4852 | (pr-menu-lock 'postscript-options 8 12 'toggle nil)))) | ||
| 4853 | |||
| 4854 | |||
| 4855 | (t | ||
| 4856 | ;; GNU Emacs | ||
| 4857 | (defalias 'pr-update-mode-line 'force-mode-line-update) | ||
| 4858 | |||
| 4859 | ;; GNU Emacs | ||
| 4860 | (defun pr-do-update-menus (&optional force) | ||
| 4861 | (pr-menu-alist pr-ps-printer-alist | ||
| 4862 | 'pr-ps-name | ||
| 4863 | 'pr-menu-set-ps-title | ||
| 4864 | "PostScript Printers" | ||
| 4865 | 'pr-ps-printer-menu-modified | ||
| 4866 | force | ||
| 4867 | "PostScript Printers" | ||
| 4868 | 'postscript 2) | ||
| 4869 | (pr-menu-alist pr-txt-printer-alist | ||
| 4870 | 'pr-txt-name | ||
| 4871 | 'pr-menu-set-txt-title | ||
| 4872 | "Text Printers" | ||
| 4873 | 'pr-txt-printer-menu-modified | ||
| 4874 | force | ||
| 4875 | "Text Printers" | ||
| 4876 | 'text 2) | ||
| 4877 | (let ((save-var pr-ps-utility-menu-modified)) | ||
| 4932 | (pr-menu-alist pr-ps-utility-alist | 4878 | (pr-menu-alist pr-ps-utility-alist |
| 4933 | 'pr-ps-utility | 4879 | 'pr-ps-utility |
| 4934 | 'pr-menu-set-utility-title | 4880 | 'pr-menu-set-utility-title |
| 4935 | '("Printing" "PostScript Preview" "File") | 4881 | '("PostScript Print" "File" "PostScript Utility") |
| 4936 | 'pr-ps-utility-menu-modified | 4882 | 'save-var |
| 4937 | force | 4883 | force |
| 4938 | pr-ps-utility-old | 4884 | "PostScript Utility" |
| 4939 | nil 1) | 4885 | nil 1)) |
| 4940 | (pr-even-or-odd-pages ps-even-or-odd-pages force)) | 4886 | (pr-menu-alist pr-ps-utility-alist |
| 4941 | 4887 | 'pr-ps-utility | |
| 4942 | ;; XEmacs | 4888 | 'pr-menu-set-utility-title |
| 4943 | (defun pr-menu-alist (alist var-sym fun menu-path modified-sym force name | 4889 | '("PostScript Preview" "File" "PostScript Utility") |
| 4944 | entry index) | 4890 | 'pr-ps-utility-menu-modified |
| 4945 | (when (and alist (or force (symbol-value modified-sym))) | 4891 | force |
| 4946 | (pr-xemacs-global-menubar | 4892 | "PostScript Utility" |
| 4947 | (pr-x-add-submenu menu-path | 4893 | nil 1) |
| 4948 | (pr-menu-create name alist var-sym | 4894 | (pr-even-or-odd-pages ps-even-or-odd-pages force)) |
| 4949 | fun entry index))) | ||
| 4950 | (funcall fun (symbol-value var-sym)) | ||
| 4951 | (set modified-sym nil))) | ||
| 4952 | |||
| 4953 | ;; XEmacs | ||
| 4954 | (defun pr-menu-set-ps-title (value &optional item entry index) | ||
| 4955 | (pr-relabel-menu-item (format "PostScript Printer: %s" value) | ||
| 4956 | 'pr-ps-name-old) | ||
| 4957 | (pr-ps-set-printer value) | ||
| 4958 | (and index | ||
| 4959 | (pr-menu-lock entry index 12 'toggle nil))) | ||
| 4960 | |||
| 4961 | ;; XEmacs | ||
| 4962 | (defun pr-menu-set-txt-title (value &optional item entry index) | ||
| 4963 | (pr-relabel-menu-item (format "Text Printer: %s" value) | ||
| 4964 | 'pr-txt-name-old) | ||
| 4965 | (pr-txt-set-printer value) | ||
| 4966 | (and index | ||
| 4967 | (pr-menu-lock entry index 12 'toggle nil))) | ||
| 4968 | |||
| 4969 | ;; XEmacs | ||
| 4970 | (defun pr-menu-set-utility-title (value &optional item entry index) | ||
| 4971 | (pr-xemacs-global-menubar | ||
| 4972 | (let ((newname (format "%s" value))) | ||
| 4973 | (pr-x-relabel-menu-item | ||
| 4974 | (list "Printing" "PostScript Print" "File" pr-ps-utility-old) | ||
| 4975 | newname) | ||
| 4976 | (pr-x-relabel-menu-item | ||
| 4977 | (list "Printing" "PostScript Preview" "File" pr-ps-utility-old) | ||
| 4978 | newname) | ||
| 4979 | (setq pr-ps-utility-old newname))) | ||
| 4980 | (pr-ps-set-utility value) | ||
| 4981 | (and index | ||
| 4982 | (pr-menu-lock entry index 5 nil '("PostScript Print" "File")))) | ||
| 4983 | |||
| 4984 | ;; XEmacs | ||
| 4985 | (defun pr-even-or-odd-pages (value &optional no-lock) | ||
| 4986 | (pr-relabel-menu-item (cdr (assq value pr-even-or-odd-alist)) | ||
| 4987 | 'pr-even-or-odd-old) | ||
| 4988 | (setq ps-even-or-odd-pages value) | ||
| 4989 | (or no-lock | ||
| 4990 | (pr-menu-lock 'postscript-options 8 12 'toggle nil)))))) | ||
| 4991 | 4895 | ||
| 4992 | ;; XEmacs | 4896 | ;; GNU Emacs |
| 4993 | (defun pr-relabel-menu-item (newname var-sym) | 4897 | (defun pr-menu-get-item (name-list) |
| 4994 | (pr-xemacs-global-menubar | 4898 | ;; NAME-LIST is a string or a list of strings. |
| 4995 | (pr-x-relabel-menu-item | 4899 | (or (listp name-list) |
| 4996 | (list "Printing" (symbol-value var-sym)) | 4900 | (setq name-list (list name-list))) |
| 4997 | newname) | 4901 | (and name-list |
| 4998 | (set var-sym newname))) | 4902 | (let* ((reversed (reverse name-list)) |
| 4903 | (name (pr-get-symbol (car reversed))) | ||
| 4904 | (path (nreverse (cdr reversed))) | ||
| 4905 | (menu (lookup-key | ||
| 4906 | global-map | ||
| 4907 | (vconcat pr-menu-bar | ||
| 4908 | (mapcar 'pr-get-symbol path))))) | ||
| 4909 | (assq name (nthcdr 2 menu))))) | ||
| 4999 | 4910 | ||
| 5000 | ;; GNU Emacs | 4911 | ;; GNU Emacs |
| 5001 | (defun pr-menu-set-item-name (item name) | 4912 | (defvar pr-temp-menu nil) |
| 5002 | (and item | ||
| 5003 | (setcar (nthcdr 2 item) name))) ; ITEM-NAME | ||
| 5004 | 4913 | ||
| 5005 | ;; GNU Emacs | 4914 | ;; GNU Emacs |
| 5006 | (defun pr-menu-get-item (name-list) | 4915 | (defun pr-menu-alist (alist var-sym fun menu-path modified-sym force name |
| 5007 | ;; NAME-LIST is a string or a list of strings. | 4916 | entry index) |
| 5008 | (let ((ipath pr-menu-bar) | 4917 | (when (and alist (or force (symbol-value modified-sym))) |
| 5009 | (len (and (listp name-list) (length name-list)))) | 4918 | (easy-menu-define pr-temp-menu nil "" |
| 5010 | (and len (= len 1) | 4919 | (pr-menu-create name alist var-sym fun entry index)) |
| 5011 | (setq name-list (car name-list))) | 4920 | (let ((item (pr-menu-get-item menu-path))) |
| 5012 | (cond | 4921 | (and item |
| 5013 | ((null name-list) | 4922 | (let* ((binding (nthcdr 3 item)) |
| 5014 | ;; nil | 4923 | (key-binding (cdr binding))) |
| 5015 | nil) | 4924 | (setcar binding pr-temp-menu) |
| 5016 | ((listp name-list) | 4925 | (and key-binding (listp (car key-binding)) |
| 5017 | ;; list and (length list) > 1 | 4926 | (setcdr binding (cdr key-binding))) ; skip KEY-BINDING |
| 5018 | (let* ((copy (copy-sequence name-list)) | 4927 | (funcall fun (symbol-value var-sym) item)))) |
| 5019 | (name (pr-get-symbol (nth (1- len) copy))) | 4928 | (set modified-sym nil))) |
| 5020 | (path (progn | 4929 | |
| 5021 | (setcdr (nthcdr (- len 2) copy) nil) | 4930 | ;; GNU Emacs |
| 5022 | copy)) | 4931 | (defun pr-menu-set-item-name (item name) |
| 5023 | (menu (lookup-key | 4932 | (and item |
| 5024 | global-map | 4933 | (setcar (nthcdr 2 item) name))) ; ITEM-NAME |
| 5025 | (if path | 4934 | |
| 5026 | (vconcat ipath | 4935 | ;; GNU Emacs |
| 5027 | (mapcar 'pr-get-symbol path)) | 4936 | (defun pr-menu-set-ps-title (value &optional item entry index) |
| 5028 | ipath)))) | 4937 | (pr-menu-set-item-name (or item |
| 5029 | (assq name (nthcdr 2 menu)))) | 4938 | (pr-menu-get-item "PostScript Printers")) |
| 5030 | (t | 4939 | (format "PostScript Printer: %s" value)) |
| 5031 | ;; string | 4940 | (pr-ps-set-printer value) |
| 5032 | (let ((name (pr-get-symbol name-list)) | 4941 | (and index |
| 5033 | (menu (lookup-key global-map ipath))) | 4942 | (pr-menu-lock entry index 12 'toggle nil))) |
| 5034 | (assq name (nthcdr 2 menu))))))) | 4943 | |
| 4944 | ;; GNU Emacs | ||
| 4945 | (defun pr-menu-set-txt-title (value &optional item entry index) | ||
| 4946 | (pr-menu-set-item-name (or item | ||
| 4947 | (pr-menu-get-item "Text Printers")) | ||
| 4948 | (format "Text Printer: %s" value)) | ||
| 4949 | (pr-txt-set-printer value) | ||
| 4950 | (and index | ||
| 4951 | (pr-menu-lock entry index 12 'toggle nil))) | ||
| 4952 | |||
| 4953 | ;; GNU Emacs | ||
| 4954 | (defun pr-menu-set-utility-title (value &optional item entry index) | ||
| 4955 | (let ((name (symbol-name value))) | ||
| 4956 | (if item | ||
| 4957 | (pr-menu-set-item-name item name) | ||
| 4958 | (pr-menu-set-item-name | ||
| 4959 | (pr-menu-get-item | ||
| 4960 | '("PostScript Print" "File" "PostScript Utility")) | ||
| 4961 | name) | ||
| 4962 | (pr-menu-set-item-name | ||
| 4963 | (pr-menu-get-item | ||
| 4964 | '("PostScript Preview" "File" "PostScript Utility")) | ||
| 4965 | name))) | ||
| 4966 | (pr-ps-set-utility value) | ||
| 4967 | (and index | ||
| 4968 | (pr-menu-lock entry index 5 nil '("PostScript Print" "File")))) | ||
| 4969 | |||
| 4970 | ;; GNU Emacs | ||
| 4971 | (defun pr-even-or-odd-pages (value &optional no-lock) | ||
| 4972 | (pr-menu-set-item-name (pr-menu-get-item "Print All Pages") | ||
| 4973 | (cdr (assq value pr-even-or-odd-alist))) | ||
| 4974 | (setq ps-even-or-odd-pages value) | ||
| 4975 | (or no-lock | ||
| 4976 | (pr-menu-lock 'postscript-options 8 12 'toggle nil))))) | ||
| 5035 | 4977 | ||
| 5036 | 4978 | ||
| 5037 | (defun pr-ps-set-utility (value) | 4979 | (defun pr-ps-set-utility (value) |
| @@ -5163,6 +5105,116 @@ non-nil." | |||
| 5163 | ;; Internal Functions (II) | 5105 | ;; Internal Functions (II) |
| 5164 | 5106 | ||
| 5165 | 5107 | ||
| 5108 | (defun pr-toggle (var-sym mess entry index horizontal state | ||
| 5109 | &optional path no-menu) | ||
| 5110 | (set var-sym (not (symbol-value var-sym))) | ||
| 5111 | (message "%s is %s" mess (if (symbol-value var-sym) "on" "off")) | ||
| 5112 | (or no-menu | ||
| 5113 | (pr-menu-lock entry index horizontal state path))) | ||
| 5114 | |||
| 5115 | |||
| 5116 | (defun pr-toggle-file-duplex-menu (&optional no-menu) | ||
| 5117 | (interactive) | ||
| 5118 | (pr-toggle 'pr-file-duplex "PS file duplex" nil 7 5 nil | ||
| 5119 | '("PostScript Print" "File") no-menu)) | ||
| 5120 | |||
| 5121 | |||
| 5122 | (defun pr-toggle-file-tumble-menu (&optional no-menu) | ||
| 5123 | (interactive) | ||
| 5124 | (pr-toggle 'pr-file-tumble "PS file tumble" nil 8 5 nil | ||
| 5125 | '("PostScript Print" "File") no-menu)) | ||
| 5126 | |||
| 5127 | |||
| 5128 | (defun pr-toggle-file-landscape-menu (&optional no-menu) | ||
| 5129 | (interactive) | ||
| 5130 | (pr-toggle 'pr-file-landscape "PS file landscape" nil 6 5 nil | ||
| 5131 | '("PostScript Print" "File") no-menu)) | ||
| 5132 | |||
| 5133 | |||
| 5134 | (defun pr-toggle-ghostscript-menu (&optional no-menu) | ||
| 5135 | (interactive) | ||
| 5136 | (pr-toggle 'pr-print-using-ghostscript "Printing using ghostscript" | ||
| 5137 | 'postscript-process 2 12 'toggle nil no-menu)) | ||
| 5138 | |||
| 5139 | |||
| 5140 | (defun pr-toggle-faces-menu (&optional no-menu) | ||
| 5141 | (interactive) | ||
| 5142 | (pr-toggle 'pr-faces-p "Printing with faces" | ||
| 5143 | 'postscript-process 1 12 'toggle nil no-menu)) | ||
| 5144 | |||
| 5145 | |||
| 5146 | (defun pr-toggle-spool-menu (&optional no-menu) | ||
| 5147 | (interactive) | ||
| 5148 | (pr-toggle 'pr-spool-p "Spooling printing" | ||
| 5149 | 'postscript-process 0 12 'toggle nil no-menu)) | ||
| 5150 | |||
| 5151 | |||
| 5152 | (defun pr-toggle-duplex-menu (&optional no-menu) | ||
| 5153 | (interactive) | ||
| 5154 | (pr-toggle 'ps-spool-duplex "Printing duplex" | ||
| 5155 | 'postscript-options 5 12 'toggle nil no-menu)) | ||
| 5156 | |||
| 5157 | |||
| 5158 | (defun pr-toggle-tumble-menu (&optional no-menu) | ||
| 5159 | (interactive) | ||
| 5160 | (pr-toggle 'ps-spool-tumble "Tumble" | ||
| 5161 | 'postscript-options 6 12 'toggle nil no-menu)) | ||
| 5162 | |||
| 5163 | |||
| 5164 | (defun pr-toggle-landscape-menu (&optional no-menu) | ||
| 5165 | (interactive) | ||
| 5166 | (pr-toggle 'ps-landscape-mode "Landscape" | ||
| 5167 | 'postscript-options 0 12 'toggle nil no-menu)) | ||
| 5168 | |||
| 5169 | |||
| 5170 | (defun pr-toggle-upside-down-menu (&optional no-menu) | ||
| 5171 | (interactive) | ||
| 5172 | (pr-toggle 'ps-print-upside-down "Upside-Down" | ||
| 5173 | 'postscript-options 7 12 'toggle nil no-menu)) | ||
| 5174 | |||
| 5175 | |||
| 5176 | (defun pr-toggle-line-menu (&optional no-menu) | ||
| 5177 | (interactive) | ||
| 5178 | (pr-toggle 'ps-line-number "Line number" | ||
| 5179 | 'postscript-options 3 12 'toggle nil no-menu)) | ||
| 5180 | |||
| 5181 | |||
| 5182 | (defun pr-toggle-zebra-menu (&optional no-menu) | ||
| 5183 | (interactive) | ||
| 5184 | (pr-toggle 'ps-zebra-stripes "Zebra stripe" | ||
| 5185 | 'postscript-options 4 12 'toggle nil no-menu)) | ||
| 5186 | |||
| 5187 | |||
| 5188 | (defun pr-toggle-header-menu (&optional no-menu) | ||
| 5189 | (interactive) | ||
| 5190 | (pr-toggle 'ps-print-header "Print header" | ||
| 5191 | 'postscript-options 1 12 'toggle nil no-menu)) | ||
| 5192 | |||
| 5193 | |||
| 5194 | (defun pr-toggle-header-frame-menu (&optional no-menu) | ||
| 5195 | (interactive) | ||
| 5196 | (pr-toggle 'ps-print-header-frame "Print header frame" | ||
| 5197 | 'postscript-options 2 12 'toggle nil no-menu)) | ||
| 5198 | |||
| 5199 | |||
| 5200 | (defun pr-toggle-lock-menu (&optional no-menu) | ||
| 5201 | (interactive) | ||
| 5202 | (pr-toggle 'pr-menu-lock "Menu lock" | ||
| 5203 | 'printing 2 12 'toggle nil no-menu)) | ||
| 5204 | |||
| 5205 | |||
| 5206 | (defun pr-toggle-region-menu (&optional no-menu) | ||
| 5207 | (interactive) | ||
| 5208 | (pr-toggle 'pr-auto-region "Auto region" | ||
| 5209 | 'printing 0 12 'toggle nil no-menu)) | ||
| 5210 | |||
| 5211 | |||
| 5212 | (defun pr-toggle-mode-menu (&optional no-menu) | ||
| 5213 | (interactive) | ||
| 5214 | (pr-toggle 'pr-auto-mode "Auto mode" | ||
| 5215 | 'printing 1 12 'toggle nil no-menu)) | ||
| 5216 | |||
| 5217 | |||
| 5166 | (defun pr-prompt (str) | 5218 | (defun pr-prompt (str) |
| 5167 | (if (pr-auto-mode-p) | 5219 | (if (pr-auto-mode-p) |
| 5168 | (concat str " mode") | 5220 | (concat str " mode") |
| @@ -5263,27 +5315,20 @@ non-nil." | |||
| 5263 | (pr-expand-file-name res))) | 5315 | (pr-expand-file-name res))) |
| 5264 | 5316 | ||
| 5265 | 5317 | ||
| 5266 | (defun pr-toggle (var-sym mess entry index horizontal state &optional path) | ||
| 5267 | (set var-sym (not (symbol-value var-sym))) | ||
| 5268 | (message "%s is %s" mess (if (symbol-value var-sym) "on" "off")) | ||
| 5269 | (pr-menu-lock entry index horizontal state path)) | ||
| 5270 | |||
| 5271 | |||
| 5272 | (defun pr-ps-utility-args (n-up-sym infile-sym outfile-sym prompt) | 5318 | (defun pr-ps-utility-args (n-up-sym infile-sym outfile-sym prompt) |
| 5319 | ;; check arguments for PostScript file processing. | ||
| 5273 | ;; n-up | 5320 | ;; n-up |
| 5274 | (or (symbol-value n-up-sym) | 5321 | (or (symbol-value n-up-sym) |
| 5275 | (set n-up-sym (pr-interactive-n-up prompt))) | 5322 | (set n-up-sym (pr-interactive-n-up prompt))) |
| 5276 | (and (eq (symbol-value infile-sym) t) | ||
| 5277 | (set infile-sym (and (not pr-interactive-p) | ||
| 5278 | (pr-ps-infile-preprint prompt)))) | ||
| 5279 | ;; input file | 5323 | ;; input file |
| 5324 | (and (eq (symbol-value infile-sym) t) | ||
| 5325 | (set infile-sym (pr-ps-infile-preprint prompt))) | ||
| 5280 | (or (symbol-value infile-sym) | 5326 | (or (symbol-value infile-sym) |
| 5281 | (error "%s: input PostScript file name is missing" prompt)) | 5327 | (error "%s: input PostScript file name is missing" prompt)) |
| 5282 | (set infile-sym (pr-dosify-file-name (symbol-value infile-sym))) | 5328 | (set infile-sym (pr-dosify-file-name (symbol-value infile-sym))) |
| 5283 | ;; output file | 5329 | ;; output file |
| 5284 | (and (eq (symbol-value outfile-sym) t) | 5330 | (and (eq (symbol-value outfile-sym) t) |
| 5285 | (set outfile-sym (and (not pr-interactive-p) | 5331 | (set outfile-sym (and current-prefix-arg |
| 5286 | current-prefix-arg | ||
| 5287 | (pr-ps-outfile-preprint prompt)))) | 5332 | (pr-ps-outfile-preprint prompt)))) |
| 5288 | (and (symbol-value outfile-sym) | 5333 | (and (symbol-value outfile-sym) |
| 5289 | (set outfile-sym (pr-dosify-file-name (symbol-value outfile-sym)))) | 5334 | (set outfile-sym (pr-dosify-file-name (symbol-value outfile-sym)))) |
| @@ -5291,6 +5336,7 @@ non-nil." | |||
| 5291 | 5336 | ||
| 5292 | 5337 | ||
| 5293 | (defun pr-ps-utility-process (n-up infile outfile) | 5338 | (defun pr-ps-utility-process (n-up infile outfile) |
| 5339 | ;; activate utility to process a PostScript file. | ||
| 5294 | (let (item) | 5340 | (let (item) |
| 5295 | (and (stringp infile) (file-exists-p infile) | 5341 | (and (stringp infile) (file-exists-p infile) |
| 5296 | (setq item (cdr (assq pr-ps-utility pr-ps-utility-alist))) | 5342 | (setq item (cdr (assq pr-ps-utility pr-ps-utility-alist))) |
| @@ -5402,8 +5448,10 @@ non-nil." | |||
| 5402 | 5448 | ||
| 5403 | (defun pr-ps-file (&optional filename) | 5449 | (defun pr-ps-file (&optional filename) |
| 5404 | (pr-dosify-file-name (or filename | 5450 | (pr-dosify-file-name (or filename |
| 5405 | (convert-standard-filename | 5451 | (make-temp-file |
| 5406 | (expand-file-name pr-ps-temp-file pr-temp-dir))))) | 5452 | (convert-standard-filename |
| 5453 | (expand-file-name pr-ps-temp-file pr-temp-dir)) | ||
| 5454 | nil ".ps")))) | ||
| 5407 | 5455 | ||
| 5408 | 5456 | ||
| 5409 | (defun pr-interactive-n-up (mess) | 5457 | (defun pr-interactive-n-up (mess) |
| @@ -5492,8 +5540,7 @@ non-nil." | |||
| 5492 | (defun pr-set-outfilename (filename-sym) | 5540 | (defun pr-set-outfilename (filename-sym) |
| 5493 | (and (not pr-spool-p) | 5541 | (and (not pr-spool-p) |
| 5494 | (eq (symbol-value filename-sym) t) | 5542 | (eq (symbol-value filename-sym) t) |
| 5495 | (set filename-sym (and (not pr-interactive-p) | 5543 | (set filename-sym (and current-prefix-arg |
| 5496 | current-prefix-arg | ||
| 5497 | (ps-print-preprint current-prefix-arg)))) | 5544 | (ps-print-preprint current-prefix-arg)))) |
| 5498 | (and (symbol-value filename-sym) | 5545 | (and (symbol-value filename-sym) |
| 5499 | (set filename-sym (pr-dosify-file-name (symbol-value filename-sym))))) | 5546 | (set filename-sym (pr-dosify-file-name (symbol-value filename-sym))))) |
| @@ -5729,13 +5776,12 @@ COMMAND.exe, COMMAND.bat and COMMAND.com in this order." | |||
| 5729 | (defvar pr-interface-map nil | 5776 | (defvar pr-interface-map nil |
| 5730 | "Keymap for pr-interface.") | 5777 | "Keymap for pr-interface.") |
| 5731 | 5778 | ||
| 5732 | (if pr-interface-map | 5779 | (unless pr-interface-map |
| 5733 | nil | ||
| 5734 | (setq pr-interface-map (make-sparse-keymap)) | 5780 | (setq pr-interface-map (make-sparse-keymap)) |
| 5735 | (cond ((eq ps-print-emacs-type 'xemacs) ; XEmacs | 5781 | (cond ((featurep 'xemacs) ; XEmacs |
| 5736 | (pr-f-set-keymap-parents pr-interface-map (list widget-keymap)) | 5782 | (pr-f-set-keymap-parents pr-interface-map (list widget-keymap)) |
| 5737 | (pr-f-set-keymap-name pr-interface-map 'pr-interface-map)) | 5783 | (pr-f-set-keymap-name pr-interface-map 'pr-interface-map)) |
| 5738 | ((eq ps-print-emacs-type 'emacs) ; GNU Emacs | 5784 | (t ; GNU Emacs |
| 5739 | (pr-f-set-keymap-parents pr-interface-map widget-keymap))) | 5785 | (pr-f-set-keymap-parents pr-interface-map widget-keymap))) |
| 5740 | (define-key pr-interface-map "q" 'pr-interface-quit) | 5786 | (define-key pr-interface-map "q" 'pr-interface-quit) |
| 5741 | (define-key pr-interface-map "?" 'pr-interface-help)) | 5787 | (define-key pr-interface-map "?" 'pr-interface-help)) |
| @@ -6162,21 +6208,19 @@ COMMAND.exe, COMMAND.bat and COMMAND.com in this order." | |||
| 6162 | (defun pr-interface-ps-print (&rest ignore) | 6208 | (defun pr-interface-ps-print (&rest ignore) |
| 6163 | "Print using ps-print package." | 6209 | "Print using ps-print package." |
| 6164 | (interactive) | 6210 | (interactive) |
| 6165 | (pr-save-interactive | 6211 | (pr-interface-ps 'pr-despool-ps-print 'pr-ps-directory-ps-print |
| 6166 | (pr-interface-ps 'pr-despool-ps-print 'pr-ps-directory-ps-print | 6212 | 'pr-ps-file-ps-print 'pr-ps-file-up-ps-print |
| 6167 | 'pr-ps-file-ps-print 'pr-ps-file-up-ps-print | 6213 | 'pr-ps-region-ps-print 'pr-ps-mode-ps-print |
| 6168 | 'pr-ps-region-ps-print 'pr-ps-mode-ps-print | 6214 | 'pr-ps-buffer-ps-print)) |
| 6169 | 'pr-ps-buffer-ps-print))) | ||
| 6170 | 6215 | ||
| 6171 | 6216 | ||
| 6172 | (defun pr-interface-preview (&rest ignore) | 6217 | (defun pr-interface-preview (&rest ignore) |
| 6173 | "Preview a PostScript file." | 6218 | "Preview a PostScript file." |
| 6174 | (interactive) | 6219 | (interactive) |
| 6175 | (pr-save-interactive | 6220 | (pr-interface-ps 'pr-despool-preview 'pr-ps-directory-preview |
| 6176 | (pr-interface-ps 'pr-despool-preview 'pr-ps-directory-preview | 6221 | 'pr-ps-file-preview 'pr-ps-file-up-preview |
| 6177 | 'pr-ps-file-preview 'pr-ps-file-up-preview | 6222 | 'pr-ps-region-preview 'pr-ps-mode-preview |
| 6178 | 'pr-ps-region-preview 'pr-ps-mode-preview | 6223 | 'pr-ps-buffer-preview)) |
| 6179 | 'pr-ps-buffer-preview))) | ||
| 6180 | 6224 | ||
| 6181 | 6225 | ||
| 6182 | (defun pr-interface-ps (ps-despool ps-directory ps-file ps-file-up ps-region | 6226 | (defun pr-interface-ps (ps-despool ps-directory ps-file ps-file-up ps-region |