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

Lines Matching +refs:ps +refs:printer +refs:name +refs:option

23 ;; Software Foundation; either version 2, or (at your option) any later
46 ;; printer database.
65 ;; `printing' depends on ps-print package to generate PostScript files, to
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
109 ;; /usr/X11R6/bin/gv ("/home/user/example/file.ps")
116 ;; /usr/X11R6/bin/gv ("/home/user/example/file.ps")
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)
158 ;; (setq pr-txt-printer-alist
164 ;; (setq pr-ps-name 'lps_06b)
165 ;; (setq pr-ps-printer-alist
174 ;; (pr-update-menus t) ; update now printer and utility menus
184 ;; (setq pr-txt-name 'prt_06a)
185 ;; (setq pr-txt-printer-alist
189 ;; (setq pr-ps-name 'lps_06b)
190 ;; (setq pr-ps-printer-alist
195 ;; (pr-update-menus t) ; update now printer and utility menus
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
203 ;; `pr-txt-printer-alist'.
207 ;; You can check if your PostScript printer supports duplex feature
208 ;; by checking the printer manual. Or you can try these steps:
216 ;; printer doesn't have duplex feature; otherwise, it's ok, your
217 ;; printer does have duplex feature.
225 ;; 1. If you have a local printer, that is, a printer which is connected
226 ;; directly to your computer, don't forget to connect the printer to your
230 ;; there is no paper in the printer, then try to set `pr-delete-temp-file'
232 ;; local system can get it to send to the printer.
241 ;; printer is a text printer or not by typing in a DOS window:
243 ;; print /D:\\host\printer somefile.txt
245 ;; Where, `host' is the machine where the printer is directly connected,
246 ;; `printer' is the printer name and `somefile.txt' is a text file.
248 ;; If the printer `\\host\printer' doesn't print the content of
257 ;; Therefore, the printer `\\host\printer' is not a text printer, but a
258 ;; PostScript printer. So, please, don't include this printer in
259 ;; `pr-txt-printer-alist' (which see).
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")
278 ;; ;; some other printer declaration
281 ;; The example above declares that printer A prints all pages (-all) and two
282 ;; pages per sheet (-twoup). The printer B declaration does the same as the
283 ;; printer A declaration, the only difference is the printer name selection.
291 ;; The default is `-mono'. So, printer A and B in the example above are
292 ;; using implicitly the `-mono' option. Note that in `-mono' no gray tone
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
377 ;; pr-ps-name
378 ;; pr-txt-name
379 ;; pr-ps-utility
380 ;; pr-show-ps-setup
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.
405 ;; `*-print' send PostScript directly to printer.
406 ;; `*-ps-print' send PostScript directly to printer or use
408 ;; `pr-print-using-ghostscript' option.
420 ;; `pr-ps-buffer-using-ghostscript'
423 ;; `pr-ps-file-print'
430 ;; have a PostScript printer) or send directly to printer a PostScript code
431 ;; generated by `ps-print' package.
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
445 ;; of sending to printer.
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
464 ;; subjects shows up at the printer. With major mode printing you don't need
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.
507 ;; `pr-txt-printer-alist' Specify an alist of all text printers.
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
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
604 ;; click on menu-bar *Help* option,
613 ;; d) or see the option value:
630 ;; click on menu-bar *File* option,
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|
695 ;; as argument. This option is disabled if spooling is on (option 16).
699 ;; preview it later. The option `Despool...' despools the PostScript
701 ;; If you type C-u before choosing this option, the PostScript code
703 ;; To spool the PostScript code generated you need to turn on the option
704 ;; 16. The option `Despool...' is enabled if spooling is on (option
709 ;; `*-mode*' commands or select Mode option in Printing menu. An
714 ;; up at the printer. With major mode printing you don't need to
720 ;; directly to PostScript printer.
722 ;; See `pr-ps-utility-alist' and `pr-setting-database' for
730 ;; `pr-ps-utility-alist'.
732 ;; 2. Operate the same way as option 1, but it sends directly the PostScript
734 ;; print the PostScript file generated. It depends on option 18, if it's
736 ;; printer. If spooling is on (option 16), the PostScript code is saved
741 ;; later. The option `Despool...' despools the PostScript spooling
742 ;; buffer directly on a printer. If you type C-u before choosing this
743 ;; option, the PostScript code generated is saved in a file instead of
744 ;; sending to printer. To spool the PostScript code generated you need
745 ;; to turn on the option 16. This option is enabled if spooling is on
746 ;; (option 16). See also the NOTE 1, NOTE 2 and NOTE 3 on option 1.
748 ;; 3. You can select a new PostScript printer to send PostScript code
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
761 ;; to select this option if you use any option of section I, the
765 ;; text printer, select this option. See also the NOTE 1 on option 1.
767 ;; 6. You can select a new text printer to send text generated. For
769 ;; `pr-txt-printer-alist' variable (see it for documentation).
774 ;; 7. If you want a PostScript landscape printing, turn on this option.
777 ;; turn on this option.
780 ;; option. This option is enabled if print header is on (option 8).
783 ;; turn on this option.
786 ;; this option.
788 ;; 12. If you want a duplex printing and your PostScript printer has this
789 ;; feature, turn on this option.
794 ;; This option is enabled if duplex is on (option 12).
796 ;; 14. If you want a PostScript upside-down printing, turn on this option.
798 ;; 15. With this option, you can choose if you want to print all pages, odd
800 ;; See also `ps-even-or-odd-pages'.
805 ;; option. To spool the PostScript code generated use option 2. You
806 ;; can despool later by choosing option 1 or 2, sub-option `Despool...'.
809 ;; your PostScript code generated, turn on this option. If you have a
810 ;; black/white PostScript printer, these colors are displayed in gray
811 ;; scale by PostScript printer interpreter.
813 ;; 18. If you don't have a PostScript printer to send PostScript files, turn
814 ;; on this option. When this option is on, the ghostscript is used to
816 ;; as a PostScript filter, you don't need to turn on this option.
821 ;; option. Note that this will only work if you're using transient mark
822 ;; mode. When this option is on, the `*-buffer*' commands will behave
826 ;; 20. Turn this option on if you want that when current major-mode is
831 ;; toggle options, turn on this option. The variables
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)
863 ;; (setq pr-txt-printer-alist
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
891 ;; (pr-update-menus t) ; update now printer and utility menus
901 ;; (setq pr-txt-name 'prt_06a)
902 ;; (setq pr-txt-printer-alist
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
936 ;; (pr-update-menus t) ; update now printer and utility menus
939 ;; `pr-ps-utility-alist'.
951 ;; `pr-update-menus' Update utility, PostScript and text printer menus.
961 ;; ps-print `http://www.emacswiki.org/cgi-bin/wiki/PsPrintPackage'
1000 ;; - ghostscript parameters for `pr-ps-printer-alist'.
1001 ;; - default printer name.
1012 ;; - printer selection.
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.
1120 (defalias 'pr-f-set-keymap-name 'set-keymap-name)
1132 (defalias 'pr-f-set-keymap-name 'ignore)
1143 "Set the value of custom variables for printer & utility selection."
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
1316 "*Specify a printer for printing a text file.
1318 The printer name symbol should be defined on `pr-txt-printer-alist' (see it for
1323 function (see it for documentation) to update text printer menu."
1325 :set 'pr-txt-name-custom-set
1330 (defcustom pr-txt-printer-alist
1332 (cond ((boundp 'printer-name) printer-name)
1333 (ps-windows-system "PRN")
1347 "*Specify an alist of all text printers (text printer database).
1355 SYMBOL It's a symbol to identify a text printer. It's for
1356 `pr-txt-name' variable setting and for menu selection.
1363 will write directly to the printer port given by NAME (see text
1366 If NAME is something like \"\\\\\\\\host\\\\share-name\" then
1381 SWITCHES List of sexp's to pass as extra options for text printer
1389 NAME A string that specifies a text printer name.
1390 On Unix-like systems, a string value should be a name
1391 understood by lpr's -P option (or lp's -d option).
1392 On MS-DOS and MS-Windows systems, it is the name of a printer
1395 \"AUX\" for serial printers, or \"\\\\\\\\hostname\\\\printer\"
1396 (or \"/D:\\\\\\\\hostname\\\\printer\") for a shared network
1397 printer. You can also set it to a name of a file, in which
1402 \"/D:\\\\\\\\host\\\\share-name\"
1407 \"share-name\"
1411 function (see it for documentation) to update text printer menu.
1463 (defcustom pr-ps-name 'default
1464 "*Specify a printer for printing a PostScript file.
1466 This printer name symbol should be defined on `pr-ps-printer-alist' (see it for
1471 function (see it for documentation) to update PostScript printer menu."
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")
1500 "*Specify an alist for all PostScript printers (PostScript printer database).
1508 SYMBOL It's a symbol to identify a PostScript printer. It's for
1509 `pr-ps-name' variable setting and for menu selection.
1516 Emacs will write directly to the printer port given by NAME
1519 If NAME is something like \"\\\\\\\\host\\\\share-name\" then
1536 SWITCHES List of sexp's to pass as extra options for PostScript printer
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
1564 \"-printer \"
1566 NAME A string that specifies a PostScript printer name.
1567 On Unix-like systems, a string value should be a name
1568 understood by lpr's -P option (or lp's -d option).
1569 On MS-DOS and MS-Windows systems, it is the name of a printer
1572 \"AUX\" for serial printers, or \"\\\\\\\\hostname\\\\printer\"
1573 (or \"/D:\\\\\\\\hostname\\\\printer\") for a shared network
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)
1613 function (see it for documentation) to update PostScript printer menu.
1630 (b/w1 \"gsprint\" (\"-all\" \"-twoup\") \"-printer \" \"b/w-pr-name\")
1631 (b/w2 \"gsprint\" (\"-all\" \"-twoup\") nil \"-printer \\\\\\\\printers\\\\lps_06a\")
1651 (setq pr-ps-printer-alist
1652 '((A \"gsprint\" (\"-all\" \"-twoup\") \"-printer \" \"lps_015\")
1653 (B \"gsprint\" (\"-all\" \"-twoup\") nil \"-printer lps_015\")
1654 ;; some other printer declaration
1657 The example above declares that printer A prints all pages (-all) and two pages
1658 per sheet (-twoup). The printer B declaration does the same as the printer A
1659 declaration, the only difference is the printer name selection.
1667 The default is `-mono'. So, printer A and B in the example above are using
1668 implicitly the `-mono' option. Note that in `-mono' no gray tone or color is
1675 * GSPRINT - Ghostscript print to Windows printer
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.
1855 `http://www.cs.wisc.edu/~ghost/doc/printer.htm'
1863 (if ps-windows-system
1898 `http://www.cs.wisc.edu/~ghost/doc/printer.htm'
1906 (if ps-windows-system
1913 -sDEVICE=djet500 the printer - works with HP DeskJet 540
1916 See also `pr-ps-printer-alist'."
1930 See also `pr-ps-printer-alist'."
1939 This is useful if you don't have a PostScript printer, so you could use the
2018 (ps-article-author ps-article-subject)
2025 (ps-article-author ps-article-subject)
2032 (ps-article-subject ps-article-author buffer-name)
2039 (ps-article-subject ps-article-author buffer-name)
2046 (ps-article-subject ps-article-author gnus-newsgroup-name)
2053 (ps-article-subject ps-article-author gnus-newsgroup-name)
2060 (ps-info-node ps-info-file)
2067 (ps-article-subject ps-article-author buffer-name)
2079 the printer. With major mode printing you don't need to switch from gnus
2102 process the buffer and send it to text printer.
2114 with 3 arguments: n-up printing, file name and the list:
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.
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.
2309 utilities accept an output file option, but some others need
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
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
2722 See `pr-txt-printer-alist'.")
2726 "List of sexp's to pass as extra options to the text printer program.
2727 See `pr-txt-printer-alist'.")
2730 (defvar pr-txt-printer nil
2731 "Specify text printer name.
2732 See `pr-txt-printer-alist'.")
2735 (defvar pr-ps-command nil
2737 See `pr-ps-printer-alist'.")
2740 (defvar pr-ps-switches nil
2741 "List of sexp's to pass as extra options to the PostScript printer program.
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"))))
2809 (and pr-auto-region (not zmacs-region-stays) (ps-mark-active-p))))
2835 pr-:help "Preview PostScript instead of sending to printer")
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)")])
2897 pr-:help "Send PostScript 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]"
2926 pr-:help "Send PostScript file to printer")]
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)
2960 pr-:help "Select PostScript printer")]
2968 ["Region" pr-printify-region (ps-mark-active-p)])
2971 pr-:help "Send text to printer")
2974 ["Region" pr-txt-region (ps-mark-active-p)]
2977 :active pr-txt-printer-alist :included (pr-visible-p 'text)
2979 pr-:help "Select text printer")]
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]
3107 "ps-print-buffer-faces" "ps-print-region-faces"
3108 "ps-print-buffer" "ps-print-region"))
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|
3210 as argument. This option is disabled if spooling is on (option 16).
3214 preview it later. The option `Despool...' despools the PostScript
3216 If you type C-u before choosing this option, the PostScript code
3218 spool the PostScript code generated you need to turn on the option 16.
3219 The option `Despool...' is enabled if spooling is on (option 16).
3223 `*-mode*' commands or select Mode option in Printing menu. An
3228 up at the printer. With major mode printing you don't need to
3233 directly to PostScript printer.
3235 See `pr-ps-utility-alist' and `pr-setting-database' for
3243 `pr-ps-utility-alist'.
3245 2. Operate the same way as option 1, but it sends directly the PostScript
3247 print the PostScript file generated. It depends on option 18, if it's
3249 printer. If spooling is on (option 16), the PostScript code is saved
3254 later. The option `Despool...' despools the PostScript spooling buffer
3255 directly on a printer. If you type C-u before choosing this option,
3257 the printer. To spool the PostScript code generated you need to turn on
3258 option 16. This option is enabled if spooling is on (option 16).
3259 See also the NOTE 1, NOTE 2 and NOTE 3 on option 1.
3261 3. You can select a new PostScript printer to send PostScript code
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
3274 You don't need to select this option if you use any option of section
3278 text printer, select this option. See also the NOTE 1 on option 1.
3280 6. You can select a new text printer to send text generated. For
3281 selection it's used all text printers defined in `pr-txt-printer-alist'
3287 7. If you want a PostScript landscape printing, turn on this option.
3290 turn on this option.
3293 option. This option is enabled if print header is on (option 8).
3296 turn on this option.
3299 this option.
3301 12. If you want a duplex printing and your PostScript printer has this
3302 feature, turn on this option.
3307 This option is enabled if duplex is on (option 12).
3309 14. If you want a PostScript upside-down printing, turn on this option.
3311 15. With this option, you can choose if you want to print all pages, odd
3313 See also `ps-even-or-odd-pages'.
3318 option. To spool the PostScript code generated use option 2. You can
3319 despool later by choosing option 1 or 2, sub-option `Despool...'.
3322 PostScript code generated, turn on this option. If you have a
3323 black/white PostScript printer, these colors are displayed in gray
3324 scale by PostScript printer interpreter.
3326 18. If you don't have a PostScript printer to send PostScript files, turn
3327 on this option. When this option is on, the ghostscript is used to
3329 as a PostScript filter, you don't need to turn on this option.
3334 option. Note that this will only work if you're using transient mark
3335 mode. When this option is on, the `*-buffer*' commands will behave
3339 20. Turn this option on if you want that when current major-mode is
3344 toggle options, turn on this option. The variables
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
3392 If you want to process the region, let this option on.
3393 If you want to process the whole buffer, let this option off.
3401 If you want the major mode processing, let this option on.
3402 If you don't want the major mode processing, let this option off.
3406 `*-mode*' commands or select Mode option in Printing menu. An
3411 up at the printer. With major mode printing you don't need to
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'.
3443 2. PostScript printer:
3446 You can select a new PostScript printer to send PostScript code
3448 in `pr-ps-printer-alist' variable (see it for documentation).
3469 PostScript printer or, for previewing, to a temporary file.
3472 Specify a file name to send the PostScript generated.
3477 3. Text printer:
3480 Select a new text printer to send text generated. For selection it's used
3481 all text printers defined in `pr-txt-printer-alist' variable (see it for
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
3491 You don't need to select this option if you use any option of section
3496 text printer, select this option. See also the NOTE 1 on section 1.
3523 Duplex printing (if your PostScript printer has this feature).
3537 option. Note that this will only work if you're using transient mark
3538 mode. When this option is on, the `*-buffer*' commands will behave
3543 Turn this option on if you want that when current major-mode is
3549 toggle options, turn on this option. The variables
3556 setting Despool option on PostScript printer section.
3560 PostScript code generated, turn on this option. If you have a
3561 black/white PostScript printer, these colors are displayed in gray
3562 scale by PostScript printer interpreter.
3565 If you don't have a PostScript printer to send PostScript files, turn
3566 on this option. When this option is on, the ghostscript is used to
3568 as a PostScript filter, you don't need to turn on this option.
3572 See also `ps-even-or-odd-pages'.
3582 options in `ps-print' option. Or you can customize some `lpr' options for
3587 Show current settings for `printing', `ps-print' or `lpr'.
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)
3668 "Print directory using PostScript printer.
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)
3694 "Print directory using PostScript printer or through ghostscript.
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)
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)
3744 prefix argument (C-u), the command prompts the user for a file name, and saves
3745 the PostScript image in that file instead of sending it to the printer.
3749 printer. If FILENAME is a string, save the PostScript image in a file with
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
3764 the PostScript image in that file instead of sending it to the printer.
3768 printer. If FILENAME is a string, save the PostScript image in a file with
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
3785 the PostScript image in that file instead of sending it to the printer.
3789 printer. If FILENAME is a string, save the PostScript image in a file with
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)
3829 "Print region using PostScript printer.
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)
3841 "Print region using PostScript printer or through ghostscript.
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)
3884 "Print major mode using PostScript printer.
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.
3943 "Print directory using text printer.
3945 Interactively, the command prompts for a directory and a file name regexp for
3949 prompts for FILE(name)-REGEXP.
3959 "Print buffer using text printer."
3971 "Print region using text printer."
3981 "Print major mode 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
4014 instead of sending it to the printer.
4017 send the image to the printer. If FILENAME is a string, save the PostScript
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)
4029 "Send the spooled PostScript to the printer.
4032 user for a file name, and saves the spooled PostScript image in that file
4033 instead of sending it to the printer.
4036 send the image to the printer. If FILENAME is a string, save the PostScript
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)
4049 "Send the spooled PostScript to the printer or use ghostscript to print it.
4052 user for a file name, and saves the spooled PostScript image in that file
4053 instead of sending it to the printer.
4056 send the image to the printer. If FILENAME is a string, save the PostScript
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)
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)
4133 "Send PostScript file FILENAME to printer or use ghostscript to print it."
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)
4145 "Process a PostScript file IFILENAME and send it to printer.
4149 command prompts the user for an output PostScript file name OFILENAME, and
4150 saves the PostScript image in that file instead of sending it to the printer.
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
4156 nil, send the image to the printer. If OFILENAME is a string, save the
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 ()
4325 "Interactively select a PostScript printer."
4327 (pr-menu-set-ps-title
4328 (pr-complete-alist "PostScript printer"
4329 pr-ps-printer-alist pr-ps-name)))
4333 (defun pr-txt-name ()
4334 "Interactively select a text printer."
4337 (pr-complete-alist "Text printer"
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)
4382 printed using `pr-ps-mode-ps-print'.
4387 M-x pr-ps-fast-fire RET
4389 immediatelly be done using the current active printer.
4391 C-u M-x pr-ps-fast-fire RET
4392 C-u 0 M-x pr-ps-fast-fire RET
4394 PostScript printer, then printing will immediatelly be done using the new
4395 current active printer.
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,
4400 printer.
4402 C-u 2 M-x pr-ps-fast-fire RET
4404 PostScript printer and, finally, for a file name. Then change the active
4405 printer to that chosen by user and saves the PostScript image in
4406 that file instead of sending it to the printer.
4412 If it's nil, send the image to the printer.
4415 the user for a current PostScript printer, then printing will immediatelly
4416 be done using the new current active printer.
4418 If it's an integer equal to 1, the command prompts the user for a file name
4420 printer.
4423 current PostScript printer and for a file name. Then change the active
4424 printer to that chosen by user and saves the PostScript image in that file
4425 instead of sending it to the printer.
4427 If it's a symbol which it's defined in `pr-ps-printer-alist', it's the new
4428 active printer and printing will immediatelly be done using the new active
4429 printer.
4431 Otherwise, send the image to the printer.
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
4463 (defun pr-txt-fast-fire (&optional select-printer)
4472 user for a new active text printer.
4476 If it's nil, the printing is sent to the current active text printer.
4478 If it's a symbol which it's defined in `pr-txt-printer-alist', it's the new
4479 active printer and printing will immediatelly be done using the new active
4480 printer.
4482 If it's non-nil, the command prompts the user for a new active text printer.
4487 (cond ((null select-printer))
4488 ((and (symbolp select-printer)
4489 (assq select-printer pr-txt-printer-alist))
4490 (pr-menu-set-txt-title select-printer))
4492 (pr-txt-name)))
4510 Or choose the menu option Printing/Show Settings/printing."
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)
4535 '(21 . pr-txt-printer-alist)
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)
4575 '(22 . pr-buffer-name)
4576 '(22 . pr-buffer-name-ignore)
4589 Or choose the menu option Printing/Show Settings/lpr."
4590 (let (ps-prefix-quote)
4592 #'ps-print-quote
4595 (ps-comment-string "emacs-version" emacs-version)
4597 '(25 . printer-name)
4649 "Print mh-inbox current message in text printer."
4663 ;; rmail (hacked from ps-print.el)
4667 "Print RMAIL current message in text printer."
4674 (pr-ps-message-from-summary n-up filename header-list
4678 (defun pr-ps-message-from-summary (n-up filename header-list
4691 "Print current message in text printer."
4702 ;; gnus (hacked from ps-print.el)
4710 (pr-ps-message-from-summary n-up filename header-list
4715 "Print *Article* current message in text printer."
4721 ;; vm (hacked from ps-print.el)
4729 (pr-ps-message-from-summary n-up filename header-list
4734 "Print current vm message in text printer."
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)
4787 "Print current major mode in text printer."
4861 (ps-windows-system
4942 "Update utility, PostScript and text printer menus.
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
4947 non-nil, update text printer menu iff `pr-txt-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.")
4967 (defvar pr-txt-printer-menu-modified t
4968 "Non-nil means `pr-txt-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
5015 (pr-menu-alist pr-txt-printer-alist
5016 'pr-txt-name
5019 'pr-txt-printer-menu-modified
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)
5073 (pr-txt-set-printer value)
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
5115 (pr-menu-alist pr-txt-printer-alist
5116 'pr-txt-name
5119 'pr-txt-printer-menu-modified
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)))
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))
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
5186 (pr-ps-set-printer value)
5192 (pr-menu-set-item-name (or item
5195 (pr-txt-set-printer value)
5201 (let ((name (symbol-name value)))
5203 (pr-menu-set-item-name item name)
5204 (pr-menu-set-item-name
5207 name)
5208 (pr-menu-set-item-name
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)))
5263 (defun pr-txt-set-printer (value)
5264 (let ((txt (cdr (assq value pr-txt-printer-alist))))
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))
5271 pr-txt-printer (nth 2 txt)))
5274 (cond (ps-windows-system "print")
5275 (ps-lp-system "lp")
5282 (mapcar #'(lambda (option)
5283 (let ((var-sym (car option))
5284 (value (cdr option)))
5293 (mapcar #'(lambda (option)
5294 (let ((var-sym (car option))
5295 (value (cdr option)))
5325 #'(lambda (option)
5326 (let ((var-sym (car option)))
5328 (set var-sym (eval (cdr option)))))))
5330 #'(lambda (option)
5331 (let ((var-sym (car option)))
5335 (eval (cdr option)))))))
5337 #'(lambda (option)
5338 (let ((var-sym (car option)))
5341 (eval (cdr option))))))))
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"
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)))))
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)))
5750 ;; get file name regexp
5754 (defun pr-interactive-ps-dir-args (mess)
5760 ;; get file name regexp
5762 ;; get output file name
5764 (ps-print-preprint current-prefix-arg))))
5771 ;; get output file name
5773 (ps-print-preprint current-prefix-arg))))
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
5824 (find-buffer-visiting (if ps-windows-system
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)
5884 (let ((ps-n-up-printing n-up)
5885 (ps-spool-config (and (eq ps-spool-config 'setpagedevice)
5893 (ps-spool-buffer-with-faces))
5895 (ps-spool-region-with-faces (or from (point))
5900 (ps-print-buffer-with-faces filename))
5902 (ps-print-region-with-faces (or from (point))
5909 (ps-spool-buffer))
5911 (ps-spool-region (or from (point)) (or to (mark))))
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)
6011 (defvar pr-i-ps-as-is t)
6015 (defvar pr-i-ps-file "")
6019 (defvar pr-i-ps-send 'printer)
6029 (pr-f-set-keymap-name pr-interface-map 'pr-interface-map))
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)))
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))))
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)
6274 (pr-insert-menu "Text Printer" 'pr-txt-name
6275 (pr-choice-alist pr-txt-printer-alist)
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))
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" " ")
6389 (kill-buffer pr-buffer-name)
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)))
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))
6561 (setq pr-i-ps-file file))))
6662 (length (symbol-name (car alist))))
6666 (name (symbol-name sym)))
6672 :tag (concat name
6673 (make-string (- max (length name)) ?_))