• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/emacs-93/emacs/lisp/

Lines Matching +refs:ps +refs:get +refs:buffer +refs:name

55 ;;      You can use a buffer interface instead of menus.  It looks like a
56 ;; customization buffer. Basically, it has the same options found in the
57 ;; menu and some extra options, all this on a buffer.
65 ;; `printing' depends on ps-print package to generate PostScript files, to
66 ;; spool and to despool PostScript buffer. So, `printing' provides an
67 ;; interface to ps-print package and it also provides some extra stuff.
69 ;; To download the latest ps-print package see
71 ;; Please, see README file for ps-print installation instructions.
81 ;; win32-ps-print.el Matthew O. Persico <mpersico@erols.com>
84 ;; ps-print-interface.el Volker Franz <volker.franz@tuebingen.mpg.de>
85 ;; Graphical front end for ps-print and previewing
91 ;; The buffer *Printing Command Output* is where the `printing' log messages
93 ;; buffer *Printing Command Output*. A log entry has the following form:
109 ;; /usr/X11R6/bin/gv ("/home/user/example/file.ps")
116 ;; /usr/X11R6/bin/gv ("/home/user/example/file.ps")
119 ;; So, if something goes wrong, a good place to take a look is the buffer
120 ;; *Printing Command Output*. Don't forget to see also the buffer *Messages*,
127 ;; First of all, see printing documentation only to get an idea of what
130 ;; Then try to set the variables: `pr-ps-name', `pr-ps-printer-alist',
131 ;; `pr-txt-name', `pr-txt-printer-alist' and `pr-path-alist'. These variables
135 ;; typing C-h v pr-ps-name RET (for example) if you already loaded printing
157 ;; (setq pr-txt-name 'prt_06a)
164 ;; (setq pr-ps-name 'lps_06b)
165 ;; (setq pr-ps-printer-alist
184 ;; (setq pr-txt-name 'prt_06a)
189 ;; (setq pr-ps-name 'lps_06b)
190 ;; (setq pr-ps-printer-alist
201 ;; NOTE 2: The `printer-name' and `ps-printer-name' variables don't need to be
202 ;; set, as they are implicit set by `pr-ps-printer-alist' and
209 ;; 1. Open a buffer (or use the *scratch* buffer).
214 ;; 3. Print this buffer with duplex turned on.
232 ;; local system can get it to send to the printer.
234 ;; 3. Don't try to print a dynamic buffer, that is, a buffer which is
236 ;; message. Instead, save the dynamic buffer to a file or copy it in
237 ;; another buffer and, then, print the file or the new static buffer.
238 ;; An example of dynamic buffer is the *Messages* buffer.
246 ;; `printer' is the printer name and `somefile.txt' is a text file.
275 ;; (setq pr-ps-printer-alist
276 ;; '((A "gsprint" ("-all" "-twoup") "-printer " "my-b/w-printer-name")
277 ;; (B "gsprint" ("-all" "-twoup") nil "-printer my-b/w-printer-name")
283 ;; printer A declaration, the only difference is the printer name selection.
296 ;; See also documentation for `pr-ps-printer-alist'.
323 ;; pr-ps-directory-preview
324 ;; pr-ps-directory-using-ghostscript
325 ;; pr-ps-directory-print
326 ;; pr-ps-directory-ps-print
327 ;; pr-ps-buffer-preview
328 ;; pr-ps-buffer-using-ghostscript
329 ;; pr-ps-buffer-print
330 ;; pr-ps-buffer-ps-print
331 ;; pr-ps-region-preview
332 ;; pr-ps-region-using-ghostscript
333 ;; pr-ps-region-print
334 ;; pr-ps-region-ps-print
335 ;; pr-ps-mode-preview
336 ;; pr-ps-mode-using-ghostscript
337 ;; pr-ps-mode-print
338 ;; pr-ps-mode-ps-print
339 ;; pr-ps-file-preview
340 ;; pr-ps-file-up-preview
341 ;; pr-ps-file-using-ghostscript
342 ;; pr-ps-file-print
343 ;; pr-ps-file-ps-print
344 ;; pr-ps-file-up-ps-print
345 ;; pr-ps-fast-fire
349 ;; pr-despool-ps-print
351 ;; pr-printify-buffer
354 ;; pr-txt-buffer
377 ;; pr-ps-name
378 ;; pr-txt-name
379 ;; pr-ps-utility
380 ;; pr-show-ps-setup
387 ;; `pr-interface' buffer interface for printing package.
389 ;; `pr-ps-name' interactively select a PostScript printer.
390 ;; `pr-txt-name' interactively select a text printer.
391 ;; `pr-ps-utility' interactively select a PostScript utility.
393 ;; `pr-ps-*' deal with PostScript code generation.
396 ;; `pr-despool-*' despool the PostScript spooling buffer.
406 ;; `*-ps-print' send PostScript directly to printer or use
412 ;; `*-buffer*' process a buffer.
420 ;; `pr-ps-buffer-using-ghostscript'
421 ;; Use ghostscript to print a buffer.
423 ;; `pr-ps-file-print'
427 ;; Toggle spooling buffer.
431 ;; generated by `ps-print' package.
433 ;; Besides operating one buffer or region each time, you also can postpone
435 ;; temporary Emacs buffer. This way you can save banner pages between
441 ;; C-u M-x pr-ps-buffer-print RET
443 ;; The `pr-ps-buffer-print' command prompts you for a n-up printing number and
444 ;; a file name, and save the PostScript code generated to the file name instead
448 ;; generation, that is, with `pr-ps-*' and `pr-despool-*' commands. If
449 ;; spooling is on, only `pr-despool-*' commands prompt for a file name and save
453 ;; prompt for a directory and a file name regexp. So, it's possible to process
462 ;; you're in the *Summary* buffer, if you forget to switch to the *Article*
463 ;; buffer before printing, you'll get a nicely formatted list of article
465 ;; to switch from gnus *Summary* buffer first.
469 ;; (global-set-key [print] 'pr-ps-fast-fire)
470 ;; (global-set-key [M-print] 'pr-ps-mode-using-ghostscript)
471 ;; (global-set-key [S-print] 'pr-ps-mode-using-ghostscript)
477 ;; (global-set-key 'f22 'pr-ps-fast-fire)
478 ;; (global-set-key '(meta f22) 'pr-ps-mode-using-ghostscript)
479 ;; (global-set-key '(shift f22) 'pr-ps-mode-using-ghostscript)
486 ;; (global-set-key "\C-cbp" 'pr-ps-buffer-print)
487 ;; (global-set-key "\C-cbx" 'pr-ps-buffer-preview)
488 ;; (global-set-key "\C-cbb" 'pr-ps-buffer-using-ghostscript)
489 ;; (global-set-key "\C-crp" 'pr-ps-region-print)
490 ;; (global-set-key "\C-crx" 'pr-ps-region-preview)
491 ;; (global-set-key "\C-crr" 'pr-ps-region-using-ghostscript)
505 ;; `pr-txt-name' Specify a printer for printing a text file.
509 ;; `pr-ps-name' Specify a printer for printing a PostScript
512 ;; `pr-ps-printer-alist' Specify an alist for all PostScript printers.
517 ;; `pr-ps-temp-file' Specify PostScript temporary file name prefix.
522 ;; `pr-gv-command' Specify path and name of the gsview/gv
525 ;; `pr-gs-command' Specify path and name of the ghostscript
538 ;; `pr-spool-p' Non-nil means spool printing in a buffer.
557 ;; `pr-ps-utility' Specify PostScript utility processing.
559 ;; `pr-ps-utility-alist' Specify an alist for PostScript utility
579 ;; `pr-buffer-name' Specify the name of the buffer interface for
582 ;; `pr-buffer-name-ignore' Specify a regexp list for buffer names to be
583 ;; ignored in interface buffer.
585 ;; `pr-buffer-verbose' Non-nil means to be verbose when editing a
586 ;; field in interface buffer.
649 ;; 3 | PostScript Printer: name >|---- C |Region >|-- B |4-up |
653 ;; 6 | Text Printer: name >|-\ | | +-----------+ |
657 ;; 9 |[ ]Print Header Frame | | | |Region | | name >|- C
666 ;; 17 |[ ]Print with faces | | \--|( )name A| |[ ]Tumble | If
667 ;; 18 |[ ]Print via Ghostscript | | |( )name B| +------------+
669 ;; V 19 |[ ]Auto Region | | |(*)name |
675 ;; 24 | Help | |ps-print| |( )Even Sheets|
685 ;; 0. You can use a buffer interface instead of menus. It looks like the
686 ;; customization buffer. Basically, it has the same options found in the
687 ;; menu and some extra options, all this on a buffer.
692 ;; menu) or PostScript temporary file for a directory, a buffer, a region
697 ;; Instead of previewing each buffer, region or major mode at once, you
698 ;; can save temporarily the PostScript code generated in a buffer and
700 ;; spooling buffer in a temporary file and uses ghostview to preview it.
711 ;; or rmail, etc.) and you're in the *Summary* buffer, if you
712 ;; forget to switch to the *Article* buffer before printing,
713 ;; you'll get a nicely formatted list of article subjects shows
715 ;; switch from gnus *Summary* buffer first.
722 ;; See `pr-ps-utility-alist' and `pr-setting-database' for
730 ;; `pr-ps-utility-alist'.
737 ;; temporarily in a buffer instead of printing it or saving it in a file.
739 ;; of printing each buffer, region or major mode at once, you can save
740 ;; temporarily the PostScript code generated in a buffer and print it
742 ;; buffer directly on a printer. If you type C-u before choosing this
750 ;; in `pr-ps-printer-alist' variable (see it for documentation).
756 ;; buffer and you want to print them in a text printer, select this
757 ;; option. All control characters in your buffer or region will be
764 ;; 5. If you want to print a directory, buffer, region or major mode in a
800 ;; See also `ps-even-or-odd-pages'.
822 ;; mode. When this option is on, the `*-buffer*' commands will behave
823 ;; like `*-region*' commands, that is, `*-buffer*' commands will print
824 ;; only the region marked instead of all buffer.
827 ;; declared in `pr-mode-alist', the `*-buffer*' and `*-region*' commands
839 ;; more PostScript options in `ps-print' option. Or you can customize
843 ;; 23. Show current settings for `printing', `ps-print' or `lpr'.
862 ;; (setq pr-txt-name 'prt_06a)
867 ;; (setq pr-ps-name 'lps_06b)
868 ;; (setq pr-ps-printer-alist
879 ;; (setq pr-ps-utility 'mpage)
880 ;; (setq pr-ps-utility-alist
901 ;; (setq pr-txt-name 'prt_06a)
908 ;; (setq pr-ps-name 'lps_06b)
909 ;; (setq pr-ps-printer-alist
914 ;; (b/w "gsprint" ("-all" "-twoup") "-printer " "b/w-pr-name")
925 ;; (setq pr-ps-utility 'psnup)
926 ;; (setq pr-ps-utility-alist
939 ;; `pr-ps-utility-alist'.
961 ;; ps-print `http://www.emacswiki.org/cgi-bin/wiki/PsPrintPackage'
1000 ;; - ghostscript parameters for `pr-ps-printer-alist'.
1001 ;; - default printer name.
1013 ;; - extra parameters for `pr-ps-printer-alist'.
1018 ;; Matthew O. Persico <mpersico@erols.com> win32-ps-print.el
1019 ;; Volker Franz <volker.franz@tuebingen.mpg.de> ps-print-interface.el
1029 (require 'ps-print)
1032 (and (string< ps-print-version "6.6.4")
1033 (error "`printing' requires `ps-print' package version 6.6.4 or later"))
1037 (and ps-windows-system (getenv "OSTYPE")
1060 The returned file name (created by appending some random characters at the end
1067 If SUFFIX is non-nil, add that at the end of the file name."
1079 (make-temp-name
1080 (expand-file-name prefix temporary-file-directory)))
1089 ;; `make-temp-name' and `write-region', let's try again.
1107 (defalias 'pr-x-get-popup-menu-response 'get-popup-menu-response)
1120 (defalias 'pr-f-set-keymap-name 'set-keymap-name)
1132 (defalias 'pr-f-set-keymap-name 'ignore)
1149 (defun pr-ps-utility-custom-set (symbol value)
1156 (defun pr-ps-name-custom-set (symbol value)
1160 (pr-menu-set-ps-title value)))
1163 (defun pr-txt-name-custom-set (symbol value)
1186 ps-windows-system)
1207 (defun pr-dosify-file-name (path)
1215 (defun pr-unixify-file-name (path)
1223 (defun pr-standard-file-name (path)
1227 (if (or pr-cygwin-system ps-windows-system)
1315 (defcustom pr-txt-name 'default
1318 The printer name symbol should be defined on `pr-txt-printer-alist' (see it for
1325 :set 'pr-txt-name-custom-set
1332 (cond ((boundp 'printer-name) printer-name)
1333 (ps-windows-system "PRN")
1356 `pr-txt-name' variable setting and for menu selection.
1366 If NAME is something like \"\\\\\\\\host\\\\share-name\" then
1389 NAME A string that specifies a text printer name.
1390 On Unix-like systems, a string value should be a name
1392 On MS-DOS and MS-Windows systems, it is the name of a printer
1397 printer. You can also set it to a name of a file, in which
1402 \"/D:\\\\\\\\host\\\\share-name\"
1407 \"share-name\"
1463 (defcustom pr-ps-name 'default
1466 This printer name symbol should be defined on `pr-ps-printer-alist' (see it for
1473 :set 'pr-ps-name-custom-set
1478 (defcustom pr-ps-printer-alist
1480 (cond (ps-windows-system nil)
1481 (ps-lp-system "-d")
1483 (or (getenv "PRINTER") (getenv "LPDEST") ps-printer-name)))
1495 ;; (b/w "gsprint" ("-all" "-twoup") "-printer " "b/w-pr-name")
1509 `pr-ps-name' variable setting and for menu selection.
1519 If NAME is something like \"\\\\\\\\host\\\\share-name\" then
1547 PRINTER-SWITCH A string that specifies PostScript printer name switch. If
1550 If PRINTER-SWITCH is nil, it's used the default printer name
1566 NAME A string that specifies a PostScript printer name.
1567 On Unix-like systems, a string value should be a name
1569 On MS-DOS and MS-Windows systems, it is the name of a printer
1574 printer. You can also set it to a name of a file, in which
1579 \"\\\\\\\\host\\\\share-name\"
1582 \"/D:\\\\\\\\host\\\\share-name\"
1583 \"\\\\\\\\host\\\\share-name\"
1588 \"share-name\"
1603 be a symbol name setting defined in `pr-setting-database' from
1607 '(ps-landscape-mode . nil)
1608 '(ps-spool-duplex . t)
1630 (b/w1 \"gsprint\" (\"-all\" \"-twoup\") \"-printer \" \"b/w-pr-name\")
1651 (setq pr-ps-printer-alist
1659 declaration, the only difference is the printer name selection.
1727 (const :tag "Landscape" ps-landscape-mode)
1728 (const :tag "Print Header" ps-print-header)
1729 (const :tag "Print Header Frame" ps-print-header-frame)
1730 (const :tag "Line Number" ps-line-number)
1731 (const :tag "Zebra Stripes" ps-zebra-stripes)
1732 (const :tag "Duplex" ps-spool-duplex)
1733 (const :tag "Tumble" ps-spool-tumble)
1734 (const :tag "Upside-Down" ps-print-upside-down)
1752 (pr-dosify-file-name
1756 (file-name-as-directory
1758 (cond (ps-windows-system "c:/temp")
1764 See also `pr-ps-temp-file' and `pr-file-modes'."
1770 (defcustom pr-ps-temp-file "prspool-"
1771 "*Specify PostScript temporary file name prefix.
1787 See also `pr-temp-dir' and `pr-ps-temp-file'."
1794 (if ps-windows-system
1797 "*Specify path and name of the gsview/gv utility.
1836 (if ps-windows-system
1839 "*Specify path and name of the ghostscript utility.
1863 (if ps-windows-system
1906 (if ps-windows-system
1916 See also `pr-ps-printer-alist'."
1930 See also `pr-ps-printer-alist'."
1957 "*Non-nil means spool printing in a buffer."
1994 When this variable is non-nil, the `*-buffer*' commands will behave like
1995 `*-region*' commands, that is, `*-buffer*' commands will print only the region
1996 marked instead of all buffer."
2005 That is, if current major-mode is declared in `pr-mode-alist', the `*-buffer*'
2007 `*-buffer*' commands will print the current buffer and `*-region*' commands
2015 '((mh-folder-mode ; mh summary buffer
2018 (ps-article-author ps-article-subject)
2022 (mh-letter-mode ; mh letter buffer
2025 (ps-article-author ps-article-subject)
2029 (rmail-summary-mode ; rmail summary buffer
2032 (ps-article-subject ps-article-author buffer-name)
2036 (rmail-mode ; rmail buffer
2039 (ps-article-subject ps-article-author buffer-name)
2043 (gnus-summary-mode ; gnus summary buffer
2046 (ps-article-subject ps-article-author gnus-newsgroup-name)
2050 (gnus-article-mode ; gnus article buffer
2053 (ps-article-subject ps-article-author gnus-newsgroup-name)
2057 (Info-mode ; Info buffer
2060 (ps-info-node ps-info-file)
2067 (ps-article-subject ps-article-author buffer-name)
2077 *Summary* buffer, if you forget to switch to the *Article* buffer before
2078 printing, you'll get a nicely formatted list of article subjects shows up at
2080 *Summary* buffer first.
2100 Usually LPR-PRINT function prepares the environment or buffer
2102 process the buffer and send it to text printer.
2114 with 3 arguments: n-up printing, file name and the list:
2117 Usually PS-PRINT function prepares the environment or buffer
2119 process the buffer and send it to PostScript printer.
2131 `ps-header-lines' value.
2135 uses `ps-left-header' value.
2139 uses `ps-right-header' value.
2142 Non-nil means to kill all buffer local variable declared in
2158 be a symbol name setting defined in `pr-setting-database' from
2162 '(ps-landscape-mode . nil)
2163 '(ps-spool-duplex . t)
2192 (const :tag "Landscape" ps-landscape-mode)
2193 (const :tag "Print Header" ps-print-header)
2194 (const :tag "Print Header Frame" ps-print-header-frame)
2195 (const :tag "Line Number" ps-line-number)
2196 (const :tag "Zebra Stripes" ps-zebra-stripes)
2197 (const :tag "Duplex" ps-spool-duplex)
2198 (const :tag "Tumble" ps-spool-tumble)
2199 (const :tag "Upside-Down" ps-print-upside-down)
2215 (defcustom pr-ps-utility 'mpage
2218 This utility symbol should be defined on `pr-ps-utility-alist' (see it for
2226 `pr-ps-utility-alist'."
2228 :set 'pr-ps-utility-custom-set
2233 (defcustom pr-ps-utility-alist
2258 `pr-ps-utility' variable setting and for menu selection.
2338 be a symbol name setting defined in `pr-setting-database' from
2351 `pr-ps-utility-alist'.
2488 '((no-duplex ; setting symbol name
2503 INHERITS Specify the inheritance for SYMBOL group. It's a symbol name
2511 '((no-duplex ; setting symbol name
2517 (no-duplex-and-landscape ; setting symbol name
2525 through `inherits-from:' (see `pr-ps-utility', `pr-mode-alist'
2526 and `pr-ps-printer-alist'), the variables pr-file-duplex and
2538 declared local buffer.
2561 '(ps-landscape-mode . nil)
2562 '(ps-spool-duplex . t)
2582 (const :tag "Landscape" ps-landscape-mode)
2583 (const :tag "Print Header" ps-print-header)
2584 (const :tag "Print Header Frame" ps-print-header-frame)
2585 (const :tag "Line Number" ps-line-number)
2586 (const :tag "Zebra Stripes" ps-zebra-stripes)
2587 (const :tag "Duplex" ps-spool-duplex)
2588 (const :tag "Tumble" ps-spool-tumble)
2589 (const :tag "Upside-Down" ps-print-upside-down)
2615 | PostScript Printer: name >|
2619 | Text Printer: name >|
2664 Error: could not open \"c:\\temp\\prspool.ps\" for reading."
2676 It's used by `pr-ps-directory-preview', `pr-ps-directory-using-ghostscript',
2677 `pr-ps-directory-print', `pr-ps-directory-ps-print', `pr-printify-directory'
2684 (defcustom pr-buffer-name "*Printing Interface*"
2685 "*Specify the name of the buffer interface for printing package.
2693 (defcustom pr-buffer-name-ignore
2694 (list (regexp-quote pr-buffer-name) ; ignore printing interface buffer
2696 "*Specify a regexp list for buffer names to be ignored in interface buffer.
2707 (defcustom pr-buffer-verbose t
2708 "*Non-nil means to be verbose when editing a field in interface buffer.
2731 "Specify text printer name.
2735 (defvar pr-ps-command nil
2737 See `pr-ps-printer-alist'.")
2740 (defvar pr-ps-switches nil
2742 See `pr-ps-printer-alist'.")
2745 (defvar pr-ps-printer-switch nil
2746 "Specify PostScript printer name switch.
2747 See `pr-ps-printer-alist'.")
2750 (defvar pr-ps-printer nil
2751 "Specify PostScript printer name.
2752 See `pr-ps-printer-alist'.")
2777 (let ((temp (get-buffer-create (make-temp-name " *Temp"))))
2779 (set-buffer temp)
2781 (kill-buffer temp))))
2800 (defalias 'pr-get-symbol
2809 (and pr-auto-region (not zmacs-region-stays) (ps-mark-active-p))))
2831 pr-:help "Use buffer interface instead of menu interface")]
2837 ["1-up" (pr-ps-directory-preview 1 nil nil t) t]
2838 ["2-up" (pr-ps-directory-preview 2 nil nil t) t]
2839 ["4-up" (pr-ps-directory-preview 4 nil nil t) t]
2840 ["Other..." (pr-ps-directory-preview nil nil nil t)
2841 :keys "\\[pr-ps-buffer-preview]"])
2843 ["1-up" (pr-ps-buffer-preview 1 t) t]
2844 ["2-up" (pr-ps-buffer-preview 2 t) t]
2845 ["4-up" (pr-ps-buffer-preview 4 t) t]
2846 ["Other..." (pr-ps-buffer-preview nil t)
2847 :keys "\\[pr-ps-buffer-preview]"])
2848 ("Region" ,pr-:active (and (not pr-spool-p) (ps-mark-active-p))
2849 ["1-up" (pr-ps-region-preview 1 t) t]
2850 ["2-up" (pr-ps-region-preview 2 t) t]
2851 ["4-up" (pr-ps-region-preview 4 t) t]
2852 ["Other..." (pr-ps-region-preview nil t)
2853 :keys "\\[pr-ps-region-preview]"])
2855 ["1-up" (pr-ps-mode-preview 1 t) t]
2856 ["2-up" (pr-ps-mode-preview 2 t) t]
2857 ["4-up" (pr-ps-mode-preview 4 t) t]
2858 ["Other..." (pr-ps-mode-preview nil t)
2859 :keys "\\[pr-ps-mode-preview]"])
2861 ["No Preprocessing..." (call-interactively 'pr-ps-file-preview)
2862 :keys "\\[pr-ps-file-preview]"
2866 ["PostScript Utility" pr-update-menus :active pr-ps-utility-alist
2870 ["1-up..." (pr-ps-file-up-preview 1 t t) pr-ps-utility-alist]
2871 ["2-up..." (pr-ps-file-up-preview 2 t t) pr-ps-utility-alist]
2872 ["4-up..." (pr-ps-file-up-preview 4 t t) pr-ps-utility-alist]
2873 ["Other..." (pr-ps-file-up-preview nil t t)
2874 :keys "\\[pr-ps-file-up-preview]" :active pr-ps-utility-alist]
2880 :active pr-ps-utility-alist]
2885 :active pr-ps-utility-alist]
2890 :active (and pr-file-duplex pr-ps-utility-alist)])
2894 pr-:help "Despool PostScript buffer to printer or file (C-u)")])
2899 ["1-up" (pr-ps-directory-ps-print 1 nil nil t) t]
2900 ["2-up" (pr-ps-directory-ps-print 2 nil nil t) t]
2901 ["4-up" (pr-ps-directory-ps-print 4 nil nil t) t]
2902 ["Other..." (pr-ps-directory-ps-print nil nil nil t)
2903 :keys "\\[pr-ps-buffer-ps-print]"])
2905 ["1-up" (pr-ps-buffer-ps-print 1 t) t]
2906 ["2-up" (pr-ps-buffer-ps-print 2 t) t]
2907 ["4-up" (pr-ps-buffer-ps-print 4 t) t]
2908 ["Other..." (pr-ps-buffer-ps-print nil t)
2909 :keys "\\[pr-ps-buffer-ps-print]"])
2910 ("Region" ,pr-:active (ps-mark-active-p)
2911 ["1-up" (pr-ps-region-ps-print 1 t) t]
2912 ["2-up" (pr-ps-region-ps-print 2 t) t]
2913 ["4-up" (pr-ps-region-ps-print 4 t) t]
2914 ["Other..." (pr-ps-region-ps-print nil t)
2915 :keys "\\[pr-ps-region-ps-print]"])
2917 ["1-up" (pr-ps-mode-ps-print 1 t) t]
2918 ["2-up" (pr-ps-mode-ps-print 2 t) t]
2919 ["4-up" (pr-ps-mode-ps-print 4 t) t]
2920 ["Other..." (pr-ps-mode-ps-print nil t)
2921 :keys "\\[pr-ps-mode-ps-print]"])
2923 ["No Preprocessing..." (call-interactively 'pr-ps-file-ps-print)
2924 :keys "\\[pr-ps-file-ps-print]"
2928 ["PostScript Utility" pr-update-menus :active pr-ps-utility-alist
2932 ["1-up..." (pr-ps-file-up-ps-print 1 t t) pr-ps-utility-alist]
2933 ["2-up..." (pr-ps-file-up-ps-print 2 t t) pr-ps-utility-alist]
2934 ["4-up..." (pr-ps-file-up-ps-print 4 t t) pr-ps-utility-alist]
2935 ["Other..." (pr-ps-file-up-ps-print nil t t)
2936 :keys "\\[pr-ps-file-up-ps-print]" :active pr-ps-utility-alist]
2942 :active pr-ps-utility-alist]
2947 :active pr-ps-utility-alist]
2952 :active (and pr-file-duplex pr-ps-utility-alist)])
2953 ["Despool..." (call-interactively 'pr-despool-ps-print)
2954 :active pr-spool-p :keys "\\[pr-despool-ps-print]"
2956 pr-:help "Despool PostScript buffer to printer or file (C-u)")])
2958 :active pr-ps-printer-alist :included (pr-visible-p 'postscript)
2967 ["Buffer" pr-printify-buffer t]
2968 ["Region" pr-printify-region (ps-mark-active-p)])
2973 ["Buffer" pr-txt-buffer t]
2974 ["Region" pr-txt-region (ps-mark-active-p)]
2982 :style toggle :selected ps-landscape-mode
2985 :style toggle :selected ps-print-header
2988 :style toggle :selected ps-print-header-frame :active ps-print-header
2991 :style toggle :selected ps-line-number
2994 :style toggle :selected ps-zebra-stripes
2997 :style toggle :selected ps-spool-duplex
3000 :style toggle :selected ps-spool-tumble :active ps-spool-duplex
3003 :style toggle :selected ps-print-upside-down
3009 :style radio :selected (eq ps-even-or-odd-pages nil)]
3011 :style radio :selected (eq ps-even-or-odd-pages 'even-page)]
3013 :style radio :selected (eq ps-even-or-odd-pages 'odd-page)]
3015 :style radio :selected (eq ps-even-or-odd-pages 'even-sheet)]
3017 :style radio :selected (eq ps-even-or-odd-pages 'odd-sheet)])
3047 ["ps-print" ps-print-customize t]
3051 ["ps-print" pr-show-ps-setup t]
3095 (pr-get-symbol "Printing")))))
3105 "print-buffer")
3106 (dolist (item '("print-buffer" "print-region"
3107 "ps-print-buffer-faces" "ps-print-region-faces"
3108 "ps-print-buffer" "ps-print-region"))
3112 (pr-get-symbol (nth 1 menu-file))
3113 (pr-get-symbol "Print"))))
3125 (global-set-key `[,pr-print-key] 'pr-ps-fast-fire)
3128 (global-set-key `[(meta ,pr-print-key)] 'pr-ps-mode-using-ghostscript)
3129 (global-set-key `[(shift ,pr-print-key)] 'pr-ps-mode-using-ghostscript)
3138 ;;;(global-set-key "\C-cbp" 'pr-ps-buffer-print)
3139 ;;;(global-set-key "\C-cbx" 'pr-ps-buffer-preview)
3140 ;;;(global-set-key "\C-cbb" 'pr-ps-buffer-using-ghostscript)
3141 ;;;(global-set-key "\C-crp" 'pr-ps-region-print)
3142 ;;;(global-set-key "\C-crx" 'pr-ps-region-preview)
3143 ;;;(global-set-key "\C-crr" 'pr-ps-region-using-ghostscript)
3152 " ps-print.el version " ps-print-version
3164 3 | PostScript Printer: name >|---- C |Region >|-- B |4-up |
3168 6 | Text Printer: name >|-\\ | | +-----------+ |
3172 9 |[ ]Print Header Frame | | | |Region | | name >|- C
3181 17 |[ ]Print with faces | | \\--|( )name A| |[ ]Tumble | If
3182 18 |[ ]Print via Ghostscript | | |( )name B| +------------+
3184 V 19 |[ ]Auto Region | | |(*)name |
3190 24 | Help | |ps-print| |( )Even Sheets|
3200 0. You can use a buffer interface instead of menus. It looks like the
3201 customization buffer. Basically, it has the same options found in the
3202 menu and some extra options, all this on a buffer.
3207 menu) or PostScript temporary file for a directory, a buffer, a region
3212 Instead of previewing each buffer, region or major mode at once, you
3213 can save temporarily the PostScript code generated in a buffer and
3215 spooling buffer in a temporary file and uses ghostview to preview it.
3225 or rmail, etc.) and you're in the *Summary* buffer, if you
3226 forget to switch to the *Article* buffer before printing,
3227 you'll get a nicely formatted list of article subjects shows
3229 switch from gnus *Summary* buffer first.
3235 See `pr-ps-utility-alist' and `pr-setting-database' for
3243 `pr-ps-utility-alist'.
3250 temporarily in a buffer instead of printing it or saving it in a file.
3252 Instead of printing each buffer, region or major mode at once, you can
3253 save temporarily the PostScript code generated in a buffer and print it
3254 later. The option `Despool...' despools the PostScript spooling buffer
3263 in `pr-ps-printer-alist' variable (see it for documentation).
3269 buffer and you want to print them in a text printer, select this
3270 option. All control characters in your buffer or region will be
3277 5. If you want to print a directory, buffer, region or major mode in a
3313 See also `ps-even-or-odd-pages'.
3335 mode. When this option is on, the `*-buffer*' commands will behave
3336 like `*-region*' commands, that is, `*-buffer*' commands will print
3337 only the region marked instead of all buffer.
3340 declared in `pr-mode-alist', the `*-buffer*' and `*-region*' commands
3352 more PostScript options in `ps-print' option. Or you can customize
3356 23. Show current settings for `printing', `ps-print' or `lpr'.
3365 " ps-print.el version " ps-print-version
3367 The printing interface buffer has the same functionality as the printing menu.
3369 file, n-up printing, etc.) are set and saved between priting buffer
3371 PostScript file and directory/buffer/region/mode processing; using menu, there
3372 are different value sets for PostScript file and directory/buffer/region/mode
3375 The printing interface buffer has the following sections:
3379 Here you can choose to print/preview a buffer, a directory or a PostScript
3385 Select a buffer from the current buffer list.
3388 If it's on, this means that the selected buffer has an active region,
3390 If it's off when a buffer is selected, this means that the selected
3391 buffer has no active region, so it'll not be possible to turn it on.
3393 If you want to process the whole buffer, let this option off.
3396 If it's on, this means that the selected buffer major mode is declared
3398 If it's off when a buffer is selected, this means that the selected
3399 buffer major mode isn't declared for major mode processing, so it'll
3408 or rmail, etc.) and you're in the *Summary* buffer, if you
3409 forget to switch to the *Article* buffer before printing,
3410 you'll get a nicely formatted list of article subjects shows
3412 switch from gnus *Summary* buffer first.
3420 Specify a file name regexp. All file names in the directory that
3421 match with regexp will be printed/previewed. An empty file name
3434 See `pr-ps-utility-alist' and `pr-setting-database' for documentation.
3437 `pr-ps-utility-alist'.
3448 in `pr-ps-printer-alist' variable (see it for documentation).
3454 If it's turned on, specify to despools the PostScript spooling buffer in
3465 Quit from printing interface buffer.
3472 Specify a file name to send the PostScript generated.
3486 buffer and you want to print them in a text printer, select this
3487 option. All control characters in your buffer or region will be
3495 To print a directory, buffer, region or major mode in a
3499 Quit from printing interface buffer.
3538 mode. When this option is on, the `*-buffer*' commands will behave
3539 like `*-region*' commands, that is, `*-buffer*' commands will print
3540 only the region marked instead of all buffer.
3544 declared in `pr-mode-alist', the `*-buffer*' and `*-region*' commands
3572 See also `ps-even-or-odd-pages'.
3577 That is, to be verbose when editing a field in interface buffer.
3582 options in `ps-print' option. Or you can customize some `lpr' options for
3587 Show current settings for `printing', `ps-print' or `lpr'.
3591 Quick help for printing interface buffer and printing menu layout. You can
3592 also quit the printing interface buffer or kill all printing help buffer.
3594 "Printing buffer interface help message.")
3602 (defun pr-interface (&optional buffer)
3603 "Activate the printing interface buffer.
3605 If BUFFER is nil, the current buffer is used for printing.
3610 (set-buffer (or buffer (current-buffer)))
3615 (defun pr-ps-directory-preview (n-up dir file-regexp &optional filename)
3619 file name regexp for matching and, when you use a prefix argument (C-u), the
3620 command prompts the user for a file name, and saves the PostScript image in
3625 FILE(name)-REGEXP. The argument FILENAME is treated as follows: if it's nil,
3627 PostScript image in a file with that name. If FILENAME is t, prompts for a
3628 file name.
3631 (interactive (pr-interactive-ps-dir-args (pr-prompt "PS preview dir")))
3632 (pr-set-ps-dir-args 'n-up 'dir 'file-regexp 'filename
3634 (setq filename (pr-ps-file filename))
3635 (pr-ps-file-list n-up dir file-regexp filename)
3637 (pr-ps-file-preview filename)))
3641 (defun pr-ps-directory-using-ghostscript (n-up dir file-regexp &optional filename)
3645 file name regexp for matching and, when you use a prefix argument (C-u), the
3646 command prompts the user for a file name, and saves the PostScript image in
3651 FILE(name)-REGEXP. The argument FILENAME is treated as follows: if it's nil,
3653 PostScript image in a file with that name. If FILENAME is t, prompts for a
3654 file name.
3657 (interactive (pr-interactive-ps-dir-args (pr-prompt "PS print dir GS")))
3658 (pr-set-ps-dir-args 'n-up 'dir 'file-regexp 'filename
3660 (let ((file (pr-ps-file filename)))
3661 (pr-ps-file-list n-up dir file-regexp file)
3662 (pr-ps-file-using-ghostscript file)
3667 (defun pr-ps-directory-print (n-up dir file-regexp &optional filename)
3671 file name regexp for matching and, when you use a prefix argument (C-u), the
3672 command prompts the user for a file name, and saves the PostScript image in
3677 FILE(name)-REGEXP. The argument FILENAME is treated as follows: if it's nil,
3679 PostScript image in a file with that name. If FILENAME is t, prompts for a
3680 file name.
3683 (interactive (pr-interactive-ps-dir-args (pr-prompt "PS print dir")))
3684 (pr-set-ps-dir-args 'n-up 'dir 'file-regexp 'filename
3686 (let ((file (pr-ps-file filename)))
3687 (pr-ps-file-list n-up dir file-regexp file)
3688 (pr-ps-file-print file)
3693 (defun pr-ps-directory-ps-print (n-up dir file-regexp &optional filename)
3699 file name regexp for matching and, when you use a prefix argument (C-u), the
3700 command prompts the user for a file name, and saves the PostScript image in
3705 FILE(name)-REGEXP. The argument FILENAME is treated as follows: if it's nil,
3707 PostScript image in a file with that name. If FILENAME is t, prompts for a
3708 file name.
3711 (interactive (pr-interactive-ps-dir-args
3713 (pr-set-ps-dir-args 'n-up 'dir 'file-regexp 'filename
3716 (pr-ps-directory-using-ghostscript n-up dir file-regexp filename)
3717 (pr-ps-directory-print n-up dir file-regexp filename)))
3721 (defun pr-ps-buffer-preview (n-up &optional filename)
3722 "Preview buffer using ghostview.
3725 prefix argument (C-u), the command prompts the user for a file name, and saves
3731 with that name. If FILENAME is t, prompts for a file name."
3734 (pr-ps-mode-preview n-up filename)
3735 (pr-ps-preview (pr-region-active-symbol) n-up filename
3740 (defun pr-ps-buffer-using-ghostscript (n-up &optional filename)
3741 "Print buffer using PostScript through ghostscript.
3744 prefix argument (C-u), the command prompts the user for a file name, and saves
3750 that name. If FILENAME is t, prompts for a file name."
3753 (pr-ps-mode-using-ghostscript n-up filename)
3754 (pr-ps-using-ghostscript (pr-region-active-symbol) n-up filename
3759 (defun pr-ps-buffer-print (n-up &optional filename)
3760 "Print buffer using PostScript printer.
3763 prefix argument (C-u), the command prompts the user for a file name, and saves
3769 that name. If FILENAME is t, prompts for a file name."
3772 (pr-ps-mode-print n-up filename)
3773 (pr-ps-print (pr-region-active-symbol) n-up filename
3778 (defun pr-ps-buffer-ps-print (n-up &optional filename)
3779 "Print buffer using PostScript printer or through ghostscript.
3784 prefix argument (C-u), the command prompts the user for a file name, and saves
3790 that name. If FILENAME is t, prompts for a file name."
3794 (pr-ps-mode-ps-print n-up filename))
3796 (pr-ps-using-ghostscript (pr-region-active-symbol) n-up filename
3799 (pr-ps-print (pr-region-active-symbol) n-up filename
3804 (defun pr-ps-region-preview (n-up &optional filename)
3807 See also `pr-ps-buffer-preview'."
3811 (pr-ps-mode-preview n-up filename))
3812 (pr-ps-preview 'region n-up filename "PS preview region")))
3816 (defun pr-ps-region-using-ghostscript (n-up &optional filename)
3819 See also `pr-ps-buffer-using-ghostscript'."
3823 (pr-ps-mode-using-ghostscript n-up filename))
3824 (pr-ps-using-ghostscript 'region n-up filename "PS print GS region")))
3828 (defun pr-ps-region-print (n-up &optional filename)
3831 See also `pr-ps-buffer-print'."
3835 (pr-ps-mode-print n-up filename))
3836 (pr-ps-print 'region n-up filename "PS print region")))
3840 (defun pr-ps-region-ps-print (n-up &optional filename)
3843 See also `pr-ps-buffer-ps-print'."
3848 (pr-ps-mode-ps-print n-up filename)))
3850 (pr-ps-using-ghostscript 'region n-up filename "PS print GS region"))
3852 (pr-ps-print 'region n-up filename "PS print region"))))
3856 (defun pr-ps-mode-preview (n-up &optional filename)
3859 See also `pr-ps-buffer-preview'."
3862 (let ((file (pr-ps-file filename)))
3863 (and (pr-ps-mode n-up file)
3865 (pr-ps-file-preview file))))
3869 (defun pr-ps-mode-using-ghostscript (n-up &optional filename)
3872 See also `pr-ps-buffer-using-ghostscript'."
3875 (let ((file (pr-ps-file filename)))
3876 (when (and (pr-ps-mode n-up file)
3878 (pr-ps-file-using-ghostscript file)
3883 (defun pr-ps-mode-print (n-up &optional filename)
3886 See also `pr-ps-buffer-print'."
3889 (pr-ps-mode n-up filename))
3893 (defun pr-ps-mode-ps-print (n-up &optional filename)
3896 See also `pr-ps-buffer-ps-print'."
3899 (pr-ps-mode-using-ghostscript n-up filename)
3900 (pr-ps-mode-print n-up filename)))
3909 Interactively, the command prompts for a directory and a file name regexp for
3913 prompts for FILE(name)-REGEXP.
3918 (pr-file-list dir file-regexp 'pr-printify-buffer))
3922 (defun pr-printify-buffer ()
3923 "Replace nonprinting characters in buffer with printable representations.
3945 Interactively, the command prompts for a directory and a file name regexp for
3949 prompts for FILE(name)-REGEXP.
3954 (pr-file-list dir file-regexp 'pr-txt-buffer))
3958 (defun pr-txt-buffer ()
3959 "Print buffer using text printer."
3995 user for a file name, and saves the spooled PostScript image in that file
4000 PostScript image in a file with that name."
4001 (interactive (list (ps-print-preprint current-prefix-arg)))
4002 (let ((file (pr-ps-file filename)))
4005 (pr-ps-file-preview file))))
4013 user for a file name, and saves the spooled PostScript image in that file
4018 image in a file with that name."
4019 (interactive (list (ps-print-preprint current-prefix-arg)))
4020 (let ((file (pr-ps-file filename)))
4023 (pr-ps-file-using-ghostscript file)
4032 user for a file name, and saves the spooled PostScript image in that file
4037 image in a file with that name."
4038 (interactive (list (ps-print-preprint current-prefix-arg)))
4040 (let ((ps-lpr-command (pr-command pr-ps-command))
4041 (ps-lpr-switches pr-ps-switches)
4042 (ps-printer-name-option pr-ps-printer-switch)
4043 (ps-printer-name pr-ps-printer))
4044 (ps-despool filename))))
4048 (defun pr-despool-ps-print (&optional filename)
4052 user for a file name, and saves the spooled PostScript image in that file
4057 image in a file with that name."
4058 (interactive (list (ps-print-preprint current-prefix-arg)))
4065 (defun pr-ps-file-preview (filename)
4067 (interactive (list (pr-ps-infile-preprint "Preview ")))
4073 (defun pr-ps-file-up-preview (n-up ifilename &optional ofilename)
4076 (let ((outfile (pr-ps-utility-args 'n-up 'ifilename 'ofilename
4078 (pr-ps-utility-process n-up ifilename outfile)
4079 (pr-ps-file-preview outfile)))
4083 (defun pr-ps-file-using-ghostscript (filename)
4085 (interactive (list (pr-ps-infile-preprint "Print preview ")))
4087 (let* ((file (pr-expand-file-name filename))
4088 (tempfile (pr-dosify-file-name (make-temp-file file))))
4098 (pr-ps-file-print tempfile)
4104 (defun pr-ps-file-print (filename)
4106 (interactive (list (pr-ps-infile-preprint "Print ")))
4109 (let ((file (pr-expand-file-name filename)))
4110 (if (string= pr-ps-command "")
4112 (let ((ps-spool-buffer (get-buffer-create ps-spool-buffer-name)))
4114 (set-buffer ps-spool-buffer)
4115 (erase-buffer)
4118 ;; use `pr-ps-command' to print
4120 pr-ps-command
4121 (pr-switches-string pr-ps-switches "pr-ps-switches")
4122 (if (string-match "cp" pr-ps-command)
4125 (concat pr-ps-printer-switch pr-ps-printer))
4127 (list (concat pr-ps-printer-switch pr-ps-printer)
4132 (defun pr-ps-file-ps-print (filename)
4134 (interactive (list (pr-ps-infile-preprint
4139 (pr-ps-file-using-ghostscript filename)
4140 (pr-ps-file-print filename)))
4144 (defun pr-ps-file-up-ps-print (n-up ifilename &optional ofilename)
4149 command prompts the user for an output PostScript file name OFILENAME, and
4154 PostScript file name; otherwise, it *must* be a string that it's an input
4155 PostScript file name. The argument OFILENAME is treated as follows: if it's
4157 PostScript image in a file with that name. If OFILENAME is t, prompts for a
4158 file name."
4163 (let ((outfile (pr-ps-utility-args 'n-up 'ifilename 'ofilename
4167 (pr-ps-utility-process n-up ifilename outfile)
4169 (pr-ps-file-ps-print outfile)
4324 (defun pr-ps-name ()
4327 (pr-menu-set-ps-title
4329 pr-ps-printer-alist pr-ps-name)))
4333 (defun pr-txt-name ()
4338 pr-txt-printer-alist pr-txt-name)))
4342 (defun pr-ps-utility ()
4347 pr-ps-utility-alist pr-ps-utility)))
4351 (defun pr-show-ps-setup (&rest ignore)
4352 "Show current ps-print settings."
4354 (pr-show-setup (ps-setup) "*PS Setup*"))
4376 (defun pr-ps-fast-fire (n-up &optional select)
4379 If a region is active, the region will be printed instead of the whole buffer.
4381 `pr-mode-alist' will be used, that is, the current buffer or region will be
4382 printed using `pr-ps-mode-ps-print'.
4387 M-x pr-ps-fast-fire RET
4391 C-u M-x pr-ps-fast-fire RET
4392 C-u 0 M-x pr-ps-fast-fire RET
4397 C-u 1 M-x pr-ps-fast-fire RET
4398 The command prompts the user for a N-UP value and also for a file name,
4402 C-u 2 M-x pr-ps-fast-fire RET
4404 PostScript printer and, finally, for a file name. Then change the active
4418 If it's an integer equal to 1, the command prompts the user for a file name
4423 current PostScript printer and for a file name. Then change the active
4427 If it's a symbol which it's defined in `pr-ps-printer-alist', it's the new
4443 (pr-ps-name))
4445 (assq select pr-ps-printer-alist))
4446 (pr-menu-set-ps-title select))
4449 (pr-ps-name))
4451 (setq filename (pr-ps-outfile-preprint
4455 (pr-ps-buffer-ps-print
4466 If a region is active, the region will be printed instead of the whole buffer.
4468 `pr-mode-alist' will be used, that is, the current buffer or region will be
4492 (pr-txt-name)))
4495 (pr-txt-buffer)))
4506 One way to see `printing' setup is to switch to a *Scratch* buffer and type:
4511 (let (ps-prefix-quote)
4513 #'ps-print-quote
4517 (ps-comment-string "emacs-version " emacs-version)
4518 (ps-comment-string "pr-txt-command " pr-txt-command)
4519 (ps-comment-string "pr-txt-switches "
4521 (ps-comment-string "pr-txt-printer " pr-txt-printer)
4522 (ps-comment-string "pr-ps-command " pr-ps-command)
4523 (ps-comment-string "pr-ps-switches "
4524 (pr-switches-string pr-ps-switches "pr-ps-switches"))
4525 (ps-comment-string "pr-ps-printer-switch" pr-ps-printer-switch)
4526 (ps-comment-string "pr-ps-printer " pr-ps-printer)
4527 (ps-comment-string "pr-cygwin-system " pr-cygwin-system)
4528 (ps-comment-string "ps-windows-system " ps-windows-system)
4529 (ps-comment-string "ps-lp-system " ps-lp-system)
4534 '(21 . pr-txt-name)
4537 '(20 . pr-ps-name)
4538 '(20 . pr-ps-printer-alist)
4541 '(20 . pr-ps-temp-file)
4561 '(20 . pr-ps-utility)
4562 '(20 . pr-ps-utility-alist)
4574 '(22 . pr-buffer-verbose)
4575 '(22 . pr-buffer-name)
4576 '(22 . pr-buffer-name-ignore)
4585 One way to see `lpr' setup is to switch to a *Scratch* buffer and type:
4590 (let (ps-prefix-quote)
4592 #'ps-print-quote
4595 (ps-comment-string "emacs-version" emacs-version)
4597 '(25 . printer-name)
4613 (defalias 'pr-mh-get-msg-num 'mh-get-msg-num)
4616 (defvar mh-show-buffer nil)
4620 "Find the date of an article or mail message in current buffer.
4626 (buffer-substring (match-beginning 1) (match-end 1))
4632 (let ((msg (or (pr-mh-get-msg-num nil) 0)))
4634 (set-buffer mh-show-buffer)
4663 ;; rmail (hacked from ps-print.el)
4669 'rmail-buffer 'rmail-summary-buffer))
4674 (pr-ps-message-from-summary n-up filename header-list
4675 'rmail-buffer 'rmail-summary-buffer))
4678 (defun pr-ps-message-from-summary (n-up filename header-list
4679 summary-buffer summary-default)
4681 (let ((buf (or (and (boundp summary-buffer)
4682 (symbol-value summary-buffer))
4684 (and (get-buffer buf)
4686 (set-buffer buf)
4690 (defun pr-lpr-message-from-summary (header-list summary-buffer summary-default)
4692 (let ((buf (or (and (boundp summary-buffer)
4693 (symbol-value summary-buffer))
4695 (and (get-buffer buf)
4697 (set-buffer buf)
4702 ;; gnus (hacked from ps-print.el)
4710 (pr-ps-message-from-summary n-up filename header-list
4711 'gnus-article-buffer 'pr-gnus-article))
4717 'gnus-article-buffer 'pr-gnus-article))
4721 ;; vm (hacked from ps-print.el)
4729 (pr-ps-message-from-summary n-up filename header-list
4730 'vm-mail-buffer 'pr-vm-summary))
4736 'vm-mail-buffer 'pr-vm-summary))
4743 (defun pr-ps-mode (n-up filename)
4757 (let ((ps-header-lines (or (nth 0 ,header-list) ps-header-lines))
4758 (ps-left-header (or (nth 1 ,header-list) ps-left-header))
4759 (ps-right-header (or (nth 2 ,header-list) ps-right-header))
4760 ps-razzle-dazzle)
4771 (let ((file (pr-ps-file filename))
4782 (pr-ps-file-print file)
4861 (ps-windows-system
4897 (result (pr-x-get-popup-menu-response menu pr-menu-position)))
4910 (mapcar 'pr-get-symbol
4944 If FORCE is non-nil, update menus doesn't matter if `pr-ps-printer-alist',
4945 `pr-txt-printer-alist' or `pr-ps-utility-alist' were modified or not;
4946 otherwise, update PostScript printer menu iff `pr-ps-printer-menu-modified' is
4948 non-nil, and update PostScript File menus iff `pr-ps-utility-menu-modified' is
4959 (pr-update-var 'pr-ps-name pr-ps-printer-alist)
4960 (pr-update-var 'pr-txt-name pr-txt-printer-alist)
4961 (pr-update-var 'pr-ps-utility pr-ps-utility-alist)
4965 (defvar pr-ps-printer-menu-modified t
4966 "Non-nil means `pr-ps-printer-alist' was modified and we need to update menu.")
4969 (defvar pr-ps-utility-menu-modified t
4970 "Non-nil means `pr-ps-utility-alist' was modified and we need to update menu.")
4981 (defun pr-menu-create (name alist var-sym fun entry index)
4982 (cons name
4987 (symbol-name sym)
5000 (defvar pr-ps-name-old "PostScript Printers")
5001 (defvar pr-txt-name-old "Text Printers")
5002 (defvar pr-ps-utility-old "PostScript Utility")
5007 (pr-menu-alist pr-ps-printer-alist
5008 'pr-ps-name
5009 'pr-menu-set-ps-title
5011 'pr-ps-printer-menu-modified
5013 pr-ps-name-old
5016 'pr-txt-name
5021 pr-txt-name-old
5023 (let ((save-var pr-ps-utility-menu-modified))
5024 (pr-menu-alist pr-ps-utility-alist
5025 'pr-ps-utility
5030 pr-ps-utility-old
5032 (pr-menu-alist pr-ps-utility-alist
5033 'pr-ps-utility
5036 'pr-ps-utility-menu-modified
5038 pr-ps-utility-old
5040 (pr-even-or-odd-pages ps-even-or-odd-pages force))
5043 (defun pr-menu-alist (alist var-sym fun menu-path modified-sym force name
5048 (pr-menu-create name alist var-sym
5062 (defun pr-menu-set-ps-title (value &optional item entry index)
5064 'pr-ps-name-old)
5065 (pr-ps-set-printer value)
5072 'pr-txt-name-old)
5082 (list "Printing" "PostScript Print" "File" pr-ps-utility-old)
5085 (list "Printing" "PostScript Preview" "File" pr-ps-utility-old)
5087 (setq pr-ps-utility-old newname)))
5088 (pr-ps-set-utility value)
5096 (setq ps-even-or-odd-pages value)
5107 (pr-menu-alist pr-ps-printer-alist
5108 'pr-ps-name
5109 'pr-menu-set-ps-title
5111 'pr-ps-printer-menu-modified
5116 'pr-txt-name
5123 (let ((save-var pr-ps-utility-menu-modified))
5124 (pr-menu-alist pr-ps-utility-alist
5125 'pr-ps-utility
5132 (pr-menu-alist pr-ps-utility-alist
5133 'pr-ps-utility
5136 'pr-ps-utility-menu-modified
5140 (pr-even-or-odd-pages ps-even-or-odd-pages force))
5143 (defun pr-menu-get-item (name-list)
5145 (or (listp name-list)
5146 (setq name-list (list name-list)))
5147 (and name-list
5148 (let* ((reversed (reverse name-list))
5149 (name (pr-get-symbol (car reversed)))
5154 (mapcar 'pr-get-symbol path)))))
5155 (assq name (nthcdr 2 menu)))))
5161 (defun pr-menu-alist (alist var-sym fun menu-path modified-sym force name
5165 (pr-menu-create name alist var-sym fun entry index))
5166 (let ((item (pr-menu-get-item menu-path)))
5177 (defun pr-menu-set-item-name (item name)
5179 (setcar (nthcdr 2 item) name))) ; ITEM-NAME
5182 (defun pr-menu-set-ps-title (value &optional item entry index)
5183 (pr-menu-set-item-name (or item
5184 (pr-menu-get-item "PostScript Printers"))
5186 (pr-ps-set-printer value)
5192 (pr-menu-set-item-name (or item
5193 (pr-menu-get-item "Text Printers"))
5201 (let ((name (symbol-name value)))
5203 (pr-menu-set-item-name item name)
5204 (pr-menu-set-item-name
5205 (pr-menu-get-item
5207 name)
5208 (pr-menu-set-item-name
5209 (pr-menu-get-item
5211 name)))
5212 (pr-ps-set-utility value)
5218 (pr-menu-set-item-name (pr-menu-get-item "Print All Pages")
5220 (setq ps-even-or-odd-pages value)
5225 (defun pr-ps-set-utility (value)
5226 (let ((item (cdr (assq value pr-ps-utility-alist))))
5229 "Invalid PostScript utility name `%s' for variable `pr-ps-utility'"
5231 (setq pr-ps-utility value)
5236 (defun pr-ps-set-printer (value)
5237 (let ((ps (cdr (assq value pr-ps-printer-alist))))
5238 (or ps
5240 "Invalid PostScript printer name `%s' for variable `pr-ps-name'"
5242 (setq pr-ps-name value
5243 pr-ps-command (pr-dosify-file-name (nth 0 ps))
5244 pr-ps-switches (nth 1 ps)
5245 pr-ps-printer-switch (nth 2 ps)
5246 pr-ps-printer (nth 3 ps))
5247 (or (stringp pr-ps-command)
5248 (setq pr-ps-command
5249 (cond (ps-windows-system "print")
5250 (ps-lp-system "lp")
5253 (or (stringp pr-ps-printer-switch)
5254 (setq pr-ps-printer-switch
5255 (cond (ps-windows-system "/D:")
5256 (ps-lp-system "-d")
5259 (pr-eval-alist (nthcdr 4 ps)))
5266 (error "Invalid text printer name `%s' for variable `pr-txt-name'"
5268 (setq pr-txt-name value
5269 pr-txt-command (pr-dosify-file-name (nth 0 txt))
5274 (cond (ps-windows-system "print")
5275 (ps-lp-system "lp")
5315 (message "There are local buffer settings for `%S'." key)
5400 (pr-toggle 'ps-spool-duplex "Printing duplex"
5406 (pr-toggle 'ps-spool-tumble "Tumble"
5412 (pr-toggle 'ps-landscape-mode "Landscape"
5418 (pr-toggle 'ps-print-upside-down "Upside-Down"
5424 (pr-toggle 'ps-line-number "Line number"
5430 (pr-toggle 'ps-zebra-stripes "Zebra stripe"
5436 (pr-toggle 'ps-print-header "Print header"
5442 (pr-toggle 'ps-print-header-frame "Print header frame"
5485 'buffer))
5492 " buffer")))
5495 (defun pr-show-setup (settings buffer-name)
5496 (with-output-to-temp-buffer buffer-name
5504 (cons (symbol-name elt) elt))
5508 (symbol-name default) nil
5509 (symbol-name default))
5518 (defun pr-expand-file-name (filename)
5519 (pr-dosify-file-name (expand-file-name filename)))
5522 (defun pr-ps-outfile-preprint (&optional mess)
5523 (let* ((prompt (format "%soutput PostScript file name: " (or mess "")))
5524 (res (read-file-name prompt default-directory "" nil)))
5537 (setq res (read-file-name
5539 (file-name-directory res) nil nil
5540 (file-name-nondirectory res))))
5541 (pr-expand-file-name res)))
5544 (defun pr-ps-infile-preprint (&optional mess)
5545 (let* ((prompt (format "%sinput PostScript file name: " (or mess "")))
5546 (res (read-file-name prompt default-directory "" nil)))
5557 (setq res (read-file-name
5559 (file-name-directory res) nil nil
5560 (file-name-nondirectory res))))
5561 (pr-expand-file-name res)))
5564 (defun pr-ps-utility-args (n-up-sym infile-sym outfile-sym prompt)
5571 (set infile-sym (pr-ps-infile-preprint prompt)))
5573 (error "%s: input PostScript file name is missing" prompt))
5574 (set infile-sym (pr-dosify-file-name (symbol-value infile-sym)))
5578 (pr-ps-outfile-preprint prompt))))
5580 (set outfile-sym (pr-dosify-file-name (symbol-value outfile-sym))))
5581 (pr-ps-file (symbol-value outfile-sym)))
5584 (defun pr-ps-utility-process (n-up infile outfile)
5588 (setq item (cdr (assq pr-ps-utility pr-ps-utility-alist)))
5591 "pr-ps-utility-alist entry")
5593 "pr-ps-utility-alist entry")
5595 (format (nth 2 item) ps-paper-type))
5600 (pr-expand-file-name infile)
5602 (pr-expand-file-name outfile)))))
5620 (let ((buffer (get-buffer-create "*Printing Command Output*"))
5626 (set-buffer buffer)
5633 (apply 'call-process cmd nil buffer nil args)
5638 (set-buffer buffer)
5645 "Printing error status: %s (see *Printing Command Output* buffer)"
5650 (let ((lpr-command (pr-standard-file-name (pr-command pr-txt-command)))
5652 (printer-name pr-txt-printer))
5666 (ps-flatten-list ; dynamic evaluation
5667 (mapcar 'ps-eval-switch switches)))
5670 (defun pr-ps-preview (kind n-up filename mess)
5672 (let ((file (pr-ps-file filename)))
5674 (or pr-spool-p (pr-ps-file-preview file))))
5677 (defun pr-ps-using-ghostscript (kind n-up filename mess)
5679 (let ((file (pr-ps-file filename)))
5682 (pr-ps-file-using-ghostscript file)
5686 (defun pr-ps-print (kind n-up filename mess)
5688 (let ((file (pr-ps-file filename)))
5691 (pr-ps-file-print file)
5695 (defun pr-ps-file (&optional filename)
5696 (pr-dosify-file-name (or filename
5699 (expand-file-name pr-ps-temp-file pr-temp-dir))
5700 nil ".ps"))))
5723 (let* ((dir-name (file-name-directory (or (buffer-file-name)
5726 (dir (read-file-name (format fmt-prompt "")
5727 "" dir-name nil dir-name))
5736 (setq dir-name (file-name-directory dir)
5737 dir (read-file-name (format fmt-prompt prompt)
5738 "" dir-name nil dir-name)))
5739 (file-name-as-directory dir)))
5748 ;; get directory argument
5750 ;; get file name regexp
5754 (defun pr-interactive-ps-dir-args (mess)
5756 ;; get n-up argument
5758 ;; get directory argument
5760 ;; get file name regexp
5762 ;; get output file name
5764 (ps-print-preprint current-prefix-arg))))
5769 ;; get n-up argument
5771 ;; get output file name
5773 (ps-print-preprint current-prefix-arg))))
5778 ;; get n-up argument
5780 ;; get input file name
5781 (pr-ps-infile-preprint (concat mess " "))
5782 ;; get output file name
5783 (ps-print-preprint current-prefix-arg)))
5790 (ps-print-preprint current-prefix-arg))))
5792 (set filename-sym (pr-dosify-file-name (symbol-value filename-sym)))))
5807 ;; file name regexp
5812 (defun pr-set-ps-dir-args (n-up-sym dir-sym regexp-sym filename-sym mess)
5816 ;; directory & file name regexp
5822 (defun pr-find-buffer-visiting (file)
5824 (find-buffer-visiting (if ps-windows-system
5828 (blist (buffer-list))
5832 (set-buffer (car blist))
5836 (string= (buffer-substring-no-properties
5851 (let ((buffer (pr-find-buffer-visiting file))
5854 (and (or buffer
5857 (set-buffer (or buffer
5860 (or buffer
5861 (kill-buffer (current-buffer))))))))
5870 (defun pr-ps-file-list (n-up dir file-regexp filename)
5871 (pr-delete-file-if-exists (setq filename (pr-expand-file-name filename)))
5876 (pr-ps-mode n-up filename)
5877 (pr-text2ps 'buffer n-up filename)))))
5884 (let ((ps-n-up-printing n-up)
5885 (ps-spool-config (and (eq ps-spool-config 'setpagedevice)
5892 (cond ((eq kind 'buffer)
5893 (ps-spool-buffer-with-faces))
5895 (ps-spool-region-with-faces (or from (point))
5899 ((eq kind 'buffer)
5900 (ps-print-buffer-with-faces filename))
5902 (ps-print-region-with-faces (or from (point))
5908 (cond ((eq kind 'buffer)
5909 (ps-spool-buffer))
5911 (ps-spool-region (or from (point)) (or to (mark))))
5914 ((eq kind 'buffer)
5915 (ps-print-buffer filename))
5917 (ps-print-region (or from (point)) (or to (mark)) filename))
5922 "Return absolute file name specification for COMMAND.
5926 If COMMAND is already an absolute file name specification, return it.
5937 (pr-dosify-file-name
5940 (ps-windows-system 'windows)
5942 (file-name-nondirectory command)
5945 (file-name-nondirectory command))))))
5967 (expand-file-name
5968 (substitute-in-file-name
5969 (concat (file-name-as-directory path)
5977 (if ps-windows-system
5979 (let ((ext (cons (file-name-extension cmd t)
5982 (setq cmd (file-name-sans-extension cmd))
5997 ;; Printing Interface (inspired on ps-print-interface.el)
6007 (defvar pr-i-buffer nil)
6011 (defvar pr-i-ps-as-is t)
6015 (defvar pr-i-ps-file "")
6018 (defvar pr-i-process 'buffer)
6019 (defvar pr-i-ps-send 'printer)
6029 (pr-f-set-keymap-name pr-interface-map 'pr-interface-map))
6038 (set-buffer pr-i-buffer)
6044 (setq pr-i-buffer (buffer-name (current-buffer))
6045 pr-i-region (ps-mark-active-p)
6050 (put 'pr-i-ps-send 'pr-widget-list nil)
6053 (kill-buffer (get-buffer-create pr-buffer-name))
6054 (switch-to-buffer (get-buffer-create pr-buffer-name))
6058 " ps-print v" ps-print-version)))
6091 (pr-insert-radio-button 'pr-i-process 'buffer)
6092 (pr-insert-menu "Buffer List" 'pr-i-buffer
6093 (let ((blist (buffer-list))
6096 (let ((name (buffer-name (car blist)))
6097 (ignore pr-buffer-name-ignore)
6101 (setq found (string-match (car ignore) name)
6108 name))
6114 (setq pr-i-region (ps-mark-active-p)
6125 (ps-mark-active-p))))
6157 "This buffer isn't in a mode that printing treats specially.")
6199 pr-i-ps-file)
6201 (pr-insert-menu "PostScript Utility" 'pr-ps-utility
6202 (pr-choice-alist pr-ps-utility-alist)
6206 (pr-insert-toggle 'pr-i-ps-as-is " No Preprocessing"))
6213 (pr-insert-menu "PostScript Printer" 'pr-ps-name
6214 (pr-choice-alist pr-ps-printer-alist))
6231 (pr-insert-button 'pr-interface-ps-print "Print" " ")
6234 (pr-insert-radio-button 'pr-i-ps-send 'printer)
6237 (pr-insert-radio-button 'pr-i-ps-send 'file)
6258 (let ((value (if (string= (widget-apply widget :value-get) "")
6274 (pr-insert-menu "Text Printer" 'pr-txt-name
6285 (pr-insert-checkbox "\n\n " 'ps-landscape-mode
6287 (setq ps-landscape-mode (not ps-landscape-mode)
6288 pr-file-landscape ps-landscape-mode))
6291 (pr-insert-toggle 'pr-buffer-verbose " Verbose\n ")
6294 (pr-insert-toggle 'ps-print-header " Print Header ")
6298 (pr-insert-toggle 'ps-print-header-frame " Print Header Frame ")
6302 (pr-insert-toggle 'ps-line-number " Line Number\n ")
6305 (pr-insert-toggle 'ps-zebra-stripes " Zebra Stripes")
6317 'ps-spool-duplex
6319 (setq ps-spool-duplex (not ps-spool-duplex)
6320 pr-file-duplex ps-spool-duplex))
6326 'ps-spool-tumble
6328 (setq ps-spool-tumble (not ps-spool-tumble)
6329 pr-file-tumble ps-spool-tumble))
6334 (pr-insert-toggle 'ps-print-upside-down " Upside-Down")
6336 (pr-insert-menu "Page Parity" 'ps-even-or-odd-pages
6350 (pr-insert-button #'(lambda (&rest ignore) (ps-print-customize))
6351 "ps-print" " ")
6359 (pr-insert-button 'pr-show-ps-setup "ps-print" " ")
6373 "Kill all printing help buffer."
6378 (let ((buffer (get-buffer (car help))))
6380 (when buffer
6381 (delete-windows-on buffer)
6382 (kill-buffer buffer)))))
6387 "Kill the printing buffer interface and quit."
6389 (kill-buffer pr-buffer-name)
6394 "printing buffer interface help."
6408 ((eq pr-i-process 'buffer)
6418 (pr-txt-buffer)))
6432 "Printify a buffer."
6440 ((eq pr-i-process 'buffer)
6444 (pr-printify-buffer))))
6456 (defun pr-interface-ps-print (&rest ignore)
6457 "Print using ps-print package."
6459 (pr-interface-ps 'pr-despool-ps-print 'pr-ps-directory-ps-print
6460 'pr-ps-file-ps-print 'pr-ps-file-up-ps-print
6461 'pr-ps-region-ps-print 'pr-ps-mode-ps-print
6462 'pr-ps-buffer-ps-print))
6468 (pr-interface-ps 'pr-despool-preview 'pr-ps-directory-preview
6469 'pr-ps-file-preview 'pr-ps-file-up-preview
6470 'pr-ps-region-preview 'pr-ps-mode-preview
6471 'pr-ps-buffer-preview))
6474 (defun pr-interface-ps (ps-despool ps-directory ps-file ps-file-up ps-region
6475 ps-mode ps-buffer)
6477 (let ((outfile (or (and (eq pr-i-process 'file) pr-i-ps-as-is)
6478 (pr-i-ps-send))))
6482 (funcall ps-despool outfile))
6488 (funcall ps-directory
6491 (cond ((or (file-directory-p pr-i-ps-file)
6492 (not (file-readable-p pr-i-ps-file)))
6494 (pr-i-ps-as-is
6496 (funcall ps-file pr-i-ps-file)))
6499 (funcall ps-file-up pr-i-n-up pr-i-ps-file outfile)))
6501 ((eq pr-i-process 'buffer)
6505 (funcall ps-region pr-i-n-up outfile)))
6508 (funcall ps-mode pr-i-n-up outfile)))
6511 (funcall ps-buffer pr-i-n-up outfile)))
6522 (defun pr-i-ps-send ()
6523 (cond ((eq pr-i-ps-send 'printer)
6525 ((not (eq pr-i-ps-send 'file))
6526 (error "Internal error: `pr-i-ps-send' = %S" pr-i-ps-send))
6547 (and pr-buffer-verbose
6556 (and pr-buffer-verbose
6561 (setq pr-i-ps-file file))))
6566 (and pr-buffer-verbose
6575 (and (get-buffer "*Completions*") ; clean frame window
6632 (let ((wid-list (get var-sym 'pr-widget-list))
6644 (let ((wid-list (get var-sym 'pr-widget-list)))
6654 (let ((wid (get var-sym 'pr-widget)))
6662 (length (symbol-name (car alist))))
6666 (name (symbol-name sym)))
6672 :tag (concat name
6673 (make-string (- max (length name)) ?_))