;ELC ;;; compiled by rms@psilocin.gnu.ai.mit.edu on Tue Jul 23 22:48:59 1996 ;;; from file /home/fsf/rms/e19/lisp/ps-print.el ;;; emacs version 19.31.96.1. ;;; bytecomp version FSF 2.10 ;;; optimization is on. ;;; this file uses opcodes which do not exist in Emacs 18. (if (and (boundp 'emacs-version) (or (and (boundp 'epoch::version) epoch::version) (string-lessp emacs-version "19.29"))) (error "`ps-print.el' was compiled for Emacs 19.29 or later")) #@357 ps-print.el,v 2.8 1995/05/04 12:06:10 jct Exp Jim's last change version -- this file may have been edited as part of Emacs without changes to the version number. When reporting bugs, please also report the version of Emacs, if any, that ps-print was distributed with. Please send all bug fixes and enhancements to Jim Thompson . (defconst ps-print-version "2.8" (#$ . 479)) #@52 *The shell command for printing a PostScript file. (defvar ps-lpr-command lpr-command (#$ . -886)) #@56 *A list of extra switches to pass to `ps-lpr-command'. (defvar ps-lpr-switches lpr-switches (#$ . -991)) #@367 *Non-nil indicates spooling is for a two-sided printer. For a duplex printer, the `ps-spool-*' commands will insert blank pages as needed between print jobs so that the next buffer printed will start on the right page. Also, if headers are turned on, the headers will be reversed on duplex printers so that the page numbers fall to the left on even-numbered pages. (defvar ps-spool-duplex nil (#$ . -1103)) #@100 *Specifies the size of paper to format for. Should be one of `ps-letter', `ps-legal', or `ps-a4'. (defvar ps-paper-type (quote ps-letter) (#$ . -1518)) #@267 *Non-nil means print a header at the top of each page. By default, the header displays the buffer name, page number, and, if the buffer is visiting a file, the file's directory. Headers are customizable by changing variables `ps-header-left' and `ps-header-right'. (defvar ps-print-header t (#$ . -1678)) #@54 *Non-nil means draw a gaudy frame around the header. (defvar ps-print-header-frame t (#$ . -1990)) #@149 *Non-nil means show page numbers as N/M, meaning page N of M. Note: page numbers are displayed as part of headers, see variable `ps-print-headers'. (defvar ps-show-n-of-n t (#$ . -2096)) #@48 *If non-nil, print the buffer's text in color. (defvar ps-print-color-p (byte-code "!\f!!" [fboundp x-color-values pixel-components float] 2) (#$ . -2289)) #@66 *RGB values of the default foreground color. Defaults to black. (defvar ps-default-fg (quote (0.0 0.0 0.0)) (#$ . -2463)) #@66 *RGB values of the default background color. Defaults to white. (defvar ps-default-bg (quote (1.0 1.0 1.0)) (#$ . -2592)) #@51 *Font size, in points, for generating Postscript. (defvar ps-font-size 10 (#$ . -2721)) #@66 *Font family name for ordinary text, when generating Postscript. (defvar ps-font "Courier" (#$ . -2815)) #@62 *Font family name for bold text, when generating Postscript. (defvar ps-font-bold "Courier-Bold" (#$ . -2926)) #@64 *Font family name for italic text, when generating Postscript. (defvar ps-font-italic "Courier-Oblique" (#$ . -3043)) #@69 *Font family name for bold italic text, when generating Postscript. (defvar ps-font-bold-italic "Courier-BoldOblique" (#$ . -3167)) #@330 *The average width, in points, of a character, for generating Postscript. This is the value that ps-print uses to determine the length, x-dimension, of the text it has printed, and thus affects the point at which long lines wrap around. If you change the font or font size, you will probably have to adjust this value to match. (defvar ps-avg-char-width (byte-code "!‡Ç" [fboundp float 5.5999999999999996 6] 2) (#$ . -3306)) #@109 *The width of a space character, for generating Postscript. This value is used in expanding tab characters. (defvar ps-space-width (byte-code "!‡Ç" [fboundp float 5.5999999999999996 6] 2) (#$ . -3746)) #@381 *The height of a line, for generating Postscript. This is the value that ps-print uses to determine the height, y-dimension, of the lines of text it has printed, and thus affects the point at which page-breaks are placed. If you change the font or font size, you will probably have to adjust this value to match. The line-height is *not* the same as the point size of the font. (defvar ps-line-height (byte-code "!‡Ç" [fboundp float 11.289999999999999 11] 2) (#$ . -3962)) #@164 *Non-nil means automatically detect bold/italic face attributes. nil means rely solely on the lists `ps-bold-faces', `ps-italic-faces', and `ps-underlined-faces'. (defvar ps-auto-font-detect t (#$ . -4451)) #@109 *A list of the (non-bold) faces that should be printed in bold font. This applies to generating Postscript. (defvar ps-bold-faces nil (#$ . -4665)) #@113 *A list of the (non-italic) faces that should be printed in italic font. This applies to generating Postscript. (defvar ps-italic-faces nil (#$ . -4820)) #@113 *A list of the (non-underlined) faces that should be printed underlined. This applies to generating Postscript. (defvar ps-underlined-faces nil (#$ . -4981)) #@73 *Number of lines to display in page header, when generating Postscript. (defvar ps-header-lines 2 (#$ . -5145)) (make-variable-buffer-local (quote ps-header-lines)) #@690 *The items to display on the right part of the page header. This applies to generating Postscript. The value should be a list of strings and symbols, each representing an entry in the PostScript array HeaderLinesLeft. Strings are inserted unchanged into the array; those representing PostScript string literals should be delimited with PostScript string delimiters '(' and ')'. For symbols with bound functions, the function is called and should return a string to be inserted into the array. For symbols with bound values, the value should be a string to be inserted into the array. In either case, function or variable, the string value has PostScript string delimiters added to it. (defvar ps-left-header (list (quote ps-get-buffer-name) (quote ps-header-dirpart)) (#$ . -5317)) (make-variable-buffer-local (quote ps-left-header)) #@184 *The items to display on the left part of the page header. This applies to generating Postscript. See the variable `ps-left-header' for a description of the format of this variable. (defvar ps-right-header (list "/pagenumberstring load" (quote time-stamp-yy/mm/dd) (quote time-stamp-hh:mm:ss)) (#$ . -6162)) (make-variable-buffer-local (quote ps-right-header)) #@57 *Non-nil means report progress while formatting buffer. (defvar ps-razzle-dazzle t (#$ . -6530)) #@191 *Contains the header line identifying the output as PostScript. By default, `ps-adobe-tag' contains the standard identifier. Some printers require slightly different versions of this line. (defvar ps-adobe-tag "%!PS-Adobe-1.0\n" (#$ . -6634)) #@457 *Non-nil means build the reference face lists. Ps-print sets this value to nil after it builds its internal reference lists of bold and italic faces. By settings its value back to t, you can force ps-print to rebuild the lists the next time you invoke one of the ...-with-faces commands. You should set this value back to t after you change the attributes of any face, or create new faces. Most users shouldn't have to worry about its setting, though. (defvar ps-build-face-reference t (#$ . -6885)) #@268 *Non-nil means always rebuild the reference face lists. If this variable is non-nil, ps-print will rebuild its internal reference lists of bold and italic faces *every* time one of the -with-faces commands is called. Most users shouldn't need to set this variable. (defvar ps-always-build-face-reference nil (#$ . -7396)) #@483 Generate and print a PostScript image of the buffer. When called with a numeric prefix argument (C-u), prompts the user for the name of a file to save the PostScript image in, instead of sending it to the printer. More specifically, the FILENAME argument is treated as follows: if it is nil, send the image to the printer. If FILENAME is a string, save the PostScript image in a file with that name. If FILENAME is a number, prompt the user for the name of the file to save in. (defalias 'ps-print-buffer #[(&optional filename) "ped$ !" [ps-generate ps-generate-postscript ps-do-despool filename] 5 (#$ . 7727) (list (ps-print-preprint current-prefix-arg))]) #@256 Generate and print a PostScript image of the buffer. Like `ps-print-buffer', but includes font, color, and underline information in the generated image. This command works only if you are using a window system, so it has a way to determine color values. (defalias 'ps-print-buffer-with-faces #[(&optional filename) "ped$ !" [ps-generate ps-generate-postscript-with-faces ps-do-despool filename] 5 (#$ . 8402) (list (ps-print-preprint current-prefix-arg))]) #@114 Generate and print a PostScript image of the region. Like `ps-print-buffer', but prints just the current region. (defalias 'ps-print-region #[(from to &optional filename) "p \n$ !" [ps-generate from to ps-generate-postscript ps-do-despool filename] 5 (#$ . 8872) (list (point) (mark) (ps-print-preprint current-prefix-arg))]) #@256 Generate and print a PostScript image of the region. Like `ps-print-region', but includes font, color, and underline information in the generated image. This command works only if you are using a window system, so it has a way to determine color values. (defalias 'ps-print-region-with-faces #[(from to &optional filename) "p \n$ !" [ps-generate from to ps-generate-postscript-with-faces ps-do-despool filename] 5 (#$ . 9210) (list (point) (mark) (ps-print-preprint current-prefix-arg))]) #@243 Generate and spool a PostScript image of the buffer. Like `ps-print-buffer' except that the PostScript image is saved in a local buffer to be sent to the printer later. Use the command `ps-despool' to send the spooled images to the printer. (defalias 'ps-spool-buffer #[nil "ped$" [ps-generate ps-generate-postscript] 5 (#$ . 9712) nil]) #@329 Generate and spool a PostScript image of the buffer. Like `ps-spool-buffer', but includes font, color, and underline information in the generated image. This command works only if you are using a window system, so it has a way to determine color values. Use the command `ps-despool' to send the spooled images to the printer. (defalias 'ps-spool-buffer-with-faces #[nil "ped$" [ps-generate ps-generate-postscript-with-faces] 5 (#$ . 10061) nil]) #@195 Generate a PostScript image of the region and spool locally. Like `ps-spool-buffer', but spools just the current region. Use the command `ps-despool' to send the spooled images to the printer. (defalias 'ps-spool-region #[(from to) "p \n$" [ps-generate from to ps-generate-postscript] 5 (#$ . 10519) "r"]) #@337 Generate a PostScript image of the region and spool locally. Like `ps-spool-region', but includes font, color, and underline information in the generated image. This command works only if you are using a window system, so it has a way to determine color values. Use the command `ps-despool' to send the spooled images to the printer. (defalias 'ps-spool-region-with-faces #[(from to) "p \n$" [ps-generate from to ps-generate-postscript-with-faces] 5 (#$ . 10836) "r"]) #@475 Send the spooled PostScript to the printer. When called with a numeric prefix argument (C-u), prompt the user for the name of a file to save the spooled PostScript in, instead of sending it to the printer. More specifically, the FILENAME argument is treated as follows: if it is nil, send the image to the printer. If FILENAME is a string, save the PostScript image in a file with that name. If FILENAME is a number, prompt the user for the name of the file to save in. (defalias 'ps-despool #[(&optional filename) " !" [ps-do-despool filename] 2 (#$ . 11317) (list (ps-print-preprint current-prefix-arg))]) (byte-code "!)\f\"ł(\f\"ǂ(\f\"'ɂ( B =; =H\fWLL!!!Y B !h B !w B ! B ! B ! B ! B ! B ! B ! B !!  B ! \" B !# B !#$ B !< =9:% B !U!RS( B !n!kl- B !}0 B !2 B !4 B !5 B !7 B !8 B !: B !< B !> B !@? B A!BAA B C!DD:8EE> \f> >\n !\n !)" [face-differs-from-default-p face differs ps-ref-bold-faces ps-ref-italic-faces ps-ref-underlined-faces face-foreground face-background] 6]) (defalias 'ps-face-attribute-list #[(face-or-list) " >*" [face-font face t face-defaults frame-font kind kind-list] 4]) (defalias 'ps-xemacs-face-kind-p #[(face kind kind-regex kind-list) " ! !\f ! & \"* \f>," [face-font face default frame-font kind x-font-properties kind-cons kind-spec t case-fold-search string-match kind-regex kind-list] 4]) (defalias 'ps-face-bold-p #[(face) "= $ $" [ps-print-emacs-type emacs ps-emacs-face-kind-p face bold "-\\(bold\\|demibold\\)-" ps-bold-faces ps-xemacs-face-kind-p WEIGHT_NAME "bold\\|demibold"] 5]) (defalias 'ps-face-italic-p #[(face) "= $ $ $" [ps-print-emacs-type emacs ps-emacs-face-kind-p face italic "-[io]-" ps-italic-faces ps-xemacs-face-kind-p ANGLE_NAME "i\\|o" SLANT] 5]) (defalias 'ps-face-underlined-p #[(face) " ! \n>" [face-underline-p face ps-underlined-faces] 2]) (byte-code "! \"" [fboundp face-list defalias list-faces] 3) (defalias 'ps-build-reference-face-lists #[nil "E \fA\f@ !$ B !. B !: B\fA*P \f ‰" [ps-auto-font-detect face-list nil the-face faces ps-ref-bold-faces ps-ref-italic-faces ps-ref-underlined-faces ps-face-italic-p ps-face-bold-p ps-face-underlined-p ps-bold-faces ps-italic-faces ps-underlined-faces ps-build-face-reference] 3]) (defalias 'ps-mapper #[(extent list) "\n!\nE\n!\nEDƇ" [list extent-start-position extent push extent-end-position pull nil] 5]) (defalias 'ps-sorter #[(a b) "@ @W" [a b] 2]) (defalias 'ps-extent-sorter #[(a b) " !\n!W" [extent-priority a b] 3]) (defalias 'ps-print-ensure-fontified #[(start end) "! !\f \" " [boundp lazy-lock-mode fboundp lazy-lock-fontify-region start end lazy-lock-fontify-buffer] 3]) (defalias 'ps-generate-postscript-with-faces #[(from to) " ! !@!\n \f}\f \f\"=B=BՉ \f%A\"@@A@A@ eYdX #=!B\"=\"\"@! Ar-= &' \fW'\fW \f#'&\fW* !\f^&'&^ \",-=F,??S,->S,-)[Ղd \"d !122@33\"53\"63\"96591V-=6??6->6-Ղ591,2A2s* # * \f#+" [ps-always-build-face-reference ps-build-face-reference message "Collecting face information..." ps-build-reference-face-lists ps-print-color-p float ps-color-values "white" 1.0 ps-print-color-scale from to default position face ps-print-ensure-fontified ps-print-emacs-type lucid xemacs dummy nil extent-list extent type record a map-extents ps-mapper sort ps-sorter ps-plot-with-face push extent-face ps-extent-sorter pull delq emacs overlay-change property-change next-property-change next-overlay-change get-text-property invisible prop buffer-invisibility-spec t overlays-at -1 face-priority overlays overlay overlay-get overlay-face overlay-invisible priority 0 overlay-priority] 7]) (defalias 'ps-generate-postscript #[(from to) " \n$" [ps-plot-region from to 0 nil] 5]) (defalias 'ps-generate #[(buffer from to genfunc) " ^ ] }\flj\" q \n\f! ωӎ q dϓeb!!R\nq_ )\nq \" \"U  qdb#\"\",\f!," [to from t inhibit-read-only ps-razzle-dazzle message "Formatting...%d%%" 0 ps-razchunk buffer ps-source-buffer get-buffer-create ps-spool-buffer-name ps-spool-buffer ps-init-output-queue nil needs-begin-file completed-safely safe-marker ((byte-code " !\n q !d|" [markerp safe-marker completed-safely ps-spool-buffer marker-position] 2)) make-marker looking-at regexp-quote "%!PS-Adobe-1.0" ps-begin-file ps-begin-job ps-begin-page genfunc ps-end-page ps-spool-duplex mod ps-page-count 2 1 ps-dummy-page ps-flush-output re-search-backward "^/PageCount 0 def$" replace-match format "/PageCount %d def" "Formatting...done"] 5]) (defalias 'ps-do-despool #[(filename) "!\n ! B#! q!ed#>\")K! q =h;hed%ed!y&))! !" [boundp ps-spool-buffer message "No spooled PostScript to print" ps-end-file ps-flush-output filename ps-razzle-dazzle "Saving..." expand-file-name write-region "Wrote %s" "Printing..." system-type ms-dos dos-ps-printer t 0 binary-process-input apply call-process-region ps-lpr-command nil fboundp start-process ps-lpr-switches "Printing...done" kill-buffer] 9]) (defalias 'ps-kill-emacs-check #[nil " ! !! !1 !1!?1!)" [nil ps-buffer get-buffer ps-spool-buffer-name buffer-modified-p y-or-n-p "Unprinted PostScript waiting; print now? " ps-despool yes-or-no-p "Unprinted PostScript waiting; exit anyway? " error "Unprinted PostScript"] 2]) (byte-code "!\"\n!" [fboundp add-hook kill-emacs-hook ps-kill-emacs-check message "Won't override existing kill-emacs-hook"] 3) (defalias 'ps-prsc '(macro . #[nil "EF" [if eq ps-print-emacs-type (quote emacs) [f22] (quote f22)] 4])) (defalias 'ps-c-prsc '(macro . #[nil "EF" [if eq ps-print-emacs-type (quote emacs) [C-f22] (quote (control f22))] 4])) (defalias 'ps-s-prsc '(macro . #[nil "EF" [if eq ps-print-emacs-type (quote emacs) [S-f22] (quote (shift f22))] 4])) (defalias 'ps-article-subject #[nil "eb#Ĕĕ{)" [re-search-forward "^Subject:[ ]+\\(.*\\)$" nil t 1 "Subject ???"] 4]) (defalias 'ps-article-author #[nil "eb#7Ĕĕ{ \"\" ĔĕO3 \"2 ĔĕO3 )8)" [re-search-forward "^From:[ ]+\\(.*\\)$" nil t 1 fromstring string-match ".*[ ]+(\\(.*\\))" "\\(.*\\)[ ]+<.*>" "From ???"] 4]) (defalias 'ps-gnus-article-prepare-hook #[nil "E" [3 ps-header-lines ps-article-subject ps-article-author gnus-newsgroup-name ps-left-header] 3]) (defalias 'ps-vm-mode-hook #[nil " = Â\f\"E " [local-set-key ps-print-emacs-type emacs [f22] f22 ps-vm-print-message-from-summary 3 ps-header-lines ps-article-subject ps-article-author buffer-name ps-left-header] 3]) (defalias 'ps-gnus-print-article-from-summary #[nil "! q )" [get-buffer "*Article*" ps-spool-buffer-with-faces] 2 nil nil]) (defalias 'ps-vm-print-message-from-summary #[nil " q )" [vm-mail-buffer ps-spool-buffer-with-faces] 1 nil nil]) (defalias 'ps-gnus-summary-setup #[nil " = Â\f\"" [local-set-key ps-print-emacs-type emacs [f22] f22 ps-gnus-print-article-from-summary] 3]) (defalias 'ps-info-file #[nil "eb#Ĕĕ{)" [re-search-forward "File:[ ]+\\([^, \n]*\\)" nil t 1 "File ???"] 4]) (defalias 'ps-info-node #[nil "eb#Ĕĕ{)" [re-search-forward "Node:[ ]+\\([^, \n]*\\)" nil t 1 "Node ???"] 4]) (defalias 'ps-info-mode-hook #[nil "D" [ps-info-node ps-info-file ps-left-header] 2]) (defalias 'ps-jts-ps-setup #[nil " = Â\f\" =Ƃ\" =)ɂ*\"\"\"\"\"\"܉" [global-set-key ps-print-emacs-type emacs [f22] f22 ps-spool-buffer-with-faces [S-f22] (shift f22) ps-spool-region-with-faces [C-f22] (control f22) ps-despool add-hook gnus-article-prepare-hook ps-gnus-article-prepare-hook gnus-summary-mode-hook ps-gnus-summary-setup vm-mode-hook ps-vm-mode-hook vm-mode-hooks Info-mode-hook ps-info-mode-hook t ps-spool-duplex nil ps-print-color-p "lpr" ps-lpr-command ("-Jjct,duplex_long") ps-lpr-switches] 3]) (provide (quote ps-print))