5 |
|
|
6 |
;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br> |
;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br> |
7 |
;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br> |
;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br> |
8 |
;; Time-stamp: <2004/11/15 17:23:32 vinicius> |
;; Time-stamp: <2004/11/17 19:27:57 vinicius> |
9 |
;; Keywords: wp, print, PostScript |
;; Keywords: wp, print, PostScript |
10 |
;; Version: 6.8.3 |
;; Version: 6.8.3 |
11 |
;; X-URL: http://www.cpqd.com.br/~vinicius/emacs/ |
;; X-URL: http://www.cpqd.com.br/~vinicius/emacs/ |
12 |
|
|
13 |
(defconst pr-version "6.8.3" |
(defconst pr-version "6.8.3" |
14 |
"printing.el, v 6.8.3 <2004/11/14 vinicius> |
"printing.el, v 6.8.3 <2004/11/17 vinicius> |
15 |
|
|
16 |
Please send all bug fixes and enhancements to |
Please send all bug fixes and enhancements to |
17 |
Vinicius Jose Latorre <viniciusjl@ig.com.br> |
Vinicius Jose Latorre <viniciusjl@ig.com.br> |
488 |
;; `pr-temp-dir' Specify a directory for temporary files during |
;; `pr-temp-dir' Specify a directory for temporary files during |
489 |
;; printing. |
;; printing. |
490 |
;; |
;; |
491 |
;; `pr-ps-temp-file' Specify PostScript temporary file name. |
;; `pr-ps-temp-file' Specify PostScript temporary file name prefix. |
492 |
;; |
;; |
493 |
;; `pr-file-modes' Specify the file permission bits for newly |
;; `pr-file-modes' Specify the file permission bits for newly |
494 |
;; created files. |
;; created files. |
1003 |
(error "`printing' requires `ps-print' package version 6.6.4 or later")) |
(error "`printing' requires `ps-print' package version 6.6.4 or later")) |
1004 |
|
|
1005 |
|
|
1006 |
(eval-and-compile |
(defconst pr-cygwin-system |
1007 |
(defconst pr-cygwin-system |
(and ps-windows-system (getenv "OSTYPE") |
1008 |
(and ps-windows-system (getenv "OSTYPE") |
(string-match "cygwin" (getenv "OSTYPE")))) |
|
(string-match "cygwin" (getenv "OSTYPE"))))) |
|
1009 |
|
|
1010 |
|
|
1011 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1012 |
;; To avoid compilation gripes |
;; To avoid compilation gripes |
1013 |
|
|
1014 |
|
|
1015 |
(eval-and-compile |
(or (fboundp 'easy-menu-intern) ; hacked from easymenu.el |
1016 |
|
(defsubst easy-menu-intern (s) |
1017 |
|
(if (stringp s) (intern s) s))) |
1018 |
|
|
1019 |
(or (fboundp 'subst-char-in-string) |
|
1020 |
(defun subst-char-in-string (fromchar tochar string &optional inplace) |
|
1021 |
"Replace FROMCHAR with TOCHAR in STRING each time it occurs. |
(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. |
1024 |
Unless optional argument INPLACE is non-nil, return a new string." |
Unless optional argument INPLACE is non-nil, return a new string." |
1025 |
(let ((i (length string)) |
(let ((i (length string)) |
1026 |
(newstr (if inplace string (copy-sequence string)))) |
(newstr (if inplace string (copy-sequence string)))) |
1027 |
(while (> (setq i (1- i)) 0) |
(while (> (setq i (1- i)) 0) |
1028 |
(if (eq (aref newstr i) fromchar) |
(if (eq (aref newstr i) fromchar) |
1029 |
(aset newstr i tochar))) |
(aset newstr i tochar))) |
1030 |
newstr))) |
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))))) |
1070 |
|
|
|
;; GNU Emacs |
|
|
(defalias 'pr-e-frame-char-height 'frame-char-height) |
|
|
(defalias 'pr-e-frame-char-width 'frame-char-width) |
|
|
(defalias 'pr-e-mouse-pixel-position 'mouse-pixel-position) |
|
|
;; XEmacs |
|
|
(defalias 'pr-x-add-submenu 'add-submenu) |
|
|
(defalias 'pr-x-event-function 'event-function) |
|
|
(defalias 'pr-x-event-object 'event-object) |
|
|
(defalias 'pr-x-find-menu-item 'find-menu-item) |
|
|
(defalias 'pr-x-font-height 'font-height) |
|
|
(defalias 'pr-x-font-width 'font-width) |
|
|
(defalias 'pr-x-get-popup-menu-response 'get-popup-menu-response) |
|
|
(defalias 'pr-x-make-event 'make-event) |
|
|
(defalias 'pr-x-misc-user-event-p 'misc-user-event-p) |
|
|
(defalias 'pr-x-relabel-menu-item 'relabel-menu-item) |
|
|
(defalias 'pr-x-event-x-pixel 'event-x-pixel) |
|
|
(defalias 'pr-x-event-y-pixel 'event-y-pixel) |
|
1071 |
|
|
1072 |
(cond |
;; GNU Emacs |
1073 |
((eq ps-print-emacs-type 'emacs) ; GNU Emacs |
(defalias 'pr-e-frame-char-height 'frame-char-height) |
1074 |
(defvar deactivate-mark nil) |
(defalias 'pr-e-frame-char-width 'frame-char-width) |
1075 |
(defalias 'pr-f-set-keymap-parents 'set-keymap-parent) |
(defalias 'pr-e-mouse-pixel-position 'mouse-pixel-position) |
1076 |
(defalias 'pr-f-set-keymap-name 'ignore) |
;; XEmacs |
1077 |
(defalias 'pr-f-read-string 'read-string) |
(defalias 'pr-x-add-submenu 'add-submenu) |
1078 |
(defun pr-keep-region-active () |
(defalias 'pr-x-event-function 'event-function) |
1079 |
(setq deactivate-mark nil))) |
(defalias 'pr-x-event-object 'event-object) |
1080 |
|
(defalias 'pr-x-find-menu-item 'find-menu-item) |
1081 |
((eq ps-print-emacs-type 'xemacs) ; XEmacs |
(defalias 'pr-x-font-height 'font-height) |
1082 |
(defvar current-menubar nil) |
(defalias 'pr-x-font-width 'font-width) |
1083 |
(defvar current-mouse-event nil) |
(defalias 'pr-x-get-popup-menu-response 'get-popup-menu-response) |
1084 |
(defvar zmacs-region-stays nil) |
(defalias 'pr-x-make-event 'make-event) |
1085 |
(defalias 'pr-f-set-keymap-parents 'set-keymap-parents) |
(defalias 'pr-x-misc-user-event-p 'misc-user-event-p) |
1086 |
(defalias 'pr-f-set-keymap-name 'set-keymap-name) |
(defalias 'pr-x-relabel-menu-item 'relabel-menu-item) |
1087 |
(defun pr-f-read-string (prompt initial history default) |
(defalias 'pr-x-event-x-pixel 'event-x-pixel) |
1088 |
(let ((str (read-string prompt initial))) |
(defalias 'pr-x-event-y-pixel 'event-y-pixel) |
1089 |
(if (and str (not (string= str ""))) |
|
1090 |
str |
(cond |
1091 |
default))) |
((featurep 'xemacs) ; XEmacs |
1092 |
(defun pr-keep-region-active () |
(defvar current-menubar nil) |
1093 |
(setq zmacs-region-stays t))))) |
(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)))) |
1112 |
|
|
1113 |
|
|
1114 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1645 |
:group 'printing) |
:group 'printing) |
1646 |
|
|
1647 |
|
|
1648 |
(defcustom pr-ps-temp-file "prspool.ps" |
(defcustom pr-ps-temp-file "prspool-" |
1649 |
"*Specify PostScript temporary file name. |
"*Specify PostScript temporary file name prefix. |
1650 |
|
|
1651 |
See also `pr-temp-dir' and `pr-file-modes'." |
See also `pr-temp-dir' and `pr-file-modes'." |
1652 |
:type '(file :tag "PostScript Temporary File Name") |
:type '(file :tag "PostScript Temporary File Name") |
1653 |
:version "20" |
:version "21" |
1654 |
:group 'printing) |
:group 'printing) |
1655 |
|
|
1656 |
|
|
2246 |
|
|
2247 |
|
|
2248 |
(defcustom pr-menu-char-height |
(defcustom pr-menu-char-height |
2249 |
(cond ((eq ps-print-emacs-type 'emacs) ; GNU Emacs |
(cond ((featurep 'xemacs) ; XEmacs |
2250 |
(pr-e-frame-char-height)) |
(pr-x-font-height (face-font 'default))) |
2251 |
((eq ps-print-emacs-type 'xemacs) ; XEmacs |
(t ; GNU Emacs |
2252 |
(pr-x-font-height (face-font 'default)))) |
(pr-e-frame-char-height))) |
2253 |
"*Specify menu char height in pixels. |
"*Specify menu char height in pixels. |
2254 |
|
|
2255 |
This variable is used to guess which vertical position should be locked the |
This variable is used to guess which vertical position should be locked the |
2262 |
|
|
2263 |
|
|
2264 |
(defcustom pr-menu-char-width |
(defcustom pr-menu-char-width |
2265 |
(cond ((eq ps-print-emacs-type 'emacs) ; GNU Emacs |
(cond ((featurep 'xemacs) ; XEmacs |
2266 |
(pr-e-frame-char-width)) |
(pr-x-font-width (face-font 'default))) |
2267 |
((eq ps-print-emacs-type 'xemacs) ; XEmacs |
(t ; GNU Emacs |
2268 |
(pr-x-font-width (face-font 'default)))) |
(pr-e-frame-char-width))) |
2269 |
"*Specify menu char width in pixels. |
"*Specify menu char width in pixels. |
2270 |
|
|
2271 |
This variable is used to guess which horizontal position should be locked the |
This variable is used to guess which horizontal position should be locked the |
2553 |
;; Macros |
;; Macros |
2554 |
|
|
2555 |
|
|
|
(defvar pr-interactive-p nil |
|
|
"Save the `interactive-p' result value. |
|
|
|
|
|
It's used by `pr-save-interactive' (which see).") |
|
|
|
|
|
|
|
|
(defmacro pr-save-interactive (&rest body) |
|
|
"Save the `interactive-p' result value using `let'. |
|
|
|
|
|
It uses `pr-interactive-p' var (which see)." |
|
|
`(let ((pr-interactive-p (or pr-interactive-p (interactive-p)))) |
|
|
,@body)) |
|
|
|
|
|
|
|
2556 |
(defmacro pr-save-file-modes (&rest body) |
(defmacro pr-save-file-modes (&rest body) |
2557 |
"Set temporally file modes to `pr-file-modes'." |
"Set temporally file modes to `pr-file-modes'." |
2558 |
`(let ((pr--default-file-modes (default-file-modes))) ; save default |
`(let ((pr--default-file-modes (default-file-modes))) ; save default |
2590 |
(and pr-print-using-ghostscript (not pr-spool-p))) |
(and pr-print-using-ghostscript (not pr-spool-p))) |
2591 |
|
|
2592 |
|
|
2593 |
(eval-and-compile |
(defun pr-get-symbol (name) |
2594 |
(defun pr-get-symbol (name) |
(easy-menu-intern name)) |
|
(easy-menu-intern name)) |
|
2595 |
|
|
2596 |
(cond |
(cond |
2597 |
((eq ps-print-emacs-type 'emacs) ; GNU Emacs |
((featurep 'xemacs) ; XEmacs |
2598 |
(defun pr-region-active-p () |
(defvar zmacs-region-stays nil) ; to avoid compilation gripes |
2599 |
(and pr-auto-region transient-mark-mode mark-active))) |
(defun pr-region-active-p () |
2600 |
|
(and pr-auto-region (not zmacs-region-stays) (ps-mark-active-p)))) |
2601 |
((eq ps-print-emacs-type 'xemacs) ; XEmacs |
|
2602 |
(defvar zmacs-region-stays nil) ; to avoid compilation gripes |
(t ; GNU Emacs |
2603 |
(defun pr-region-active-p () |
(defun pr-region-active-p () |
2604 |
(and pr-auto-region (not zmacs-region-stays) (ps-mark-active-p))))) |
(and pr-auto-region transient-mark-mode mark-active)))) |
2605 |
|
|
2606 |
|
|
2607 |
(defconst pr-menu-spec |
(defconst pr-menu-spec |
2608 |
;; Menu mapping: |
;; Menu mapping: |
2609 |
;; unfortunately XEmacs doesn't support :active for submenus, |
;; unfortunately XEmacs doesn't support :active for submenus, |
2610 |
;; only for items. |
;; only for items. |
2611 |
;; So, it uses :included instead of :active. |
;; So, it uses :included instead of :active. |
2612 |
;; Also, XEmacs doesn't support :help tag. |
;; Also, XEmacs doesn't support :help tag. |
2613 |
(let ((pr-:active (if (eq ps-print-emacs-type 'emacs) |
(let ((pr-:active (if (featurep 'xemacs) |
2614 |
:active ; GNU Emacs |
:included ; XEmacs |
2615 |
:included)) ; XEmacs |
:active)) ; GNU Emacs |
2616 |
(pr-:help (if (eq ps-print-emacs-type 'emacs) |
(pr-:help (if (featurep 'xemacs) |
2617 |
#'(lambda (text) (list :help text)) ; GNU Emacs |
'ignore ; XEmacs |
2618 |
'ignore))) ; XEmacs |
#'(lambda (text) (list :help text))))) ; GNU Emacs |
2619 |
`( |
`( |
2620 |
["Printing Interface" pr-interface |
["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]" |
2654 |
,@(funcall |
,@(funcall |
2655 |
pr-:help "Use buffer interface instead of menu interface")] |
pr-:help "Preview PostScript file")] |
2656 |
"--" |
"--" |
2657 |
("PostScript Preview" :included (pr-visible-p 'postscript) |
["PostScript Utility" pr-update-menus :active pr-ps-utility-alist |
|
,@(funcall |
|
|
pr-:help "Preview PostScript instead of sending to printer") |
|
|
("Directory" ,pr-:active (not pr-spool-p) |
|
|
["1-up" (pr-ps-directory-preview 1 nil nil t) t] |
|
|
["2-up" (pr-ps-directory-preview 2 nil nil t) t] |
|
|
["4-up" (pr-ps-directory-preview 4 nil nil t) t] |
|
|
["Other..." (pr-ps-directory-preview nil nil nil t) |
|
|
:keys "\\[pr-ps-buffer-preview]"]) |
|
|
("Buffer" ,pr-:active (not pr-spool-p) |
|
|
["1-up" (pr-ps-buffer-preview 1 t) t] |
|
|
["2-up" (pr-ps-buffer-preview 2 t) t] |
|
|
["4-up" (pr-ps-buffer-preview 4 t) t] |
|
|
["Other..." (pr-ps-buffer-preview nil t) |
|
|
:keys "\\[pr-ps-buffer-preview]"]) |
|
|
("Region" ,pr-:active (and (not pr-spool-p) (ps-mark-active-p)) |
|
|
["1-up" (pr-ps-region-preview 1 t) t] |
|
|
["2-up" (pr-ps-region-preview 2 t) t] |
|
|
["4-up" (pr-ps-region-preview 4 t) t] |
|
|
["Other..." (pr-ps-region-preview nil t) |
|
|
:keys "\\[pr-ps-region-preview]"]) |
|
|
("Mode" ,pr-:active (and (not pr-spool-p) (pr-mode-alist-p)) |
|
|
["1-up" (pr-ps-mode-preview 1 t) t] |
|
|
["2-up" (pr-ps-mode-preview 2 t) t] |
|
|
["4-up" (pr-ps-mode-preview 4 t) t] |
|
|
["Other..." (pr-ps-mode-preview nil t) |
|
|
:keys "\\[pr-ps-mode-preview]"]) |
|
|
("File" |
|
|
["No Preprocessing..." (call-interactively 'pr-ps-file-preview) |
|
|
:keys "\\[pr-ps-file-preview]" |
|
|
,@(funcall |
|
|
pr-:help "Preview PostScript file")] |
|
|
"--" |
|
|
["PostScript Utility" pr-update-menus :active pr-ps-utility-alist |
|
|
,@(funcall |
|
|
pr-:help "Select PostScript utility")] |
|
|
"--" |
|
|
["1-up..." (pr-ps-file-up-preview 1 t t) pr-ps-utility-alist] |
|
|
["2-up..." (pr-ps-file-up-preview 2 t t) pr-ps-utility-alist] |
|
|
["4-up..." (pr-ps-file-up-preview 4 t t) pr-ps-utility-alist] |
|
|
["Other..." (pr-ps-file-up-preview nil t t) |
|
|
:keys "\\[pr-ps-file-up-preview]" :active pr-ps-utility-alist] |
|
|
"--" |
|
|
["Landscape" pr-toggle-file-landscape |
|
|
:style toggle :selected pr-file-landscape |
|
|
,@(funcall |
|
|
pr-:help "Toggle landscape for PostScript file") |
|
|
:active pr-ps-utility-alist] |
|
|
["Duplex" pr-toggle-file-duplex |
|
|
:style toggle :selected pr-file-duplex |
|
|
,@(funcall |
|
|
pr-:help "Toggle duplex for PostScript file") |
|
|
:active pr-ps-utility-alist] |
|
|
["Tumble" pr-toggle-file-tumble |
|
|
:style toggle :selected pr-file-tumble |
|
|
,@(funcall |
|
|
pr-:help "Toggle tumble for PostScript file") |
|
|
:active (and pr-file-duplex pr-ps-utility-alist)]) |
|
|
["Despool..." (call-interactively 'pr-despool-preview) |
|
|
:active pr-spool-p :keys "\\[pr-despool-preview]" |
|
|
,@(funcall |
|
|
pr-:help "Despool PostScript buffer to printer or file (C-u)")]) |
|
|
("PostScript Print" :included (pr-visible-p 'postscript) |
|
2658 |
,@(funcall |
,@(funcall |
2659 |
pr-:help "Send PostScript to printer or file (C-u)") |
pr-:help "Select PostScript utility")] |
2660 |
("Directory" |
"--" |
2661 |
["1-up" (pr-ps-directory-ps-print 1 nil nil t) t] |
["1-up..." (pr-ps-file-up-preview 1 t t) pr-ps-utility-alist] |
2662 |
["2-up" (pr-ps-directory-ps-print 2 nil nil t) t] |
["2-up..." (pr-ps-file-up-preview 2 t t) pr-ps-utility-alist] |
2663 |
["4-up" (pr-ps-directory-ps-print 4 nil nil t) t] |
["4-up..." (pr-ps-file-up-preview 4 t t) pr-ps-utility-alist] |
2664 |
["Other..." (pr-ps-directory-ps-print nil nil nil t) |
["Other..." (pr-ps-file-up-preview nil t t) |
2665 |
:keys "\\[pr-ps-buffer-ps-print]"]) |
:keys "\\[pr-ps-file-up-preview]" :active pr-ps-utility-alist] |
|
("Buffer" |
|
|
["1-up" (pr-ps-buffer-ps-print 1 t) t] |
|
|
["2-up" (pr-ps-buffer-ps-print 2 t) t] |
|
|
["4-up" (pr-ps-buffer-ps-print 4 t) t] |
|
|
["Other..." (pr-ps-buffer-ps-print nil t) |
|
|
:keys "\\[pr-ps-buffer-ps-print]"]) |
|
|
("Region" ,pr-:active (ps-mark-active-p) |
|
|
["1-up" (pr-ps-region-ps-print 1 t) t] |
|
|
["2-up" (pr-ps-region-ps-print 2 t) t] |
|
|
["4-up" (pr-ps-region-ps-print 4 t) t] |
|
|
["Other..." (pr-ps-region-ps-print nil t) |
|
|
:keys "\\[pr-ps-region-ps-print]"]) |
|
|
("Mode" ,pr-:active (pr-mode-alist-p) |
|
|
["1-up" (pr-ps-mode-ps-print 1 t) t] |
|
|
["2-up" (pr-ps-mode-ps-print 2 t) t] |
|
|
["4-up" (pr-ps-mode-ps-print 4 t) t] |
|
|
["Other..." (pr-ps-mode-ps-print nil t) |
|
|
:keys "\\[pr-ps-mode-ps-print]"]) |
|
|
("File" |
|
|
["No Preprocessing..." (call-interactively 'pr-ps-file-ps-print) |
|
|
:keys "\\[pr-ps-file-ps-print]" |
|
|
,@(funcall |
|
|
pr-:help "Send PostScript file to printer")] |
|
|
"--" |
|
|
["PostScript Utility" pr-update-menus :active pr-ps-utility-alist |
|
|
,@(funcall |
|
|
pr-:help "Select PostScript utility")] |
|
|
"--" |
|
|
["1-up..." (pr-ps-file-up-ps-print 1 t t) pr-ps-utility-alist] |
|
|
["2-up..." (pr-ps-file-up-ps-print 2 t t) pr-ps-utility-alist] |
|
|
["4-up..." (pr-ps-file-up-ps-print 4 t t) pr-ps-utility-alist] |
|
|
["Other..." (pr-ps-file-up-ps-print nil t t) |
|
|
:keys "\\[pr-ps-file-up-ps-print]" :active pr-ps-utility-alist] |
|
|
"--" |
|
|
["Landscape" pr-toggle-file-landscape |
|
|
:style toggle :selected pr-file-landscape |
|
|
,@(funcall |
|
|
pr-:help "Toggle landscape for PostScript file") |
|
|
:active pr-ps-utility-alist] |
|
|
["Duplex" pr-toggle-file-duplex |
|
|
:style toggle :selected pr-file-duplex |
|
|
,@(funcall |
|
|
pr-:help "Toggle duplex for PostScript file") |
|
|
:active pr-ps-utility-alist] |
|
|
["Tumble" pr-toggle-file-tumble |
|
|
:style toggle :selected pr-file-tumble |
|
|
,@(funcall |
|
|
pr-:help "Toggle tumble for PostScript file") |
|
|
:active (and pr-file-duplex pr-ps-utility-alist)]) |
|
|
["Despool..." (call-interactively 'pr-despool-ps-print) |
|
|
:active pr-spool-p :keys "\\[pr-despool-ps-print]" |
|
|
,@(funcall |
|
|
pr-:help "Despool PostScript buffer to printer or file (C-u)")]) |
|
|
["PostScript Printers" pr-update-menus |
|
|
:active pr-ps-printer-alist :included (pr-visible-p 'postscript) |
|
|
,@(funcall |
|
|
pr-:help "Select PostScript printer")] |
|
2666 |
"--" |
"--" |
2667 |
("Printify" :included (pr-visible-p 'text) |
["Landscape" pr-toggle-file-landscape-menu |
2668 |
|
:style toggle :selected pr-file-landscape |
2669 |
|
,@(funcall |
2670 |
|
pr-:help "Toggle landscape for PostScript file") |
2671 |
|
:active pr-ps-utility-alist] |
2672 |
|
["Duplex" pr-toggle-file-duplex-menu |
2673 |
|
:style toggle :selected pr-file-duplex |
2674 |
,@(funcall |
,@(funcall |
2675 |
pr-:help |
pr-:help "Toggle duplex for PostScript file") |
2676 |
"Replace non-printing chars with printable representations.") |
:active pr-ps-utility-alist] |
2677 |
["Directory" pr-printify-directory t] |
["Tumble" pr-toggle-file-tumble-menu |
2678 |
["Buffer" pr-printify-buffer t] |
:style toggle :selected pr-file-tumble |
|
["Region" pr-printify-region (ps-mark-active-p)]) |
|
|
("Print" :included (pr-visible-p 'text) |
|
2679 |
,@(funcall |
,@(funcall |
2680 |
pr-:help "Send text to printer") |
pr-:help "Toggle tumble for PostScript file") |
2681 |
["Directory" pr-txt-directory t] |
:active (and pr-file-duplex pr-ps-utility-alist)]) |
2682 |
["Buffer" pr-txt-buffer t] |
["Despool..." (call-interactively 'pr-despool-preview) |
2683 |
["Region" pr-txt-region (ps-mark-active-p)] |
:active pr-spool-p :keys "\\[pr-despool-preview]" |
2684 |
["Mode" pr-txt-mode (pr-mode-alist-p)]) |
,@(funcall |
2685 |
["Text Printers" pr-update-menus |
pr-:help "Despool PostScript buffer to printer or file (C-u)")]) |
2686 |
:active pr-txt-printer-alist :included (pr-visible-p 'text) |
("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 |
,@(funcall |
2717 |
pr-:help "Select text printer")] |
pr-:help "Send PostScript file to printer")] |
2718 |
"--" |
"--" |
2719 |
["Landscape" pr-toggle-landscape |
["PostScript Utility" pr-update-menus :active pr-ps-utility-alist |
|
:style toggle :selected ps-landscape-mode |
|
|
:included (pr-visible-p 'postscript-options)] |
|
|
["Print Header" pr-toggle-header |
|
|
:style toggle :selected ps-print-header |
|
|
:included (pr-visible-p 'postscript-options)] |
|
|
["Print Header Frame" pr-toggle-header-frame |
|
|
:style toggle :selected ps-print-header-frame :active ps-print-header |
|
|
:included (pr-visible-p 'postscript-options)] |
|
|
["Line Number" pr-toggle-line |
|
|
:style toggle :selected ps-line-number |
|
|
:included (pr-visible-p 'postscript-options)] |
|
|
["Zebra Stripes" pr-toggle-zebra |
|
|
:style toggle :selected ps-zebra-stripes |
|
|
:included (pr-visible-p 'postscript-options)] |
|
|
["Duplex" pr-toggle-duplex |
|
|
:style toggle :selected ps-spool-duplex |
|
|
:included (pr-visible-p 'postscript-options)] |
|
|
["Tumble" pr-toggle-tumble |
|
|
:style toggle :selected ps-spool-tumble :active ps-spool-duplex |
|
|
:included (pr-visible-p 'postscript-options)] |
|
|
["Upside-Down" pr-toggle-upside-down |
|
|
:style toggle :selected ps-print-upside-down |
|
|
:included (pr-visible-p 'postscript-options)] |
|
|
("Print All Pages" :included (pr-visible-p 'postscript-options) |
|
2720 |
,@(funcall |
,@(funcall |
2721 |
pr-:help "Select odd/even pages/sheets to print") |
pr-:help "Select PostScript utility")] |
|
["All Pages" (pr-even-or-odd-pages nil) |
|
|
:style radio :selected (eq ps-even-or-odd-pages nil)] |
|
|
["Even Pages" (pr-even-or-odd-pages 'even-page) |
|
|
:style radio :selected (eq ps-even-or-odd-pages 'even-page)] |
|
|
["Odd Pages" (pr-even-or-odd-pages 'odd-page) |
|
|
:style radio :selected (eq ps-even-or-odd-pages 'odd-page)] |
|
|
["Even Sheets" (pr-even-or-odd-pages 'even-sheet) |
|
|
:style radio :selected (eq ps-even-or-odd-pages 'even-sheet)] |
|
|
["Odd Sheets" (pr-even-or-odd-pages 'odd-sheet) |
|
|
:style radio :selected (eq ps-even-or-odd-pages 'odd-sheet)]) |
|
2722 |
"--" |
"--" |
2723 |
["Spool Buffer" pr-toggle-spool |
["1-up..." (pr-ps-file-up-ps-print 1 t t) pr-ps-utility-alist] |
2724 |
:style toggle :selected pr-spool-p |
["2-up..." (pr-ps-file-up-ps-print 2 t t) pr-ps-utility-alist] |
2725 |
:included (pr-visible-p 'postscript-process) |
["4-up..." (pr-ps-file-up-ps-print 4 t t) pr-ps-utility-alist] |
2726 |
|
["Other..." (pr-ps-file-up-ps-print nil t t) |
2727 |
|
:keys "\\[pr-ps-file-up-ps-print]" :active pr-ps-utility-alist] |
2728 |
|
"--" |
2729 |
|
["Landscape" pr-toggle-file-landscape-menu |
2730 |
|
:style toggle :selected pr-file-landscape |
2731 |
,@(funcall |
,@(funcall |
2732 |
pr-:help "Toggle PostScript spooling")] |
pr-:help "Toggle landscape for PostScript file") |
2733 |
["Print with faces" pr-toggle-faces |
:active pr-ps-utility-alist] |
2734 |
:style toggle :selected pr-faces-p |
["Duplex" pr-toggle-file-duplex-menu |
2735 |
:included (pr-visible-p 'postscript-process) |
:style toggle :selected pr-file-duplex |
2736 |
,@(funcall |
,@(funcall |
2737 |
pr-:help "Toggle PostScript printing with faces")] |
pr-:help "Toggle duplex for PostScript file") |
2738 |
["Print via Ghostscript" pr-toggle-ghostscript |
:active pr-ps-utility-alist] |
2739 |
:style toggle :selected pr-print-using-ghostscript |
["Tumble" pr-toggle-file-tumble-menu |
2740 |
:included (pr-visible-p 'postscript-process) |
:style toggle :selected pr-file-tumble |
2741 |
,@(funcall |
,@(funcall |
2742 |
pr-:help "Toggle PostScript generation using ghostscript")] |
pr-:help "Toggle tumble for PostScript file") |
2743 |
"--" |
:active (and pr-file-duplex pr-ps-utility-alist)]) |
2744 |
["Auto Region" pr-toggle-region |
["Despool..." (call-interactively 'pr-despool-ps-print) |
2745 |
:style toggle :selected pr-auto-region |
:active pr-spool-p :keys "\\[pr-despool-ps-print]" |
2746 |
:included (pr-visible-p 'printing)] |
,@(funcall |
2747 |
["Auto Mode" pr-toggle-mode |
pr-:help "Despool PostScript buffer to printer or file (C-u)")]) |
2748 |
:style toggle :selected pr-auto-mode |
["PostScript Printers" pr-update-menus |
2749 |
:included (pr-visible-p 'printing)] |
:active pr-ps-printer-alist :included (pr-visible-p 'postscript) |
2750 |
["Menu Lock" pr-toggle-lock |
,@(funcall |
2751 |
:style toggle :selected pr-menu-lock |
pr-:help "Select PostScript printer")] |
2752 |
:included (pr-visible-p 'printing)] |
"--" |
2753 |
"--" |
("Printify" :included (pr-visible-p 'text) |
2754 |
("Customize" :included (pr-visible-p 'help) |
,@(funcall |
2755 |
["printing" pr-customize t] |
pr-:help |
2756 |
["ps-print" ps-print-customize t] |
"Replace non-printing chars with printable representations.") |
2757 |
["lpr" lpr-customize t]) |
["Directory" pr-printify-directory t] |
2758 |
("Show Settings" :included (pr-visible-p 'help) |
["Buffer" pr-printify-buffer t] |
2759 |
["printing" pr-show-pr-setup t] |
["Region" pr-printify-region (ps-mark-active-p)]) |
2760 |
["ps-print" pr-show-ps-setup t] |
("Print" :included (pr-visible-p 'text) |
2761 |
["lpr" pr-show-lpr-setup t]) |
,@(funcall |
2762 |
["Help" pr-help :active t :included (pr-visible-p 'help)] |
pr-:help "Send text to printer") |
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"))) |
2853 |
|
|
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") |
2862 |
(cond |
(cond |
2863 |
((eq ps-print-emacs-type 'emacs) ; GNU Emacs |
;; Emacs 20 |
2864 |
;; Menu binding |
((string< emacs-version "21.") |
2865 |
(require 'easymenu) |
(easy-menu-change '("tools") "Printing" pr-menu-spec pr-menu-print-item) |
2866 |
;; Replace existing "print" item by "Printing" item. |
(when pr-menu-print-item |
2867 |
;; If you're changing this file, you'll load it a second, |
(easy-menu-remove-item nil '("tools") pr-menu-print-item) |
2868 |
;; third... time, but "print" item exists only in the first load. |
(setq pr-menu-print-item nil |
2869 |
(defvar pr-menu-print-item "print") |
pr-menu-bar (vector 'menu-bar 'tools |
2870 |
(cond |
(pr-get-symbol "Printing"))))) |
2871 |
;; Emacs 20 |
;; Emacs 21 |
2872 |
((string< emacs-version "21.") |
(pr-menu-print-item |
2873 |
(easy-menu-change '("tools") "Printing" pr-menu-spec pr-menu-print-item) |
(easy-menu-change '("file") "Print" pr-menu-spec "print-buffer") |
2874 |
(when pr-menu-print-item |
(let ((items '("print-buffer" "print-region" |
2875 |
(easy-menu-remove-item nil '("tools") pr-menu-print-item) |
"ps-print-buffer-faces" "ps-print-region-faces" |
2876 |
(setq pr-menu-print-item nil |
"ps-print-buffer" "ps-print-region"))) |
2877 |
pr-menu-bar (vector 'menu-bar 'tools |
(while items |
2878 |
(pr-get-symbol "Printing"))))) |
(easy-menu-remove-item nil '("file") (car items)) |
2879 |
;; Emacs 21 |
(setq items (cdr items))) |
2880 |
(pr-menu-print-item |
(setq pr-menu-print-item nil |
2881 |
(easy-menu-change '("file") "Print" pr-menu-spec "print-buffer") |
pr-menu-bar (vector 'menu-bar 'file |
2882 |
(let ((items '("print-buffer" "print-region" |
(pr-get-symbol "Print"))))) |
2883 |
"ps-print-buffer-faces" "ps-print-region-faces" |
(t |
2884 |
"ps-print-buffer" "ps-print-region"))) |
(easy-menu-change '("file") "Print" pr-menu-spec))))) |
|
(while items |
|
|
(easy-menu-remove-item nil '("file") (car items)) |
|
|
(setq items (cdr items))) |
|
|
(setq pr-menu-print-item nil |
|
|
pr-menu-bar (vector 'menu-bar 'file |
|
|
(pr-get-symbol "Print"))))) |
|
|
(t |
|
|
(easy-menu-change '("file") "Print" pr-menu-spec)))) |
|
|
|
|
|
|
|
|
((eq ps-print-emacs-type 'xemacs) ; XEmacs |
|
|
;; Menu binding |
|
|
(pr-xemacs-global-menubar |
|
|
(pr-x-add-submenu nil (cons "Printing" pr-menu-spec) "Apps")))) |
|
2885 |
|
|
2886 |
|
|
2887 |
;; Key binding |
;; Key binding |
2888 |
(let ((pr-print-key (if (eq ps-print-emacs-type 'emacs) |
(let ((pr-print-key (if (featurep 'xemacs) |
2889 |
'print ; GNU Emacs |
'f22 ; XEmacs |
2890 |
'f22))) ; XEmacs |
'print))) ; GNU Emacs |
2891 |
(global-set-key `[,pr-print-key] 'pr-ps-fast-fire) |
(global-set-key `[,pr-print-key] 'pr-ps-fast-fire) |
2892 |
;; Well, M-print and S-print are used because in my keyboard S-print works |
;; Well, M-print and S-print are used because in my keyboard S-print works |
2893 |
;; and M-print doesn't. But M-print can work in other keyboard. |
;; and M-print doesn't. But M-print can work in other keyboard. |
2894 |
(global-set-key `[(meta ,pr-print-key)] 'pr-ps-mode-using-ghostscript) |
(global-set-key `[(meta ,pr-print-key)] 'pr-ps-mode-using-ghostscript) |
2895 |
(global-set-key `[(shift ,pr-print-key)] 'pr-ps-mode-using-ghostscript) |
(global-set-key `[(shift ,pr-print-key)] 'pr-ps-mode-using-ghostscript) |
2896 |
;; Well, C-print and C-M-print are used because in my keyboard C-M-print works |
;; Well, C-print and C-M-print are used because in my keyboard C-M-print works |
2897 |
;; and C-print doesn't. But C-print can work in other keyboard. |
;; and C-print doesn't. But C-print can work in other keyboard. |
2898 |
(global-set-key `[(control ,pr-print-key)] 'pr-txt-fast-fire) |
(global-set-key `[(control ,pr-print-key)] 'pr-txt-fast-fire) |
2899 |
(global-set-key `[(control meta ,pr-print-key)] 'pr-txt-fast-fire) |
(global-set-key `[(control meta ,pr-print-key)] 'pr-txt-fast-fire)) |
|
)) |
|
2900 |
|
|
2901 |
|
|
2902 |
;;; You can also use something like: |
;;; You can also use something like: |
3372 |
|
|
3373 |
For more information, type \\[pr-interface-help]." |
For more information, type \\[pr-interface-help]." |
3374 |
(interactive) |
(interactive) |
3375 |
(pr-save-interactive |
(save-excursion |
3376 |
(save-excursion |
(set-buffer (or buffer (current-buffer))) |
3377 |
(set-buffer (or buffer (current-buffer))) |
(pr-create-interface))) |
|
(pr-create-interface)))) |
|
3378 |
|
|
3379 |
|
|
3380 |
;;;###autoload |
;;;###autoload |
3395 |
|
|
3396 |
See also documentation for `pr-list-directory'." |
See also documentation for `pr-list-directory'." |
3397 |
(interactive (pr-interactive-ps-dir-args (pr-prompt "PS preview dir"))) |
(interactive (pr-interactive-ps-dir-args (pr-prompt "PS preview dir"))) |
3398 |
(pr-save-interactive |
(pr-set-ps-dir-args 'n-up 'dir 'file-regexp 'filename |
3399 |
(pr-set-ps-dir-args 'n-up 'dir 'file-regexp 'filename |
(pr-prompt "PS preview dir")) |
3400 |
(pr-prompt "PS preview dir")) |
(setq filename (pr-ps-file filename)) |
3401 |
(setq filename (pr-ps-file filename)) |
(pr-ps-file-list n-up dir file-regexp filename) |
3402 |
(pr-ps-file-list n-up dir file-regexp filename) |
(or pr-spool-p |
3403 |
(or pr-spool-p |
(pr-ps-file-preview filename))) |
|
(pr-ps-file-preview filename)))) |
|
3404 |
|
|
3405 |
|
|
3406 |
;;;###autoload |
;;;###autoload |
3421 |
|
|
3422 |
See also documentation for `pr-list-directory'." |
See also documentation for `pr-list-directory'." |
3423 |
(interactive (pr-interactive-ps-dir-args (pr-prompt "PS print dir GS"))) |
(interactive (pr-interactive-ps-dir-args (pr-prompt "PS print dir GS"))) |
3424 |
(pr-save-interactive |
(pr-set-ps-dir-args 'n-up 'dir 'file-regexp 'filename |
3425 |
(pr-set-ps-dir-args 'n-up 'dir 'file-regexp 'filename |
(pr-prompt "PS print dir GS")) |
3426 |
(pr-prompt "PS print dir GS")) |
(let ((file (pr-ps-file filename))) |
3427 |
(let ((file (pr-ps-file filename))) |
(pr-ps-file-list n-up dir file-regexp file) |
3428 |
(pr-ps-file-list n-up dir file-regexp file) |
(pr-ps-file-using-ghostscript file) |
3429 |
(pr-ps-file-using-ghostscript file) |
(or filename (pr-delete-file file)))) |
|
(or filename (pr-delete-file file))))) |
|
3430 |
|
|
3431 |
|
|
3432 |
;;;###autoload |
;;;###autoload |
3447 |
|
|
3448 |
See also documentation for `pr-list-directory'." |
See also documentation for `pr-list-directory'." |
3449 |
(interactive (pr-interactive-ps-dir-args (pr-prompt "PS print dir"))) |
(interactive (pr-interactive-ps-dir-args (pr-prompt "PS print dir"))) |
3450 |
(pr-save-interactive |
(pr-set-ps-dir-args 'n-up 'dir 'file-regexp 'filename |
3451 |
(pr-set-ps-dir-args 'n-up 'dir 'file-regexp 'filename |
(pr-prompt "PS print dir")) |
3452 |
(pr-prompt "PS print dir")) |
(let ((file (pr-ps-file filename))) |
3453 |
(let ((file (pr-ps-file filename))) |
(pr-ps-file-list n-up dir file-regexp file) |
3454 |
(pr-ps-file-list n-up dir file-regexp file) |
(pr-ps-file-print file) |
3455 |
(pr-ps-file-print file) |
(or filename (pr-delete-file file)))) |
|
(or filename (pr-delete-file file))))) |
|
3456 |
|
|
3457 |
|
|
3458 |
;;;###autoload |
;;;###autoload |
3476 |
See also documentation for `pr-list-directory'." |
See also documentation for `pr-list-directory'." |
3477 |
(interactive (pr-interactive-ps-dir-args |
(interactive (pr-interactive-ps-dir-args |
3478 |
(pr-prompt (pr-prompt-gs "PS print dir")))) |
(pr-prompt (pr-prompt-gs "PS print dir")))) |
3479 |
(pr-save-interactive |
(pr-set-ps-dir-args 'n-up 'dir 'file-regexp 'filename |
3480 |
(pr-set-ps-dir-args 'n-up 'dir 'file-regexp 'filename |
(pr-prompt (pr-prompt-gs "PS print dir"))) |
3481 |
(pr-prompt (pr-prompt-gs "PS print dir"))) |
(if (pr-using-ghostscript-p) |
3482 |
(if (pr-using-ghostscript-p) |
(pr-ps-directory-using-ghostscript n-up dir file-regexp filename) |
3483 |
(pr-ps-directory-using-ghostscript n-up dir file-regexp filename) |
(pr-ps-directory-print n-up dir file-regexp filename))) |
|
(pr-ps-directory-print n-up dir file-regexp filename)))) |
|
3484 |
|
|
3485 |
|
|
3486 |
;;;###autoload |
;;;###autoload |
3496 |
temporary file. If FILENAME is a string, save the PostScript image in a file |
temporary file. If FILENAME is a string, save the PostScript image in a file |
3497 |
with that name. If FILENAME is t, prompts for a file name." |
with that name. If FILENAME is t, prompts for a file name." |
3498 |
(interactive (pr-interactive-n-up-file (pr-prompt "PS preview"))) |
(interactive (pr-interactive-n-up-file (pr-prompt "PS preview"))) |
3499 |
(pr-save-interactive |
(if (pr-auto-mode-p) |
3500 |
(if (pr-auto-mode-p) |
(pr-ps-mode-preview n-up filename) |
3501 |
(pr-ps-mode-preview n-up filename) |
(pr-ps-preview (pr-region-active-symbol) n-up filename |
3502 |
(pr-ps-preview (pr-region-active-symbol) n-up filename |
(pr-region-active-string "PS preview")))) |
|
(pr-region-active-string "PS preview"))))) |
|
3503 |
|
|
3504 |
|
|
3505 |
;;;###autoload |
;;;###autoload |
3515 |
printer. If FILENAME is a string, save the PostScript image in a file with |
printer. If FILENAME is a string, save the PostScript image in a file with |
3516 |
that name. If FILENAME is t, prompts for a file name." |
that name. If FILENAME is t, prompts for a file name." |
3517 |
(interactive (pr-interactive-n-up-file (pr-prompt "PS print GS"))) |
(interactive (pr-interactive-n-up-file (pr-prompt "PS print GS"))) |
3518 |
(pr-save-interactive |
(if (pr-auto-mode-p) |
3519 |
(if (pr-auto-mode-p) |
(pr-ps-mode-using-ghostscript n-up filename) |
3520 |
(pr-ps-mode-using-ghostscript n-up filename) |
(pr-ps-using-ghostscript (pr-region-active-symbol) n-up filename |
3521 |
(pr-ps-using-ghostscript (pr-region-active-symbol) n-up filename |
(pr-region-active-string "PS print GS")))) |
|
(pr-region-active-string "PS print GS"))))) |
|
3522 |
|
|
3523 |
|
|
3524 |
;;;###autoload |
;;;###autoload |
3534 |
printer. If FILENAME is a string, save the PostScript image in a file with |
printer. If FILENAME is a string, save the PostScript image in a file with |
3535 |
that name. If FILENAME is t, prompts for a file name." |
that name. If FILENAME is t, prompts for a file name." |
3536 |
(interactive (pr-interactive-n-up-file (pr-prompt "PS print"))) |
(interactive (pr-interactive-n-up-file (pr-prompt "PS print"))) |
3537 |
(pr-save-interactive |
(if (pr-auto-mode-p) |
3538 |
(if (pr-auto-mode-p) |
(pr-ps-mode-print n-up filename) |
3539 |
(pr-ps-mode-print n-up filename) |
(pr-ps-print (pr-region-active-symbol) n-up filename |
3540 |
(pr-ps-print (pr-region-active-symbol) n-up filename |
(pr-region-active-string "PS print")))) |
|
(pr-region-active-string "PS print"))))) |
|
3541 |
|
|
3542 |
|
|
3543 |
;;;###autoload |
;;;###autoload |
3556 |
that name. If FILENAME is t, prompts for a file name." |
that name. If FILENAME is t, prompts for a file name." |
3557 |
(interactive (pr-interactive-n-up-file |
(interactive (pr-interactive-n-up-file |
3558 |
(pr-prompt (pr-prompt-gs "PS print")))) |
(pr-prompt (pr-prompt-gs "PS print")))) |
3559 |
(pr-save-interactive |
(cond ((pr-auto-mode-p) |
3560 |
(cond ((pr-auto-mode-p) |
(pr-ps-mode-ps-print n-up filename)) |
3561 |
(pr-ps-mode-ps-print n-up filename)) |
((pr-using-ghostscript-p) |
3562 |
((pr-using-ghostscript-p) |
(pr-ps-using-ghostscript (pr-region-active-symbol) n-up filename |
3563 |
(pr-ps-using-ghostscript (pr-region-active-symbol) n-up filename |
(pr-region-active-string "PS print GS"))) |
3564 |
(pr-region-active-string "PS print GS"))) |
(t |
3565 |
(t |
(pr-ps-print (pr-region-active-symbol) n-up filename |
3566 |
(pr-ps-print (pr-region-active-symbol) n-up filename |
(pr-region-active-string "PS print"))))) |
|
(pr-region-active-string "PS print")))))) |
|
3567 |
|
|
3568 |
|
|
3569 |
;;;###autoload |
;;;###autoload |
3572 |
|
|
3573 |
See also `pr-ps-buffer-preview'." |
See also `pr-ps-buffer-preview'." |
3574 |
(interactive (pr-interactive-n-up-file (pr-prompt-region "PS preview"))) |
(interactive (pr-interactive-n-up-file (pr-prompt-region "PS preview"))) |
3575 |
(pr-save-interactive |
(if (pr-auto-mode-p) |
3576 |
(if (pr-auto-mode-p) |
(let ((pr-auto-region t)) |
3577 |
(let ((pr-auto-region t)) |
(pr-ps-mode-preview n-up filename)) |
3578 |
(pr-ps-mode-preview n-up filename)) |
(pr-ps-preview 'region n-up filename "PS preview region"))) |
|
(pr-ps-preview 'region n-up filename "PS preview region")))) |
|
3579 |
|
|
3580 |
|
|
3581 |
;;;###autoload |
;;;###autoload |
3584 |
|
|
3585 |
See also `pr-ps-buffer-using-ghostscript'." |
See also `pr-ps-buffer-using-ghostscript'." |
3586 |
(interactive (pr-interactive-n-up-file (pr-prompt-region "PS print GS"))) |
(interactive (pr-interactive-n-up-file (pr-prompt-region "PS print GS"))) |
3587 |
(pr-save-interactive |
(if (pr-auto-mode-p) |
3588 |
(if (pr-auto-mode-p) |
(let ((pr-auto-region t)) |
3589 |
(let ((pr-auto-region t)) |
(pr-ps-mode-using-ghostscript n-up filename)) |
3590 |
(pr-ps-mode-using-ghostscript n-up filename)) |
(pr-ps-using-ghostscript 'region n-up filename "PS print GS region"))) |
|
(pr-ps-using-ghostscript 'region n-up filename "PS print GS region")))) |
|
3591 |
|
|
3592 |
|
|
3593 |
;;;###autoload |
;;;###autoload |
3596 |
|
|
3597 |
See also `pr-ps-buffer-print'." |
See also `pr-ps-buffer-print'." |
3598 |
(interactive (pr-interactive-n-up-file (pr-prompt-region "PS print"))) |
(interactive (pr-interactive-n-up-file (pr-prompt-region "PS print"))) |
3599 |
(pr-save-interactive |
(if (pr-auto-mode-p) |
3600 |
(if (pr-auto-mode-p) |
(let ((pr-auto-region t)) |
3601 |
(let ((pr-auto-region t)) |
(pr-ps-mode-print n-up filename)) |
3602 |
(pr-ps-mode-print n-up filename)) |
(pr-ps-print 'region n-up filename "PS print region"))) |
|
(pr-ps-print 'region n-up filename "PS print region")))) |
|
3603 |
|
|
3604 |
|
|
3605 |
;;;###autoload |
;;;###autoload |
3609 |
See also `pr-ps-buffer-ps-print'." |
See also `pr-ps-buffer-ps-print'." |
3610 |
(interactive (pr-interactive-n-up-file |
(interactive (pr-interactive-n-up-file |
3611 |
(pr-prompt-region (pr-prompt-gs "PS print")))) |
(pr-prompt-region (pr-prompt-gs "PS print")))) |
3612 |
(pr-save-interactive |
(cond ((pr-auto-mode-p) |
3613 |
(cond ((pr-auto-mode-p) |
(let ((pr-auto-region t)) |
3614 |
(let ((pr-auto-region t)) |
(pr-ps-mode-ps-print n-up filename))) |
3615 |
(pr-ps-mode-ps-print n-up filename))) |
((pr-using-ghostscript-p) |
3616 |
((pr-using-ghostscript-p) |
(pr-ps-using-ghostscript 'region n-up filename "PS print GS region")) |
3617 |
(pr-ps-using-ghostscript 'region n-up filename "PS print GS region")) |
(t |
3618 |
(t |
(pr-ps-print 'region n-up filename "PS print region")))) |
|
(pr-ps-print 'region n-up filename "PS print region"))))) |
|
3619 |
|
|
3620 |
|
|
3621 |
;;;###autoload |
;;;###autoload |
3624 |
|
|
3625 |
See also `pr-ps-buffer-preview'." |
See also `pr-ps-buffer-preview'." |
3626 |
(interactive (pr-interactive-n-up-file "PS preview mode")) |
(interactive (pr-interactive-n-up-file "PS preview mode")) |
3627 |
(pr-save-interactive |
(pr-set-n-up-and-filename 'n-up 'filename "PS preview mode") |
3628 |
(pr-set-n-up-and-filename 'n-up 'filename "PS preview mode") |
(let ((file (pr-ps-file filename))) |
3629 |
(let ((file (pr-ps-file filename))) |
(and (pr-ps-mode n-up file) |
3630 |
(and (pr-ps-mode n-up file) |
(not pr-spool-p) |
3631 |
(not pr-spool-p) |
(pr-ps-file-preview file)))) |
|
(pr-ps-file-preview file))))) |
|
3632 |
|
|
3633 |
|
|
3634 |
;;;###autoload |
;;;###autoload |
3637 |
|
|
3638 |
See also `pr-ps-buffer-using-ghostscript'." |
See also `pr-ps-buffer-using-ghostscript'." |
3639 |
(interactive (pr-interactive-n-up-file "PS print GS mode")) |
(interactive (pr-interactive-n-up-file "PS print GS mode")) |
3640 |
(pr-save-interactive |
(pr-set-n-up-and-filename 'n-up 'filename "PS print GS mode") |
3641 |
(pr-set-n-up-and-filename 'n-up 'filename "PS print GS mode") |
(let ((file (pr-ps-file filename))) |
3642 |
(let ((file (pr-ps-file filename))) |
(when (and (pr-ps-mode n-up file) |
3643 |
(when (and (pr-ps-mode n-up file) |
(not pr-spool-p)) |
3644 |
(not pr-spool-p)) |
(pr-ps-file-using-ghostscript file) |
3645 |
(pr-ps-file-using-ghostscript file) |
(or filename (pr-delete-file file))))) |
|
(or filename (pr-delete-file file)))))) |
|
3646 |
|
|
3647 |
|
|
3648 |
;;;###autoload |
;;;###autoload |
3651 |
|
|
3652 |
See also `pr-ps-buffer-print'." |
See also `pr-ps-buffer-print'." |
3653 |
(interactive (pr-interactive-n-up-file "PS print mode")) |
(interactive (pr-interactive-n-up-file "PS print mode")) |
3654 |
(pr-save-interactive |
(pr-set-n-up-and-filename 'n-up 'filename "PS print mode") |
3655 |
(pr-set-n-up-and-filename 'n-up 'filename "PS print mode") |
(pr-ps-mode n-up filename)) |
|
(pr-ps-mode n-up filename))) |
|
3656 |
|
|
3657 |
|
|
3658 |
;;;###autoload |
;;;###autoload |
3661 |
|
|
3662 |
See also `pr-ps-buffer-ps-print'." |
See also `pr-ps-buffer-ps-print'." |
3663 |
(interactive (pr-interactive-n-up-file (pr-prompt-gs "PS print mode"))) |
(interactive (pr-interactive-n-up-file (pr-prompt-gs "PS print mode"))) |
3664 |
(pr-save-interactive |
(if (pr-using-ghostscript-p) |
3665 |
(if (pr-using-ghostscript-p) |
(pr-ps-mode-using-ghostscript n-up filename) |
3666 |
(pr-ps-mode-using-ghostscript n-up filename) |
(pr-ps-mode-print n-up filename))) |
|
(pr-ps-mode-print n-up filename)))) |
|
3667 |
|
|
3668 |
|
|
3669 |
;;;###autoload |
;;;###autoload |
3680 |
|
|
3681 |
See also documentation for `pr-list-directory'." |
See also documentation for `pr-list-directory'." |
3682 |
(interactive (pr-interactive-dir-args "Printify dir")) |
(interactive (pr-interactive-dir-args "Printify dir")) |
3683 |
(pr-save-interactive |
(pr-set-dir-args 'dir 'file-regexp "Printify dir") |
3684 |
(pr-set-dir-args 'dir 'file-regexp "Printify dir") |
(pr-file-list dir file-regexp 'pr-printify-buffer)) |
|
(pr-file-list dir file-regexp 'pr-printify-buffer))) |
|
3685 |
|
|
3686 |
|
|
3687 |
;;;###autoload |
;;;###autoload |
3716 |
|
|
3717 |
See also documentation for `pr-list-directory'." |
See also documentation for `pr-list-directory'." |
3718 |
(interactive (pr-interactive-dir-args "Print dir")) |
(interactive (pr-interactive-dir-args "Print dir")) |
3719 |
(pr-save-interactive |
(pr-set-dir-args 'dir 'file-regexp "Print dir") |
3720 |
(pr-set-dir-args 'dir 'file-regexp "Print dir") |
(pr-file-list dir file-regexp 'pr-txt-buffer)) |
|
(pr-file-list dir file-regexp 'pr-txt-buffer))) |
|
3721 |
|
|
3722 |
|
|
3723 |
;;;###autoload |
;;;###autoload |
3765 |
save the image in a temporary file. If FILENAME is a string, save the |
save the image in a temporary file. If FILENAME is a string, save the |
3766 |
PostScript image in a file with that name." |
PostScript image in a file with that name." |
3767 |
(interactive (list (ps-print-preprint current-prefix-arg))) |
(interactive (list (ps-print-preprint current-prefix-arg))) |
3768 |
(pr-save-interactive |
(let ((file (pr-ps-file filename))) |
3769 |
(let ((file (pr-ps-file filename))) |
(when (stringp file) |
3770 |
(when (stringp file) |
(pr-despool-print file) |
3771 |
(pr-despool-print file) |
(pr-ps-file-preview file)))) |
|
(pr-ps-file-preview file))))) |
|
3772 |
|
|
3773 |
|
|
3774 |
;;;###autoload |
;;;###autoload |
3783 |
send the image to the printer. If FILENAME is a string, save the PostScript |
send the image to the printer. If FILENAME is a string, save the PostScript |
3784 |
image in a file with that name." |
image in a file with that name." |
3785 |
(interactive (list (ps-print-preprint current-prefix-arg))) |
(interactive (list (ps-print-preprint current-prefix-arg))) |
3786 |
(pr-save-interactive |
(let ((file (pr-ps-file filename))) |
3787 |
(let ((file (pr-ps-file filename))) |
(when (stringp file) |
3788 |
(when (stringp file) |
(pr-despool-print file) |
3789 |
(pr-despool-print file) |
(pr-ps-file-using-ghostscript file) |
3790 |
(pr-ps-file-using-ghostscript file) |
(or filename (pr-delete-file file))))) |
|
(or filename (pr-delete-file file)))))) |
|
3791 |
|
|
3792 |
|
|
3793 |
;;;###autoload |
;;;###autoload |
3802 |
send the image to the printer. If FILENAME is a string, save the PostScript |
send the image to the printer. If FILENAME is a string, save the PostScript |
3803 |
image in a file with that name." |
image in a file with that name." |
3804 |
(interactive (list (ps-print-preprint current-prefix-arg))) |
(interactive (list (ps-print-preprint current-prefix-arg))) |
3805 |
(pr-save-interactive |
(pr-save-file-modes |
3806 |
(pr-save-file-modes |
(let ((ps-lpr-command (pr-command pr-ps-command)) |
3807 |
(let ((ps-lpr-command (pr-command pr-ps-command)) |
(ps-lpr-switches pr-ps-switches) |
3808 |
(ps-lpr-switches pr-ps-switches) |
(ps-printer-name-option pr-ps-printer-switch) |
3809 |
(ps-printer-name-option pr-ps-printer-switch) |
(ps-printer-name pr-ps-printer)) |
3810 |
(ps-printer-name pr-ps-printer)) |
(ps-despool filename)))) |
|
(ps-despool filename))))) |
|
3811 |
|
|
3812 |
|
|
3813 |
;;;###autoload |
;;;###autoload |
3822 |
send the image to the printer. If FILENAME is a string, save the PostScript |
send the image to the printer. If FILENAME is a string, save the PostScript |
3823 |
image in a file with that name." |
image in a file with that name." |
3824 |
(interactive (list (ps-print-preprint current-prefix-arg))) |
(interactive (list (ps-print-preprint current-prefix-arg))) |
3825 |
(pr-save-interactive |
(if pr-print-using-ghostscript |
3826 |
(if pr-print-using-ghostscript |
(pr-despool-using-ghostscript filename) |
3827 |
(pr-despool-using-ghostscript filename) |
(pr-despool-print filename))) |
|
(pr-despool-print filename)))) |
|
3828 |
|
|
3829 |
|
|
3830 |
;;;###autoload |
;;;###autoload |
3839 |
(defun pr-ps-file-up-preview (n-up ifilename &optional ofilename) |
(defun pr-ps-file-up-preview (n-up ifilename &optional ofilename) |
3840 |
"Preview PostScript file FILENAME." |
"Preview PostScript file FILENAME." |
3841 |
(interactive (pr-interactive-n-up-inout "PS preview")) |
(interactive (pr-interactive-n-up-inout "PS preview")) |
3842 |
(pr-save-interactive |
(let ((outfile (pr-ps-utility-args 'n-up 'ifilename 'ofilename |
3843 |
(let ((outfile (pr-ps-utility-args 'n-up 'ifilename 'ofilename |
"PS preview "))) |
3844 |
"PS preview "))) |
(pr-ps-utility-process n-up ifilename outfile) |
3845 |
(pr-ps-utility-process n-up ifilename outfile) |
(pr-ps-file-preview outfile))) |
|
(pr-ps-file-preview outfile)))) |
|
3846 |
|
|
3847 |
|
|
3848 |
;;;###autoload |
;;;###autoload |
3850 |
"Print PostScript file FILENAME using ghostscript." |
"Print PostScript file FILENAME using ghostscript." |
3851 |
(interactive (list (pr-ps-infile-preprint "Print preview "))) |
(interactive (list (pr-ps-infile-preprint "Print preview "))) |
3852 |
(and (stringp filename) (file-exists-p filename) |
(and (stringp filename) (file-exists-p filename) |
3853 |
(pr-save-interactive |
(let* ((file (pr-expand-file-name filename)) |
3854 |
(let* ((file (pr-expand-file-name filename)) |
(tempfile (pr-dosify-file-name (make-temp-file file)))) |
3855 |
(tempfile (pr-dosify-file-name (make-temp-file file)))) |
;; gs use |
3856 |
;; gs use |
(pr-call-process pr-gs-command |
3857 |
(pr-call-process pr-gs-command |
(format "-sDEVICE=%s" pr-gs-device) |
3858 |
(format "-sDEVICE=%s" pr-gs-device) |
(format "-r%d" pr-gs-resolution) |
3859 |
(format "-r%d" pr-gs-resolution) |
(pr-switches-string pr-gs-switches "pr-gs-switches") |
3860 |
(pr-switches-string pr-gs-switches "pr-gs-switches") |
(format "-sOutputFile=\"%s\"" tempfile) |
3861 |
(format "-sOutputFile=\"%s\"" tempfile) |
file |
3862 |
file |
"-c quit") |
3863 |
"-c quit") |
;; printing |
3864 |
;; printing |
(pr-ps-file-print tempfile) |
3865 |
(pr-ps-file-print tempfile) |
;; deleting |
3866 |
;; deleting |
(pr-delete-file tempfile)))) |
|
(pr-delete-file tempfile))))) |
|
3867 |
|
|
3868 |
|
|
3869 |
;;;###autoload |
;;;###autoload |
3926 |
(if pr-print-using-ghostscript |
(if pr-print-using-ghostscript |
3927 |
"PS print GS" |
"PS print GS" |
3928 |
"PS print"))) |
"PS print"))) |
3929 |
(pr-save-interactive |
(let ((outfile (pr-ps-utility-args 'n-up 'ifilename 'ofilename |
3930 |
(let ((outfile (pr-ps-utility-args 'n-up 'ifilename 'ofilename |
(if pr-print-using-ghostscript |
3931 |
(if pr-print-using-ghostscript |
"PS print GS " |
3932 |
"PS print GS " |
"PS print ")))) |
3933 |
"PS print ")))) |
(pr-ps-utility-process n-up ifilename outfile) |
3934 |
(pr-ps-utility-process n-up ifilename outfile) |
(unless ofilename |
3935 |
(unless ofilename |
(pr-ps-file-ps-print outfile) |
3936 |
(pr-ps-file-ps-print outfile) |
(pr-delete-file outfile)))) |
|
(pr-delete-file outfile))))) |
|
3937 |
|
|
3938 |
|
|
3939 |
;;;###autoload |
;;;###autoload |
3940 |
(defun pr-toggle-file-duplex () |
(defun pr-toggle-file-duplex () |
3941 |
"Toggle duplex for PostScript file." |
"Toggle duplex for PostScript file." |
3942 |
(interactive) |
(interactive) |
3943 |
(pr-save-interactive |
(pr-toggle-file-duplex-menu t)) |
|
(pr-toggle 'pr-file-duplex "PS file duplex" nil 7 5 nil |
|
|
'("PostScript Print" "File")))) |
|
3944 |
|
|
3945 |
|
|
3946 |
;;;###autoload |
;;;###autoload |
3952 |
If tumble is on, produces a printing suitable for binding at the top or |
If tumble is on, produces a printing suitable for binding at the top or |
3953 |
bottom." |
bottom." |
3954 |
(interactive) |
(interactive) |
3955 |
(pr-save-interactive |
(pr-toggle-file-tumble-menu t)) |
|
(pr-toggle 'pr-file-tumble "PS file tumble" nil 8 5 nil |
|
|
'("PostScript Print" "File")))) |
|
3956 |
|
|
3957 |
|
|
3958 |
;;;###autoload |
;;;###autoload |
3959 |
(defun pr-toggle-file-landscape () |
(defun pr-toggle-file-landscape () |
3960 |
"Toggle landscape for PostScript file." |
"Toggle landscape for PostScript file." |
3961 |
(interactive) |
(interactive) |
3962 |
(pr-save-interactive |
(pr-toggle-file-landscape-menu t)) |
|
(pr-toggle 'pr-file-landscape "PS file landscape" nil 6 5 nil |
|
|
'("PostScript Print" "File")))) |
|
3963 |
|
|
3964 |
|
|
3965 |
;;;###autoload |
;;;###autoload |
3966 |
(defun pr-toggle-ghostscript () |
(defun pr-toggle-ghostscript () |
3967 |
"Toggle printing using ghostscript." |
"Toggle printing using ghostscript." |
3968 |
(interactive) |
(interactive) |
3969 |
(pr-save-interactive |
(pr-toggle-ghostscript-menu t)) |
|
(pr-toggle 'pr-print-using-ghostscript "Printing using ghostscript" |
|
|
'postscript-process 2 12 'toggle))) |
|
3970 |
|
|
3971 |
|
|
3972 |
;;;###autoload |
;;;###autoload |
3973 |
(defun pr-toggle-faces () |
(defun pr-toggle-faces () |
3974 |
"Toggle printing with faces." |
"Toggle printing with faces." |
3975 |
(interactive) |
(interactive) |
3976 |
(pr-save-interactive |
(pr-toggle-faces-menu t)) |
|
(pr-toggle 'pr-faces-p "Printing with faces" |
|
|
'postscript-process 1 12 'toggle))) |
|
3977 |
|
|
3978 |
|
|
3979 |
;;;###autoload |
;;;###autoload |
3980 |
(defun pr-toggle-spool () |
(defun pr-toggle-spool () |
3981 |
"Toggle spooling." |
"Toggle spooling." |
3982 |
(interactive) |
(interactive) |
3983 |
(pr-save-interactive |
(pr-toggle-spool-menu t)) |
|
(pr-toggle 'pr-spool-p "Spooling printing" |
|
|
'postscript-process 0 12 'toggle))) |
|
3984 |
|
|
3985 |
|
|
3986 |
;;;###autoload |
;;;###autoload |
3987 |
(defun pr-toggle-duplex () |
(defun pr-toggle-duplex () |
3988 |
"Toggle duplex." |
"Toggle duplex." |
3989 |
(interactive) |
(interactive) |
3990 |
(pr-save-interactive |
(pr-toggle-duplex-menu t)) |
|
(pr-toggle 'ps-spool-duplex "Printing duplex" |
|
|
'postscript-options 5 12 'toggle))) |
|
3991 |
|
|
3992 |
|
|
3993 |
;;;###autoload |
;;;###autoload |
3999 |
If tumble is on, produces a printing suitable for binding at the top or |
If tumble is on, produces a printing suitable for binding at the top or |
4000 |
bottom." |
bottom." |
4001 |
(interactive) |
(interactive) |
4002 |
(pr-save-interactive |
(pr-toggle-tumble-menu t)) |
|
(pr-toggle 'ps-spool-tumble "Tumble" |
|
|
'postscript-options 6 12 'toggle))) |
|
4003 |
|
|
4004 |
|
|
4005 |
;;;###autoload |
;;;###autoload |
4006 |
(defun pr-toggle-landscape () |
(defun pr-toggle-landscape () |
4007 |
"Toggle landscape." |
"Toggle landscape." |
4008 |
(interactive) |
(interactive) |
4009 |
(pr-save-interactive |
(pr-toggle-landscape-menu t)) |
|
(pr-toggle 'ps-landscape-mode "Landscape" |
|
|
'postscript-options 0 12 'toggle))) |
|
4010 |
|
|
4011 |
|
|
4012 |
;;;###autoload |
;;;###autoload |
4013 |
(defun pr-toggle-upside-down () |
(defun pr-toggle-upside-down () |
4014 |
"Toggle upside-down." |
"Toggle upside-down." |
4015 |
(interactive) |
(interactive) |
4016 |
(pr-save-interactive |
(pr-toggle-upside-down-menu t)) |
|
(pr-toggle 'ps-print-upside-down "Upside-Down" |
|
|
'postscript-options 7 12 'toggle))) |
|
4017 |
|
|
4018 |
|
|
4019 |
;;;###autoload |
;;;###autoload |
4020 |
(defun pr-toggle-line () |
(defun pr-toggle-line () |
4021 |
"Toggle line number." |
"Toggle line number." |
4022 |
(interactive) |
(interactive) |
4023 |
(pr-save-interactive |
(pr-toggle-line-menu t)) |
|
(pr-toggle 'ps-line-number "Line number" |
|
|
'postscript-options 3 12 'toggle))) |
|
4024 |
|
|
4025 |
|
|
4026 |
;;;###autoload |
;;;###autoload |
4027 |
(defun pr-toggle-zebra () |
(defun pr-toggle-zebra () |
4028 |
"Toggle zebra stripes." |
"Toggle zebra stripes." |
4029 |
(interactive) |
(interactive) |
4030 |
(pr-save-interactive |
(pr-toggle-zebra-menu t)) |
|
(pr-toggle 'ps-zebra-stripes "Zebra stripe" |
|
|
'postscript-options 4 12 'toggle))) |
|
4031 |
|
|
4032 |
|
|
4033 |
;;;###autoload |
;;;###autoload |
4034 |
(defun pr-toggle-header () |
(defun pr-toggle-header () |
4035 |
"Toggle printing header." |
"Toggle printing header." |
4036 |
(interactive) |
(interactive) |
4037 |
(pr-save-interactive |
(pr-toggle-header-menu t)) |
|
(pr-toggle 'ps-print-header "Print header" |
|
|
'postscript-options 1 12 'toggle))) |
|
4038 |
|
|
4039 |
|
|
4040 |
;;;###autoload |
;;;###autoload |
4041 |
(defun pr-toggle-header-frame () |
(defun pr-toggle-header-frame () |
4042 |
"Toggle printing header frame." |
"Toggle printing header frame." |
4043 |
(interactive) |
(interactive) |
4044 |
(pr-save-interactive |
(pr-toggle-header-frame-menu t)) |
|
(pr-toggle 'ps-print-header-frame "Print header frame" |
|
|
'postscript-options 2 12 'toggle))) |
|
4045 |
|
|
4046 |
|
|
4047 |
;;;###autoload |
;;;###autoload |
4048 |
(defun pr-toggle-lock () |
(defun pr-toggle-lock () |
4049 |
"Toggle menu lock." |
"Toggle menu lock." |
4050 |
(interactive) |
(interactive) |
4051 |
(pr-save-interactive |
(pr-toggle-lock-menu t)) |
|
(pr-toggle 'pr-menu-lock "Menu lock" |
|
|
'printing 2 12 'toggle))) |
|
4052 |
|
|
4053 |
|
|
4054 |
;;;###autoload |
;;;###autoload |
4055 |
(defun pr-toggle-region () |
(defun pr-toggle-region () |
4056 |
"Toggle auto region." |
"Toggle auto region." |
4057 |
(interactive) |
(interactive) |
4058 |
(pr-save-interactive |
(pr-toggle-region-menu t)) |
|
(pr-toggle 'pr-auto-region "Auto region" |
|
|
'printing 0 12 'toggle))) |
|
4059 |
|
|
4060 |
|
|
4061 |
;;;###autoload |
;;;###autoload |
4062 |
(defun pr-toggle-mode () |
(defun pr-toggle-mode () |
4063 |
"Toggle auto mode." |
"Toggle auto mode." |
4064 |
(interactive) |
(interactive) |
4065 |
(pr-save-interactive |
(pr-toggle-mode-menu t)) |
|
(pr-toggle 'pr-auto-mode "Auto mode" |
|
|
'printing 1 12 'toggle))) |
|
4066 |
|
|
4067 |
|
|
4068 |
;;;###autoload |
;;;###autoload |
4090 |
(defun pr-ps-name () |
(defun pr-ps-name () |
4091 |
"Interactively select a PostScript printer." |
"Interactively select a PostScript printer." |
4092 |
(interactive) |
(interactive) |
4093 |
(pr-save-interactive |
(pr-menu-set-ps-title |
4094 |
(pr-menu-set-ps-title |
(pr-complete-alist "PostScript printer" |
4095 |
(pr-complete-alist "PostScript printer" |
pr-ps-printer-alist pr-ps-name))) |
|
pr-ps-printer-alist pr-ps-name)))) |
|
4096 |
|
|
4097 |
|
|
4098 |
;;;###autoload |
;;;###autoload |
4099 |
(defun pr-txt-name () |
(defun pr-txt-name () |
4100 |
"Interactively select a text printer." |
"Interactively select a text printer." |
4101 |
(interactive) |
(interactive) |
4102 |
(pr-save-interactive |
(pr-menu-set-txt-title |
4103 |
(pr-menu-set-txt-title |
(pr-complete-alist "Text printer" |
4104 |
(pr-complete-alist "Text printer" |
pr-txt-printer-alist pr-txt-name))) |
|
pr-txt-printer-alist pr-txt-name)))) |
|
4105 |
|
|
4106 |
|
|
4107 |
;;;###autoload |
;;;###autoload |
4108 |
(defun pr-ps-utility () |
(defun pr-ps-utility () |
4109 |
"Interactively select a PostScript utility." |
"Interactively select a PostScript utility." |
4110 |
(interactive) |
(interactive) |
4111 |
(pr-save-interactive |
(pr-menu-set-utility-title |
4112 |
(pr-menu-set-utility-title |
(pr-complete-alist "Postscript utility" |
4113 |
(pr-complete-alist "Postscript utility" |
pr-ps-utility-alist pr-ps-utility))) |
|
pr-ps-utility-alist pr-ps-utility)))) |
|
4114 |
|
|
4115 |
|
|
4116 |
;;;###autoload |
;;;###autoload |
4201 |
are both set to t." |
are both set to t." |
4202 |
(interactive (list (pr-interactive-n-up (pr-prompt-gs "PS print fast")) |
(interactive (list (pr-interactive-n-up (pr-prompt-gs "PS print fast")) |
4203 |
current-prefix-arg)) |
current-prefix-arg)) |
4204 |
(pr-save-interactive |
(let ((pr-auto-region t) |
4205 |
(let ((pr-auto-region t) |
(pr-auto-mode t) |
4206 |
(pr-auto-mode t) |
filename) |
4207 |
filename) |
(cond ((null select)) |
4208 |
(cond ((null select)) |
((listp select) |
4209 |
((listp select) |
(pr-ps-name)) |
4210 |
(pr-ps-name)) |
((and (symbolp select) |
4211 |
((and (symbolp select) |
(assq select pr-ps-printer-alist)) |
4212 |
(assq select pr-ps-printer-alist)) |
(pr-menu-set-ps-title select)) |
4213 |
(pr-menu-set-ps-title select)) |
((integerp select) |
4214 |
((integerp select) |
(and (/= select 1) |
4215 |
(and (/= select 1) |
(pr-ps-name)) |
4216 |
(pr-ps-name)) |
(and (>= select 1) (not pr-spool-p) |
4217 |
(and (>= select 1) (not pr-spool-p) |
(setq filename (pr-ps-outfile-preprint |
4218 |
(setq filename (pr-ps-outfile-preprint |
(if pr-print-using-ghostscript |
4219 |
(if pr-print-using-ghostscript |
"Fast GS " |
4220 |
"Fast GS " |
"Fast ")))))) |
4221 |
"Fast ")))))) |
(pr-ps-buffer-ps-print |
4222 |
(pr-ps-buffer-ps-print |
(if (integerp n-up) |
4223 |
(if (integerp n-up) |
(min (max n-up 1) 100) |
4224 |
(min (max n-up 1) 100) |
(error "n-up must be an integer greater than zero")) |
4225 |
(error "n-up must be an integer greater than zero")) |
filename))) |
|
filename)))) |
|
4226 |
|
|
4227 |
|
|
4228 |
;;;###autoload |
;;;###autoload |
4250 |
Note that this command always behaves as if `pr-auto-region' and `pr-auto-mode' |
Note that this command always behaves as if `pr-auto-region' and `pr-auto-mode' |
4251 |
are both set to t." |
are both set to t." |
4252 |
(interactive (list current-prefix-arg)) |
(interactive (list current-prefix-arg)) |
4253 |
(pr-save-interactive |
(cond ((null select-printer)) |
4254 |
(cond ((null select-printer)) |
((and (symbolp select-printer) |
4255 |
((and (symbolp select-printer) |
(assq select-printer pr-txt-printer-alist)) |
4256 |
(assq select-printer pr-txt-printer-alist)) |
(pr-menu-set-txt-title select-printer)) |
4257 |
(pr-menu-set-txt-title select-printer)) |
(t |
4258 |
(t |
(pr-txt-name))) |
4259 |
(pr-txt-name))) |
(let ((pr-auto-region t) |
4260 |
(let ((pr-auto-region t) |
(pr-auto-mode t)) |
4261 |
(pr-auto-mode t)) |
(pr-txt-buffer))) |
|
(pr-txt-buffer)))) |
|
4262 |
|
|
4263 |
|
|
4264 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
4607 |
(defvar pr-menu-state nil) |
(defvar pr-menu-state nil) |
4608 |
|
|
4609 |
|
|
4610 |
(eval-and-compile |
(cond |
4611 |
(cond |
((featurep 'xemacs) |
4612 |
((eq ps-print-emacs-type 'xemacs) |
;; XEmacs |
4613 |
;; XEmacs |
(defvar current-mouse-event nil) ; to avoid compilation gripes |
4614 |
(defvar current-mouse-event nil) ; to avoid compilation gripes |
(defun pr-menu-position (entry index horizontal) |
4615 |
(defun pr-menu-position (entry index horizontal) |
(pr-x-make-event |
4616 |
(pr-x-make-event |
'button-release |
4617 |
'button-release |
(list 'button 1 |
4618 |
(list 'button 1 |
'x (- (pr-x-event-x-pixel current-mouse-event) ; X |
4619 |
'x (- (pr-x-event-x-pixel current-mouse-event) ; X |
(* horizontal pr-menu-char-width)) |
4620 |
(* horizontal pr-menu-char-width)) |
'y (- (pr-x-event-y-pixel current-mouse-event) ; Y |
4621 |
'y (- (pr-x-event-y-pixel current-mouse-event) ; Y |
(* (pr-menu-index entry index) pr-menu-char-height))))) |
4622 |
(* (pr-menu-index entry index) pr-menu-char-height))))) |
) |
4623 |
) |
(ps-windows-system |
4624 |
(ps-windows-system |
;; GNU Emacs for Windows 9x/NT |
4625 |
;; GNU Emacs for Windows 9x/NT |
(defun pr-menu-position (entry index horizontal) |
4626 |
(defun pr-menu-position (entry index horizontal) |
(let ((pos (cdr (pr-e-mouse-pixel-position)))) |
4627 |
(let ((pos (cdr (pr-e-mouse-pixel-position)))) |
(list |
4628 |
(list |
(list (or (car pos) 0) ; X |
4629 |
(list (or (car pos) 0) ; X |
(- (or (cdr pos) 0) ; Y |
4630 |
(- (or (cdr pos) 0) ; Y |
(* (pr-menu-index entry index) pr-menu-char-height))) |
4631 |
(* (pr-menu-index entry index) pr-menu-char-height))) |
(selected-frame)))) ; frame |
4632 |
(selected-frame)))) ; frame |
) |
4633 |
) |
(t |
4634 |
(t |
;; GNU Emacs |
4635 |
;; GNU Emacs |
(defun pr-menu-position (entry index horizontal) |
4636 |
(defun pr-menu-position (entry index horizontal) |
(let ((pos (cdr (pr-e-mouse-pixel-position)))) |
4637 |
(let ((pos (cdr (pr-e-mouse-pixel-position)))) |
(list |
4638 |
(list |
(list (- (or (car pos) 0) ; X |
4639 |
(list (- (or (car pos) 0) ; X |
(* horizontal pr-menu-char-width)) |
4640 |
(* horizontal pr-menu-char-width)) |
(- (or (cdr pos) 0) ; Y |
4641 |
(- (or (cdr pos) 0) ; Y |
(* (pr-menu-index entry index) pr-menu-char-height))) |
4642 |
(* (pr-menu-index entry index) pr-menu-char-height))) |
(selected-frame)))) ; frame |
4643 |
(selected-frame)))) ; frame |
)) |
|
)) |
|
4644 |
|
|
4645 |
(cond |
(cond |
4646 |
((eq ps-print-emacs-type 'emacs) |
((featurep 'xemacs) |
4647 |
;; GNU Emacs |
;; XEmacs |
4648 |
(defun pr-menu-lookup (path) |
(defvar current-menubar nil) ; to avoid compilation gripes |
4649 |
(let ((ipath pr-menu-bar)) |
(defun pr-menu-lookup (path) |
4650 |
(lookup-key global-map |
(car (pr-x-find-menu-item current-menubar (cons "Printing" path)))) |
4651 |
(if path |
|
4652 |
(vconcat ipath |
;; XEmacs |
4653 |
(mapcar 'pr-get-symbol |
(defun pr-menu-lock (entry index horizontal state path) |
4654 |
(if (listp path) |
(when pr-menu-lock |
4655 |
path |
(or (and pr-menu-position (eq state pr-menu-state)) |
4656 |
(list path)))) |
(setq pr-menu-position (pr-menu-position entry index horizontal) |
4657 |
ipath)))) |
pr-menu-state state)) |
4658 |
|
(let* ((menu (pr-menu-lookup path)) |
4659 |
;; GNU Emacs |
(result (pr-x-get-popup-menu-response menu pr-menu-position))) |
4660 |
(defun pr-menu-lock (entry index horizontal state path) |
(and (pr-x-misc-user-event-p result) |
4661 |
(when (and (not pr-interactive-p) pr-menu-lock) |
(funcall (pr-x-event-function result) |
4662 |
(or (and pr-menu-position (eq state pr-menu-state)) |
(pr-x-event-object result)))) |
4663 |
(setq pr-menu-position (pr-menu-position entry index horizontal) |
(setq pr-menu-position nil)))) |
4664 |
pr-menu-state state)) |
|
4665 |
(let* ((menu (pr-menu-lookup path)) |
|
4666 |
(result (x-popup-menu pr-menu-position menu))) |
(t |
4667 |
(and result |
;; GNU Emacs |
4668 |
(let ((command (lookup-key menu (vconcat result)))) |
(defun pr-menu-lookup (path) |
4669 |
(if (fboundp command) |
(lookup-key global-map |
4670 |
(funcall command) |
(if path |
4671 |
(eval command))))) |
(vconcat pr-menu-bar |
4672 |
(setq pr-menu-position nil)))) |
(mapcar 'pr-get-symbol |
4673 |
|
(if (listp path) |
4674 |
|
path |
4675 |
((eq ps-print-emacs-type 'xemacs) |
(list path)))) |
4676 |
;; XEmacs |
pr-menu-bar))) |
4677 |
(defvar current-menubar nil) ; to avoid compilation gripes |
|
4678 |
(defun pr-menu-lookup (path) |
;; GNU Emacs |
4679 |
(car (pr-x-find-menu-item current-menubar (cons "Printing" path)))) |
(defun pr-menu-lock (entry index horizontal state path) |
4680 |
|
(when pr-menu-lock |
4681 |
;; XEmacs |
(or (and pr-menu-position (eq state pr-menu-state)) |
4682 |
(defun pr-menu-lock (entry index horizontal state path) |
(setq pr-menu-position (pr-menu-position entry index horizontal) |
4683 |
(when (and (not pr-interactive-p) pr-menu-lock) |
pr-menu-state state)) |
4684 |
(or (and pr-menu-position (eq state pr-menu-state)) |
(let* ((menu (pr-menu-lookup path)) |
4685 |
(setq pr-menu-position (pr-menu-position entry index horizontal) |
(result (x-popup-menu pr-menu-position menu))) |
4686 |
pr-menu-state state)) |
(and result |
4687 |
(let* ((menu (pr-menu-lookup path)) |
(let ((command (lookup-key menu (vconcat result)))) |
4688 |
(result (pr-x-get-popup-menu-response menu pr-menu-position))) |
(if (fboundp command) |
4689 |
(and (pr-x-misc-user-event-p result) |
(funcall command) |
4690 |
(funcall (pr-x-event-function result) |
(eval command))))) |
4691 |
(pr-x-event-object result)))) |
(setq pr-menu-position nil))))) |
|
(setq pr-menu-position nil)))))) |
|
4692 |
|
|
4693 |
|
|
4694 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
4710 |
non-nil, and update PostScript File menus iff `pr-ps-utility-menu-modified' is |
non-nil, and update PostScript File menus iff `pr-ps-utility-menu-modified' is |
4711 |
non-nil." |
non-nil." |
4712 |
(interactive "P") |
(interactive "P") |
4713 |
(pr-save-interactive |
(pr-update-var 'pr-ps-name pr-ps-printer-alist) |
4714 |
(pr-update-var 'pr-ps-name pr-ps-printer-alist) |
(pr-update-var 'pr-txt-name pr-txt-printer-alist) |
4715 |
(pr-update-var 'pr-txt-name pr-txt-printer-alist) |
(pr-update-var 'pr-ps-utility pr-ps-utility-alist) |
4716 |
(pr-update-var 'pr-ps-utility pr-ps-utility-alist) |
(pr-do-update-menus force)) |
|
(pr-do-update-menus force))) |
|
4717 |
|
|
4718 |
|
|
4719 |
(defvar pr-ps-printer-menu-modified t |
(defvar pr-ps-printer-menu-modified t |
4745 |
alist))) |
alist))) |
4746 |
|
|
4747 |
|
|
4748 |
(eval-and-compile |
(cond |
4749 |
(cond |
((featurep 'xemacs) |
4750 |
((eq ps-print-emacs-type 'emacs) |
;; XEmacs |
4751 |
;; GNU Emacs |
(defalias 'pr-update-mode-line 'set-menubar-dirty-flag) |
4752 |
(defalias 'pr-update-mode-line 'force-mode-line-update) |
|
4753 |
|
;; XEmacs |
4754 |
;; GNU Emacs |
(defvar pr-ps-name-old "PostScript Printers") |
4755 |
(defun pr-do-update-menus (&optional force) |
(defvar pr-txt-name-old "Text Printers") |
4756 |
(pr-menu-alist pr-ps-printer-alist |
(defvar pr-ps-utility-old "PostScript Utility") |
4757 |
'pr-ps-name |
(defvar pr-even-or-odd-old "Print All Pages") |
4758 |
'pr-menu-set-ps-title |
|
4759 |
"PostScript Printers" |
;; XEmacs |
4760 |
'pr-ps-printer-menu-modified |
(defun pr-do-update-menus (&optional force) |
4761 |
force |
(pr-menu-alist pr-ps-printer-alist |
4762 |
"PostScript Printers" |
'pr-ps-name |
4763 |
'postscript 2) |
'pr-menu-set-ps-title |
4764 |
(pr-menu-alist pr-txt-printer-alist |
'("Printing") |
4765 |
'pr-txt-name |
'pr-ps-printer-menu-modified |
4766 |
'pr-menu-set-txt-title |
force |
4767 |
"Text Printers" |
pr-ps-name-old |
4768 |
'pr-txt-printer-menu-modified |
'postscript 2) |
4769 |
force |
(pr-menu-alist pr-txt-printer-alist |
4770 |
"Text Printers" |
'pr-txt-name |
4771 |
'text 2) |
'pr-menu-set-txt-title |
4772 |
(let ((save-var pr-ps-utility-menu-modified)) |
'("Printing") |
4773 |
(pr-menu-alist pr-ps-utility-alist |
'pr-txt-printer-menu-modified |
4774 |
'pr-ps-utility |
force |
4775 |
'pr-menu-set-utility-title |
pr-txt-name-old |
4776 |
'("PostScript Print" "File" "PostScript Utility") |
'text 2) |
4777 |
'save-var |
(let ((save-var pr-ps-utility-menu-modified)) |
|
force |
|
|
"PostScript Utility" |
|
|
nil 1)) |
|
4778 |
(pr-menu-alist pr-ps-utility-alist |
(pr-menu-alist pr-ps-utility-alist |
4779 |
'pr-ps-utility |
'pr-ps-utility |
4780 |
'pr-menu-set-utility-title |
'pr-menu-set-utility-title |
4781 |
'("PostScript Preview" "File" "PostScript Utility") |
'("Printing" "PostScript Print" "File") |
4782 |
'pr-ps-utility-menu-modified |
'save-var |
4783 |
force |
force |
4784 |
"PostScript Utility" |
pr-ps-utility-old |
4785 |
nil 1) |
nil 1)) |
4786 |
(pr-even-or-odd-pages ps-even-or-odd-pages force)) |
(pr-menu-alist pr-ps-utility-alist |
4787 |
|
'pr-ps-utility |
4788 |
|
'pr-menu-set-utility-title |
4789 |
|
'("Printing" "PostScript Preview" "File") |
4790 |
|
'pr-ps-utility-menu-modified |
4791 |
|
force |
4792 |
|
pr-ps-utility-old |
4793 |
|
nil 1) |
4794 |
|
(pr-even-or-odd-pages ps-even-or-odd-pages force)) |
4795 |
|
|
4796 |
;; GNU Emacs |
;; XEmacs |
4797 |
(defvar pr-temp-menu nil) |
(defun pr-menu-alist (alist var-sym fun menu-path modified-sym force name |
4798 |
|
entry index) |
4799 |
|
(when (and alist (or force (symbol-value modified-sym))) |
4800 |
|
(pr-xemacs-global-menubar |
4801 |
|
(pr-x-add-submenu menu-path |
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 |
;; GNU Emacs |
;; XEmacs |
4808 |
(defun pr-menu-alist (alist var-sym fun menu-path modified-sym force name |
(defun pr-relabel-menu-item (newname var-sym) |
4809 |
entry index) |
(pr-xemacs-global-menubar |
4810 |
(when (and alist (or force (symbol-value modified-sym))) |
(pr-x-relabel-menu-item |
4811 |
(easy-menu-define pr-temp-menu nil "" |
(list "Printing" (symbol-value var-sym)) |
4812 |
(pr-menu-create name alist var-sym fun entry index)) |
newname) |
4813 |
(let ((item (pr-menu-get-item menu-path))) |
(set var-sym newname))) |
4814 |
(and item |
|
4815 |
(let* ((binding (nthcdr 3 item)) |
;; XEmacs |
4816 |
(key-binding (cdr binding))) |
(defun pr-menu-set-ps-title (value &optional item entry index) |
4817 |
(setcar binding pr-temp-menu) |
(pr-relabel-menu-item (format "PostScript Printer: %s" value) |
4818 |
(and key-binding (listp (car key-binding)) |
'pr-ps-name-old) |
4819 |
(setcdr binding (cdr key-binding))) ; skip KEY-BINDING |
(pr-ps-set-printer value) |
4820 |
(funcall fun (symbol-value var-sym) item)))) |
(and index |
4821 |
(set modified-sym nil))) |
(pr-menu-lock entry index 12 'toggle nil))) |
4822 |
|
|
4823 |
;; GNU Emacs |
;; XEmacs |
4824 |
(defun pr-menu-set-ps-title (value &optional item entry index) |
(defun pr-menu-set-txt-title (value &optional item entry index) |
4825 |
(pr-menu-set-item-name (or item |
(pr-relabel-menu-item (format "Text Printer: %s" value) |
4826 |
(pr-menu-get-item "PostScript Printers")) |
'pr-txt-name-old) |
4827 |
(format "PostScript Printer: %s" value)) |
(pr-txt-set-printer value) |
4828 |
(pr-ps-set-printer value) |
(and index |
4829 |
(and index |
(pr-menu-lock entry index 12 'toggle nil))) |
4830 |
(pr-menu-lock entry index 12 'toggle nil))) |
|
4831 |
|
;; XEmacs |
4832 |
;; GNU Emacs |
(defun pr-menu-set-utility-title (value &optional item entry index) |
4833 |
(defun pr-menu-set-txt-title (value &optional item entry index) |
(pr-xemacs-global-menubar |
4834 |
(pr-menu-set-item-name (or item |
(let ((newname (format "%s" value))) |
4835 |
(pr-menu-get-item "Text Printers")) |
(pr-x-relabel-menu-item |
4836 |
(format "Text Printer: %s" value)) |
(list "Printing" "PostScript Print" "File" pr-ps-utility-old) |
4837 |
(pr-txt-set-printer value) |
newname) |
4838 |
(and index |
(pr-x-relabel-menu-item |
4839 |
(pr-menu-lock entry index 12 'toggle nil))) |
(list "Printing" "PostScript Preview" "File" pr-ps-utility-old) |
4840 |
|
newname) |
4841 |
;; GNU Emacs |
(setq pr-ps-utility-old newname))) |
4842 |
(defun pr-menu-set-utility-title (value &optional item entry index) |
(pr-ps-set-utility value) |
4843 |
(let ((name (symbol-name value))) |
(and index |
4844 |
(if item |
(pr-menu-lock entry index 5 nil '("PostScript Print" "File")))) |
4845 |
(pr-menu-set-item-name item name) |
|
4846 |
(pr-menu-set-item-name |
;; XEmacs |
4847 |
(pr-menu-get-item |
(defun pr-even-or-odd-pages (value &optional no-lock) |
4848 |
'("PostScript Print" "File" "PostScript Utility")) |
(pr-relabel-menu-item (cdr (assq value pr-even-or-odd-alist)) |
4849 |
name) |
'pr-even-or-odd-old) |
4850 |
(pr-menu-set-item-name |
(setq ps-even-or-odd-pages value) |
4851 |
(pr-menu-get-item |
(or no-lock |
4852 |
'("PostScript Preview" "File" "PostScript Utility")) |
(pr-menu-lock 'postscript-options 8 12 'toggle nil)))) |
4853 |
name))) |
|
4854 |
(pr-ps-set-utility value) |
|
4855 |
(and index |
(t |
4856 |
(pr-menu-lock entry index 5 nil '("PostScript Print" "File")))) |
;; GNU Emacs |
4857 |
|
(defalias 'pr-update-mode-line 'force-mode-line-update) |
4858 |
;; GNU Emacs |
|
4859 |
(defun pr-even-or-odd-pages (value &optional no-lock) |
;; GNU Emacs |
4860 |
(pr-menu-set-item-name (pr-menu-get-item "Print All Pages") |
(defun pr-do-update-menus (&optional force) |
4861 |
(cdr (assq value pr-even-or-odd-alist))) |
(pr-menu-alist pr-ps-printer-alist |
4862 |
(setq ps-even-or-odd-pages value) |
'pr-ps-name |
4863 |
(or no-lock |
'pr-menu-set-ps-title |
4864 |
(pr-menu-lock 'postscript-options 8 12 'toggle nil)))) |
"PostScript Printers" |
4865 |
|
'pr-ps-printer-menu-modified |
4866 |
|
force |
4867 |
((eq ps-print-emacs-type 'xemacs) |
"PostScript Printers" |
4868 |
;; XEmacs |
'postscript 2) |
4869 |
(defalias 'pr-update-mode-line 'set-menubar-dirty-flag) |
(pr-menu-alist pr-txt-printer-alist |
4870 |
|
'pr-txt-name |
4871 |
;; XEmacs |
'pr-menu-set-txt-title |
4872 |
(defvar pr-ps-name-old "PostScript Printers") |
"Text Printers" |
4873 |
(defvar pr-txt-name-old "Text Printers") |
'pr-txt-printer-menu-modified |
4874 |
(defvar pr-ps-utility-old "PostScript Utility") |
force |
4875 |
(defvar pr-even-or-odd-old "Print All Pages") |
"Text Printers" |
4876 |
|
'text 2) |
4877 |
;; XEmacs |
(let ((save-var pr-ps-utility-menu-modified)) |
|
(defun pr-do-update-menus (&optional force) |
|
|
(pr-menu-alist pr-ps-printer-alist |
|
|
'pr-ps-name |
|
|
'pr-menu-set-ps-title |
|
|
'("Printing") |
|
|
'pr-ps-printer-menu-modified |
|
|
force |
|
|
pr-ps-name-old |
|
|
'postscript 2) |
|
|
(pr-menu-alist pr-txt-printer-alist |
|
|
'pr-txt-name |
|
|
'pr-menu-set-txt-title |
|
|
'("Printing") |
|
|
'pr-txt-printer-menu-modified |
|
|
force |
|
|
pr-txt-name-old |
|
|
'text 2) |
|
|
(let ((save-var pr-ps-utility-menu-modified)) |
|
|
(pr-menu-alist pr-ps-utility-alist |
|
|
'pr-ps-utility |
|
|
'pr-menu-set-utility-title |
|
|
'("Printing" "PostScript Print" "File") |
|
|
'save-var |
|
|
force |
|
|
pr-ps-utility-old |
|
|
nil 1)) |
|
4878 |
(pr-menu-alist pr-ps-utility-alist |
(pr-menu-alist pr-ps-utility-alist |
4879 |
'pr-ps-utility |
'pr-ps-utility |
4880 |
'pr-menu-set-utility-title |
'pr-menu-set-utility-title |
4881 |
'("Printing" "PostScript Preview" "File") |
'("PostScript Print" "File" "PostScript Utility") |
4882 |
'pr-ps-utility-menu-modified |
'save-var |
4883 |
force |
force |
4884 |
pr-ps-utility-old |
"PostScript Utility" |
4885 |
nil 1) |
nil 1)) |
4886 |
(pr-even-or-odd-pages ps-even-or-odd-pages force)) |
(pr-menu-alist pr-ps-utility-alist |
4887 |
|
'pr-ps-utility |
4888 |
|
'pr-menu-set-utility-title |
4889 |
|
'("PostScript Preview" "File" "PostScript Utility") |
4890 |
|
'pr-ps-utility-menu-modified |
4891 |
|
force |
4892 |
|
"PostScript Utility" |
4893 |
|
nil 1) |
4894 |
|
(pr-even-or-odd-pages ps-even-or-odd-pages force)) |
4895 |
|
|
4896 |
;; XEmacs |
;; GNU Emacs |
4897 |
(defun pr-menu-alist (alist var-sym fun menu-path modified-sym force name |
(defun pr-menu-get-item (name-list) |
4898 |
entry index) |
;; NAME-LIST is a string or a list of strings. |
4899 |
(when (and alist (or force (symbol-value modified-sym))) |
(or (listp name-list) |
4900 |
(pr-xemacs-global-menubar |
(setq name-list (list name-list))) |
4901 |
(pr-x-add-submenu menu-path |
(and name-list |
4902 |
(pr-menu-create name alist var-sym |
(let* ((reversed (reverse name-list)) |
4903 |
fun entry index))) |
(name (pr-get-symbol (car reversed))) |
4904 |
(funcall fun (symbol-value var-sym)) |
(path (nreverse (cdr reversed))) |
4905 |
(set modified-sym nil))) |
(menu (lookup-key |
4906 |
|
global-map |
4907 |
;; XEmacs |
(vconcat pr-menu-bar |
4908 |
(defun pr-menu-set-ps-title (value &optional item entry index) |
(mapcar 'pr-get-symbol path))))) |
4909 |
(pr-relabel-menu-item (format "PostScript Printer: %s" value) |
(assq name (nthcdr 2 menu))))) |
|
'pr-ps-name-old) |
|
|
(pr-ps-set-printer value) |
|
|
(and index |
|
|
(pr-menu-lock entry index 12 'toggle nil))) |
|
|
|
|
|
;; XEmacs |
|
|
(defun pr-menu-set-txt-title (value &optional item entry index) |
|
|
(pr-relabel-menu-item (format "Text Printer: %s" value) |
|
|
'pr-txt-name-old) |
|
|
(pr-txt-set-printer value) |
|
|
(and index |
|
|
(pr-menu-lock entry index 12 'toggle nil))) |
|
4910 |
|
|
4911 |
;; XEmacs |
;; GNU Emacs |
4912 |
(defun pr-menu-set-utility-title (value &optional item entry index) |
(defvar pr-temp-menu nil) |
|
(pr-xemacs-global-menubar |
|
|
(let ((newname (format "%s" value))) |
|
|
(pr-x-relabel-menu-item |
|
|
(list "Printing" "PostScript Print" "File" pr-ps-utility-old) |
|
|
newname) |
|
|
(pr-x-relabel-menu-item |
|
|
(list "Printing" "PostScript Preview" "File" pr-ps-utility-old) |
|
|
newname) |
|
|
(setq pr-ps-utility-old newname))) |
|
|
(pr-ps-set-utility value) |
|
|
(and index |
|
|
(pr-menu-lock entry index 5 nil '("PostScript Print" "File")))) |
|
|
|
|
|
;; XEmacs |
|
|
(defun pr-even-or-odd-pages (value &optional no-lock) |
|
|
(pr-relabel-menu-item (cdr (assq value pr-even-or-odd-alist)) |
|
|
'pr-even-or-odd-old) |
|
|
(setq ps-even-or-odd-pages value) |
|
|
(or no-lock |
|
|
(pr-menu-lock 'postscript-options 8 12 'toggle nil)))))) |
|
4913 |
|
|
4914 |
;; XEmacs |
;; GNU Emacs |
4915 |
(defun pr-relabel-menu-item (newname var-sym) |
(defun pr-menu-alist (alist var-sym fun menu-path modified-sym force name |
4916 |
(pr-xemacs-global-menubar |
entry index) |
4917 |
(pr-x-relabel-menu-item |
(when (and alist (or force (symbol-value modified-sym))) |
4918 |
(list "Printing" (symbol-value var-sym)) |
(easy-menu-define pr-temp-menu nil "" |
4919 |
newname) |
(pr-menu-create name alist var-sym fun entry index)) |
4920 |
(set var-sym newname))) |
(let ((item (pr-menu-get-item menu-path))) |
4921 |
|
(and item |
4922 |
|
(let* ((binding (nthcdr 3 item)) |
4923 |
|
(key-binding (cdr binding))) |
4924 |
|
(setcar binding pr-temp-menu) |
4925 |
|
(and key-binding (listp (car key-binding)) |
4926 |
|
(setcdr binding (cdr key-binding))) ; skip KEY-BINDING |
4927 |
|
(funcall fun (symbol-value var-sym) item)))) |
4928 |
|
(set modified-sym nil))) |
4929 |
|
|
4930 |
;; GNU Emacs |
;; GNU Emacs |
4931 |
(defun pr-menu-set-item-name (item name) |
(defun pr-menu-set-item-name (item name) |
4932 |
(and item |
(and item |
4933 |
(setcar (nthcdr 2 item) name))) ; ITEM-NAME |
(setcar (nthcdr 2 item) name))) ; ITEM-NAME |
4934 |
|
|
4935 |
;; GNU Emacs |
;; GNU Emacs |
4936 |
(defun pr-menu-get-item (name-list) |
(defun pr-menu-set-ps-title (value &optional item entry index) |
4937 |
;; NAME-LIST is a string or a list of strings. |
(pr-menu-set-item-name (or item |
4938 |
(let ((ipath pr-menu-bar) |
(pr-menu-get-item "PostScript Printers")) |
4939 |
(len (and (listp name-list) (length name-list)))) |
(format "PostScript Printer: %s" value)) |
4940 |
(and len (= len 1) |
(pr-ps-set-printer value) |
4941 |
(setq name-list (car name-list))) |
(and index |
4942 |
(cond |
(pr-menu-lock entry index 12 'toggle nil))) |
4943 |
((null name-list) |
|
4944 |
;; nil |
;; GNU Emacs |
4945 |
nil) |
(defun pr-menu-set-txt-title (value &optional item entry index) |
4946 |
((listp name-list) |
(pr-menu-set-item-name (or item |
4947 |
;; list and (length list) > 1 |
(pr-menu-get-item "Text Printers")) |
4948 |
(let* ((copy (copy-sequence name-list)) |
(format "Text Printer: %s" value)) |
4949 |
(name (pr-get-symbol (nth (1- len) copy))) |
(pr-txt-set-printer value) |
4950 |
(path (progn |
(and index |
4951 |
(setcdr (nthcdr (- len 2) copy) nil) |
(pr-menu-lock entry index 12 'toggle nil))) |
4952 |
copy)) |
|
4953 |
(menu (lookup-key |
;; GNU Emacs |
4954 |
global-map |
(defun pr-menu-set-utility-title (value &optional item entry index) |
4955 |
(if path |
(let ((name (symbol-name value))) |
4956 |
(vconcat ipath |
(if item |
4957 |
(mapcar 'pr-get-symbol path)) |
(pr-menu-set-item-name item name) |
4958 |
ipath)))) |
(pr-menu-set-item-name |
4959 |
(assq name (nthcdr 2 menu)))) |
(pr-menu-get-item |
4960 |
(t |
'("PostScript Print" "File" "PostScript Utility")) |
4961 |
;; string |
name) |
4962 |
(let ((name (pr-get-symbol name-list)) |
(pr-menu-set-item-name |
4963 |
(menu (lookup-key global-map ipath))) |
(pr-menu-get-item |
4964 |
(assq name (nthcdr 2 menu))))))) |
'("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))))) |
4977 |
|
|
4978 |
|
|
4979 |
(defun pr-ps-set-utility (value) |
(defun pr-ps-set-utility (value) |
5105 |
;; Internal Functions (II) |
;; Internal Functions (II) |
5106 |
|
|
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 |
|
|
5218 |
(defun pr-prompt (str) |
(defun pr-prompt (str) |
5219 |
(if (pr-auto-mode-p) |
(if (pr-auto-mode-p) |
5220 |
(concat str " mode") |
(concat str " mode") |
5315 |
(pr-expand-file-name res))) |
(pr-expand-file-name res))) |
5316 |
|
|
5317 |
|
|
|
(defun pr-toggle (var-sym mess entry index horizontal state &optional path) |
|
|
(set var-sym (not (symbol-value var-sym))) |
|
|
(message "%s is %s" mess (if (symbol-value var-sym) "on" "off")) |
|
|
(pr-menu-lock entry index horizontal state path)) |
|
|
|
|
|
|
|
5318 |
(defun pr-ps-utility-args (n-up-sym infile-sym outfile-sym prompt) |
(defun pr-ps-utility-args (n-up-sym infile-sym outfile-sym prompt) |
5319 |
|
;; check arguments for PostScript file processing. |
5320 |
;; n-up |
;; n-up |
5321 |
(or (symbol-value n-up-sym) |
(or (symbol-value n-up-sym) |
5322 |
(set n-up-sym (pr-interactive-n-up prompt))) |
(set n-up-sym (pr-interactive-n-up prompt))) |
|
(and (eq (symbol-value infile-sym) t) |
|
|
(set infile-sym (and (not pr-interactive-p) |
|
|
(pr-ps-infile-preprint prompt)))) |
|
5323 |
;; input file |
;; input file |
5324 |
|
(and (eq (symbol-value infile-sym) t) |
5325 |
|
(set infile-sym (pr-ps-infile-preprint prompt))) |
5326 |
(or (symbol-value infile-sym) |
(or (symbol-value infile-sym) |
5327 |
(error "%s: input PostScript file name is missing" prompt)) |
(error "%s: input PostScript file name is missing" prompt)) |
5328 |
(set infile-sym (pr-dosify-file-name (symbol-value infile-sym))) |
(set infile-sym (pr-dosify-file-name (symbol-value infile-sym))) |
5329 |
;; output file |
;; output file |
5330 |
(and (eq (symbol-value outfile-sym) t) |
(and (eq (symbol-value outfile-sym) t) |
5331 |
(set outfile-sym (and (not pr-interactive-p) |
(set outfile-sym (and current-prefix-arg |
|
current-prefix-arg |
|
5332 |
(pr-ps-outfile-preprint prompt)))) |
(pr-ps-outfile-preprint prompt)))) |
5333 |
(and (symbol-value outfile-sym) |
(and (symbol-value outfile-sym) |
5334 |
(set outfile-sym (pr-dosify-file-name (symbol-value outfile-sym)))) |
(set outfile-sym (pr-dosify-file-name (symbol-value outfile-sym)))) |
5336 |
|
|
5337 |
|
|
5338 |
(defun pr-ps-utility-process (n-up infile outfile) |
(defun pr-ps-utility-process (n-up infile outfile) |
5339 |
|
;; activate utility to process a PostScript file. |
5340 |
(let (item) |
(let (item) |
5341 |
(and (stringp infile) (file-exists-p infile) |
(and (stringp infile) (file-exists-p infile) |
5342 |
(setq item (cdr (assq pr-ps-utility pr-ps-utility-alist))) |
(setq item (cdr (assq pr-ps-utility pr-ps-utility-alist))) |
5448 |
|
|
5449 |
(defun pr-ps-file (&optional filename) |
(defun pr-ps-file (&optional filename) |
5450 |
(pr-dosify-file-name (or filename |
(pr-dosify-file-name (or filename |
5451 |
(convert-standard-filename |
(make-temp-file |
5452 |
(expand-file-name pr-ps-temp-file pr-temp-dir))))) |
(convert-standard-filename |
5453 |
|
(expand-file-name pr-ps-temp-file pr-temp-dir)) |
5454 |
|
nil ".ps")))) |
5455 |
|
|
5456 |
|
|
5457 |
(defun pr-interactive-n-up (mess) |
(defun pr-interactive-n-up (mess) |
5540 |
(defun pr-set-outfilename (filename-sym) |
(defun pr-set-outfilename (filename-sym) |
5541 |
(and (not pr-spool-p) |
(and (not pr-spool-p) |
5542 |
(eq (symbol-value filename-sym) t) |
(eq (symbol-value filename-sym) t) |
5543 |
(set filename-sym (and (not pr-interactive-p) |
(set filename-sym (and current-prefix-arg |
|
current-prefix-arg |
|
5544 |
(ps-print-preprint current-prefix-arg)))) |
(ps-print-preprint current-prefix-arg)))) |
5545 |
(and (symbol-value filename-sym) |
(and (symbol-value filename-sym) |
5546 |
(set filename-sym (pr-dosify-file-name (symbol-value filename-sym))))) |
(set filename-sym (pr-dosify-file-name (symbol-value filename-sym))))) |
5776 |
(defvar pr-interface-map nil |
(defvar pr-interface-map nil |
5777 |
"Keymap for pr-interface.") |
"Keymap for pr-interface.") |
5778 |
|
|
5779 |
(if pr-interface-map |
(unless pr-interface-map |
|
nil |
|
5780 |
(setq pr-interface-map (make-sparse-keymap)) |
(setq pr-interface-map (make-sparse-keymap)) |
5781 |
(cond ((eq ps-print-emacs-type 'xemacs) ; XEmacs |
(cond ((featurep 'xemacs) ; XEmacs |
5782 |
(pr-f-set-keymap-parents pr-interface-map (list widget-keymap)) |
(pr-f-set-keymap-parents pr-interface-map (list widget-keymap)) |
5783 |
(pr-f-set-keymap-name pr-interface-map 'pr-interface-map)) |
(pr-f-set-keymap-name pr-interface-map 'pr-interface-map)) |
5784 |
((eq ps-print-emacs-type 'emacs) ; GNU Emacs |
(t ; GNU Emacs |
5785 |
(pr-f-set-keymap-parents pr-interface-map widget-keymap))) |
(pr-f-set-keymap-parents pr-interface-map widget-keymap))) |
5786 |
(define-key pr-interface-map "q" 'pr-interface-quit) |
(define-key pr-interface-map "q" 'pr-interface-quit) |
5787 |
(define-key pr-interface-map "?" 'pr-interface-help)) |
(define-key pr-interface-map "?" 'pr-interface-help)) |
6208 |
(defun pr-interface-ps-print (&rest ignore) |
(defun pr-interface-ps-print (&rest ignore) |
6209 |
"Print using ps-print package." |
"Print using ps-print package." |
6210 |
(interactive) |
(interactive) |
6211 |
(pr-save-interactive |
(pr-interface-ps 'pr-despool-ps-print 'pr-ps-directory-ps-print |
6212 |
(pr-interface-ps 'pr-despool-ps-print 'pr-ps-directory-ps-print |
'pr-ps-file-ps-print 'pr-ps-file-up-ps-print |
6213 |
'pr-ps-file-ps-print 'pr-ps-file-up-ps-print |
'pr-ps-region-ps-print 'pr-ps-mode-ps-print |
6214 |
'pr-ps-region-ps-print 'pr-ps-mode-ps-print |
'pr-ps-buffer-ps-print)) |
|
'pr-ps-buffer-ps-print))) |
|
6215 |
|
|
6216 |
|
|
6217 |
(defun pr-interface-preview (&rest ignore) |
(defun pr-interface-preview (&rest ignore) |
6218 |
"Preview a PostScript file." |
"Preview a PostScript file." |
6219 |
(interactive) |
(interactive) |
6220 |
(pr-save-interactive |
(pr-interface-ps 'pr-despool-preview 'pr-ps-directory-preview |
6221 |
(pr-interface-ps 'pr-despool-preview 'pr-ps-directory-preview |
'pr-ps-file-preview 'pr-ps-file-up-preview |
6222 |
'pr-ps-file-preview 'pr-ps-file-up-preview |
'pr-ps-region-preview 'pr-ps-mode-preview |
6223 |
'pr-ps-region-preview 'pr-ps-mode-preview |
'pr-ps-buffer-preview)) |
|
'pr-ps-buffer-preview))) |
|
6224 |
|
|
6225 |
|
|
6226 |
(defun pr-interface-ps (ps-despool ps-directory ps-file ps-file-up ps-region |
(defun pr-interface-ps (ps-despool ps-directory ps-file ps-file-up ps-region |