diff options
| author | Gerd Moellmann | 2001-02-20 10:41:10 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2001-02-20 10:41:10 +0000 |
| commit | 2bd80d73dad66ed1679c99d3a2fb368759f7398f (patch) | |
| tree | 5c0a016020d98605ca16a0014dbea4669cc88b12 | |
| parent | e8ebf97dee859d5a05b7ee815cd1e4f0f76c69fd (diff) | |
| download | emacs-2bd80d73dad66ed1679c99d3a2fb368759f7398f.tar.gz emacs-2bd80d73dad66ed1679c99d3a2fb368759f7398f.zip | |
Timestamp package replacement. Some enhancements. Some
XEmacs compatibility. Doc Fix.
(ps-print-version): New version number (6.4).
(ps-printer-name): Initialization fix.
(ps-zebra-stripe-follow): Funcionality enhancement.
(ps-prologue-file): Code enhancement.
(ps-right-header): Timestamp package replacement.
(ps-setup, ps-face-bold-p, ps-face-italic-p, ps-get-page-dimensions)
(ps-generate-header, ps-begin-file, ps-begin-job)
(ps-generate-postscript-with-faces, ps-do-despool): Code fix.
(ps-time-stamp-mon-dd-yyyy, ps-time-stamp-hh:mm:ss): New funs.
(ps-zebra-stripe-full-p, ps-zebra-stripe-alist): New vars.
(coding-system-for-write): Var declaration (XEmacs compatibility).
| -rw-r--r-- | lisp/ps-print.el | 270 |
1 files changed, 167 insertions, 103 deletions
diff --git a/lisp/ps-print.el b/lisp/ps-print.el index 502ded397fd..4238f258dc8 100644 --- a/lisp/ps-print.el +++ b/lisp/ps-print.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; ps-print.el --- Print text from the buffer as PostScript | 1 | ;;; ps-print.el --- Print text from the buffer as PostScript |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1993,94,95,96,97,98,99,2000 | 3 | ;; Copyright (C) 1993,94,95,96,97,98,99,00,2001 |
| 4 | ;; Free Software Foundation, Inc. | 4 | ;; Free Software Foundation, Inc. |
| 5 | 5 | ||
| 6 | ;; Author: Jim Thompson (was <thompson@wg2.waii.com>) | 6 | ;; Author: Jim Thompson (was <thompson@wg2.waii.com>) |
| @@ -10,12 +10,12 @@ | |||
| 10 | ;; Maintainer: Kenichi Handa <handa@etl.go.jp> (multi-byte characters) | 10 | ;; Maintainer: Kenichi Handa <handa@etl.go.jp> (multi-byte characters) |
| 11 | ;; Maintainer: Vinicius Jose Latorre <vinicius@cpqd.com.br> | 11 | ;; Maintainer: Vinicius Jose Latorre <vinicius@cpqd.com.br> |
| 12 | ;; Keywords: wp, print, PostScript | 12 | ;; Keywords: wp, print, PostScript |
| 13 | ;; Time-stamp: <2000/12/26 23:19:24 Vinicius> | 13 | ;; Time-stamp: <2001/02/19 14:54:52 Vinicius> |
| 14 | ;; Version: 6.3.3 | 14 | ;; Version: 6.4 |
| 15 | ;; X-URL: http://www.cpqd.com.br/~vinicius/emacs/ | 15 | ;; X-URL: http://www.cpqd.com.br/~vinicius/emacs/ |
| 16 | 16 | ||
| 17 | (defconst ps-print-version "6.3.3" | 17 | (defconst ps-print-version "6.4" |
| 18 | "ps-print.el, v 6.3.3 <2000/12/26 vinicius> | 18 | "ps-print.el, v 6.4 <2001/02/19 vinicius> |
| 19 | 19 | ||
| 20 | Vinicius's last change version -- this file may have been edited as part of | 20 | Vinicius's last change version -- this file may have been edited as part of |
| 21 | Emacs without changes to the version number. When reporting bugs, please also | 21 | Emacs without changes to the version number. When reporting bugs, please also |
| @@ -757,33 +757,39 @@ Please send all bug fixes and enhancements to | |||
| 757 | ;; corresponds to the Red Green Blue color scale. | 757 | ;; corresponds to the Red Green Blue color scale. |
| 758 | ;; The default is 0.95 (or "gray95", or '(0.95 0.95 0.95)). | 758 | ;; The default is 0.95 (or "gray95", or '(0.95 0.95 0.95)). |
| 759 | ;; | 759 | ;; |
| 760 | ;; The variable `ps-zebra-stripe-follow' specifies if zebra stripe should | 760 | ;; The variable `ps-zebra-stripe-follow' specifies how zebra stripes continue |
| 761 | ;; continue on next page or restart on each page. If `ps-zebra-stripe-follow' | 761 | ;; on next page. Visually, valid values are (the character `+' at right of |
| 762 | ;; is nil, zebra stripe is restarted on each page. If `ps-zebra-stripe-follow' | 762 | ;; each column indicates that a line is printed): |
| 763 | ;; is non-nil, zebra stripe continues on next page. Visually, we have: | 763 | ;; |
| 764 | ;; | 764 | ;; `nil' `follow' `full' `full-follow' |
| 765 | ;; `ps-zebra-stripe-follow' `ps-zebra-stripe-follow' | 765 | ;; Current Page -------- ----------- --------- ---------------- |
| 766 | ;; is nil is non-nil | 766 | ;; 1 XXXXX + 1 XXXXXXXX + 1 XXXXXX + 1 XXXXXXXXXXXXX + |
| 767 | ;; Current Page ------------------------ ------------------------ | 767 | ;; 2 XXXXX + 2 XXXXXXXX + 2 XXXXXX + 2 XXXXXXXXXXXXX + |
| 768 | ;; 1 XXXXXXXXXXXXXXXXXXXXX 1 XXXXXXXXXXXXXXXXXXXXX | 768 | ;; 3 XXXXX + 3 XXXXXXXX + 3 XXXXXX + 3 XXXXXXXXXXXXX + |
| 769 | ;; 2 XXXXXXXXXXXXXXXXXXXXX 2 XXXXXXXXXXXXXXXXXXXXX | 769 | ;; 4 + 4 + 4 + 4 + |
| 770 | ;; 3 XXXXXXXXXXXXXXXXXXXXX 3 XXXXXXXXXXXXXXXXXXXXX | 770 | ;; 5 + 5 + 5 + 5 + |
| 771 | ;; 4 4 | 771 | ;; 6 + 6 + 6 + 6 + |
| 772 | ;; 5 5 | 772 | ;; 7 XXXXX + 7 XXXXXXXX + 7 XXXXXX + 7 XXXXXXXXXXXXX + |
| 773 | ;; 6 6 | 773 | ;; 8 XXXXX + 8 XXXXXXXX + 8 XXXXXX + 8 XXXXXXXXXXXXX + |
| 774 | ;; 7 XXXXXXXXXXXXXXXXXXXXX 7 XXXXXXXXXXXXXXXXXXXXX | 774 | ;; 9 XXXXX + 9 XXXXXXXX + 9 XXXXXX + 9 XXXXXXXXXXXXX + |
| 775 | ;; 8 XXXXXXXXXXXXXXXXXXXXX 8 XXXXXXXXXXXXXXXXXXXXX | 775 | ;; 10 + 10 + |
| 776 | ;; ------------------------ ------------------------ | 776 | ;; 11 + 11 + |
| 777 | ;; Next Page ------------------------ ------------------------ | 777 | ;; -------- ----------- --------- ---------------- |
| 778 | ;; 9 XXXXXXXXXXXXXXXXXXXXX 9 XXXXXXXXXXXXXXXXXXXXX | 778 | ;; Next Page -------- ----------- --------- ---------------- |
| 779 | ;; 10 XXXXXXXXXXXXXXXXXXXXX 10 | 779 | ;; 12 XXXXX + 12 + 10 XXXXXX + 10 + |
| 780 | ;; 11 XXXXXXXXXXXXXXXXXXXXX 11 | 780 | ;; 13 XXXXX + 13 XXXXXXXX + 11 XXXXXX + 11 + |
| 781 | ;; 12 12 | 781 | ;; 14 XXXXX + 14 XXXXXXXX + 12 XXXXXX + 12 + |
| 782 | ;; 13 13 XXXXXXXXXXXXXXXXXXXXX | 782 | ;; 15 + 15 XXXXXXXX + 13 + 13 XXXXXXXXXXXXX + |
| 783 | ;; 14 14 XXXXXXXXXXXXXXXXXXXXX | 783 | ;; 16 + 16 + 14 + 14 XXXXXXXXXXXXX + |
| 784 | ;; 15 XXXXXXXXXXXXXXXXXXXXX 15 XXXXXXXXXXXXXXXXXXXXX | 784 | ;; 17 + 17 + 15 + 15 XXXXXXXXXXXXX + |
| 785 | ;; 16 XXXXXXXXXXXXXXXXXXXXX 16 | 785 | ;; 18 XXXXX + 18 + 16 XXXXXX + 16 + |
| 786 | ;; ------------------------ ------------------------ | 786 | ;; 19 XXXXX + 19 XXXXXXXX + 17 XXXXXX + 17 + |
| 787 | ;; 20 XXXXX + 20 XXXXXXXX + 18 XXXXXX + 18 + | ||
| 788 | ;; 21 + 21 XXXXXXXX + | ||
| 789 | ;; 22 + 22 + | ||
| 790 | ;; -------- ----------- --------- ---------------- | ||
| 791 | ;; | ||
| 792 | ;; Any other value is treated as `nil'. | ||
| 787 | ;; | 793 | ;; |
| 788 | ;; See also section How Ps-Print Has A Text And/Or Image On Background. | 794 | ;; See also section How Ps-Print Has A Text And/Or Image On Background. |
| 789 | ;; | 795 | ;; |
| @@ -1263,7 +1269,8 @@ Please send all bug fixes and enhancements to | |||
| 1263 | ;; for XEmacs beta-tests. | 1269 | ;; for XEmacs beta-tests. |
| 1264 | ;; | 1270 | ;; |
| 1265 | ;; Thanks to Klaus Berndl <klaus.berndl@sdm.de> for user defined PostScript | 1271 | ;; Thanks to Klaus Berndl <klaus.berndl@sdm.de> for user defined PostScript |
| 1266 | ;; prologue code suggestion and for odd/even printing suggestion. | 1272 | ;; prologue code suggestion, for odd/even printing suggestion and for |
| 1273 | ;; `ps-prologue-file' enhancement. | ||
| 1267 | ;; | 1274 | ;; |
| 1268 | ;; Thanks to Kein'ichi Handa <handa@etl.go.jp> for multi-byte buffer handling. | 1275 | ;; Thanks to Kein'ichi Handa <handa@etl.go.jp> for multi-byte buffer handling. |
| 1269 | ;; | 1276 | ;; |
| @@ -1379,8 +1386,13 @@ Please send all bug fixes and enhancements to | |||
| 1379 | (defalias 'ps-x-map-extents 'map-extents) | 1386 | (defalias 'ps-x-map-extents 'map-extents) |
| 1380 | 1387 | ||
| 1381 | ;; GNU Emacs | 1388 | ;; GNU Emacs |
| 1382 | (defalias 'ps-e-x-color-values 'x-color-values) | 1389 | (defalias 'ps-e-face-bold-p 'face-bold-p) |
| 1383 | (defalias 'ps-e-color-values 'color-values) | 1390 | (defalias 'ps-e-face-italic-p 'face-italic-p) |
| 1391 | (defalias 'ps-e-next-overlay-change 'next-overlay-change) | ||
| 1392 | (defalias 'ps-e-overlays-at 'overlays-at) | ||
| 1393 | (defalias 'ps-e-overlay-get 'overlay-get) | ||
| 1394 | (defalias 'ps-e-x-color-values 'x-color-values) | ||
| 1395 | (defalias 'ps-e-color-values 'color-values) | ||
| 1384 | (if (fboundp 'find-composition) | 1396 | (if (fboundp 'find-composition) |
| 1385 | (defalias 'ps-e-find-composition 'find-composition) | 1397 | (defalias 'ps-e-find-composition 'find-composition) |
| 1386 | (defalias 'ps-e-find-composition 'ignore)) | 1398 | (defalias 'ps-e-find-composition 'ignore)) |
| @@ -1571,7 +1583,7 @@ For more information about PostScript document comments, see: | |||
| 1571 | :group 'ps-print-miscellany) | 1583 | :group 'ps-print-miscellany) |
| 1572 | 1584 | ||
| 1573 | (defcustom ps-printer-name (and (boundp 'printer-name) | 1585 | (defcustom ps-printer-name (and (boundp 'printer-name) |
| 1574 | printer-name) | 1586 | (symbol-value 'printer-name)) |
| 1575 | "*The name of a local printer for printing PostScript files. | 1587 | "*The name of a local printer for printing PostScript files. |
| 1576 | 1588 | ||
| 1577 | On Unix-like systems, a string value should be a name understood by lpr's -P | 1589 | On Unix-like systems, a string value should be a name understood by lpr's -P |
| @@ -1943,36 +1955,46 @@ See also documentation for `ps-zebra-stripes' and `ps-zebra-stripe-height'." | |||
| 1943 | :group 'ps-print-zebra) | 1955 | :group 'ps-print-zebra) |
| 1944 | 1956 | ||
| 1945 | (defcustom ps-zebra-stripe-follow nil | 1957 | (defcustom ps-zebra-stripe-follow nil |
| 1946 | "*Non-nil means zebra stripe continues on next page. | 1958 | "*Specify how zebra stripes continue on next page. |
| 1947 | 1959 | ||
| 1948 | If `ps-zebra-stripe-follow' is nil, zebra stripe is restarted on each page. | 1960 | Visually, valid values are (the character `+' at right of each column indicates |
| 1949 | If `ps-zebra-stripe-follow' is non-nil, zebra stripe continues on next page. | 1961 | that a line is printed): |
| 1950 | 1962 | ||
| 1951 | Visually, we have: | 1963 | `nil' `follow' `full' `full-follow' |
| 1952 | 1964 | Current Page -------- ----------- --------- ---------------- | |
| 1953 | `ps-zebra-stripe-follow' `ps-zebra-stripe-follow' | 1965 | 1 XXXXX + 1 XXXXXXXX + 1 XXXXXX + 1 XXXXXXXXXXXXX + |
| 1954 | is nil is non-nil | 1966 | 2 XXXXX + 2 XXXXXXXX + 2 XXXXXX + 2 XXXXXXXXXXXXX + |
| 1955 | Current Page ------------------------ ------------------------ | 1967 | 3 XXXXX + 3 XXXXXXXX + 3 XXXXXX + 3 XXXXXXXXXXXXX + |
| 1956 | 1 XXXXXXXXXXXXXXXXXXXXX 1 XXXXXXXXXXXXXXXXXXXXX | 1968 | 4 + 4 + 4 + 4 + |
| 1957 | 2 XXXXXXXXXXXXXXXXXXXXX 2 XXXXXXXXXXXXXXXXXXXXX | 1969 | 5 + 5 + 5 + 5 + |
| 1958 | 3 XXXXXXXXXXXXXXXXXXXXX 3 XXXXXXXXXXXXXXXXXXXXX | 1970 | 6 + 6 + 6 + 6 + |
| 1959 | 4 4 | 1971 | 7 XXXXX + 7 XXXXXXXX + 7 XXXXXX + 7 XXXXXXXXXXXXX + |
| 1960 | 5 5 | 1972 | 8 XXXXX + 8 XXXXXXXX + 8 XXXXXX + 8 XXXXXXXXXXXXX + |
| 1961 | 6 6 | 1973 | 9 XXXXX + 9 XXXXXXXX + 9 XXXXXX + 9 XXXXXXXXXXXXX + |
| 1962 | 7 XXXXXXXXXXXXXXXXXXXXX 7 XXXXXXXXXXXXXXXXXXXXX | 1974 | 10 + 10 + |
| 1963 | 8 XXXXXXXXXXXXXXXXXXXXX 8 XXXXXXXXXXXXXXXXXXXXX | 1975 | 11 + 11 + |
| 1964 | ------------------------ ------------------------ | 1976 | -------- ----------- --------- ---------------- |
| 1965 | Next Page ------------------------ ------------------------ | 1977 | Next Page -------- ----------- --------- ---------------- |
| 1966 | 9 XXXXXXXXXXXXXXXXXXXXX 9 XXXXXXXXXXXXXXXXXXXXX | 1978 | 12 XXXXX + 12 + 10 XXXXXX + 10 + |
| 1967 | 10 XXXXXXXXXXXXXXXXXXXXX 10 | 1979 | 13 XXXXX + 13 XXXXXXXX + 11 XXXXXX + 11 + |
| 1968 | 11 XXXXXXXXXXXXXXXXXXXXX 11 | 1980 | 14 XXXXX + 14 XXXXXXXX + 12 XXXXXX + 12 + |
| 1969 | 12 12 | 1981 | 15 + 15 XXXXXXXX + 13 + 13 XXXXXXXXXXXXX + |
| 1970 | 13 13 XXXXXXXXXXXXXXXXXXXXX | 1982 | 16 + 16 + 14 + 14 XXXXXXXXXXXXX + |
| 1971 | 14 14 XXXXXXXXXXXXXXXXXXXXX | 1983 | 17 + 17 + 15 + 15 XXXXXXXXXXXXX + |
| 1972 | 15 XXXXXXXXXXXXXXXXXXXXX 15 XXXXXXXXXXXXXXXXXXXXX | 1984 | 18 XXXXX + 18 + 16 XXXXXX + 16 + |
| 1973 | 16 XXXXXXXXXXXXXXXXXXXXX 16 | 1985 | 19 XXXXX + 19 XXXXXXXX + 17 XXXXXX + 17 + |
| 1974 | ------------------------ ------------------------" | 1986 | 20 XXXXX + 20 XXXXXXXX + 18 XXXXXX + 18 + |
| 1975 | :type 'boolean | 1987 | 21 + 21 XXXXXXXX + |
| 1988 | 22 + 22 + | ||
| 1989 | -------- ----------- --------- ---------------- | ||
| 1990 | |||
| 1991 | Any other value is treated as `nil'." | ||
| 1992 | :type '(choice :menu-tag "Zebra Stripe Follow" | ||
| 1993 | :tag "Zebra Stripe Follow" | ||
| 1994 | (const :tag "Always Restart" nil) | ||
| 1995 | (const :tag "Continue on Next Page" follow) | ||
| 1996 | (const :tag "Print Only Full Stripe" full) | ||
| 1997 | (const :tag "Continue on Full Stripe" full-follow)) | ||
| 1976 | :group 'ps-print-zebra) | 1998 | :group 'ps-print-zebra) |
| 1977 | 1999 | ||
| 1978 | (defcustom ps-line-number nil | 2000 | (defcustom ps-line-number nil |
| @@ -2633,7 +2655,8 @@ string delimiters added to it." | |||
| 2633 | :group 'ps-print-headers) | 2655 | :group 'ps-print-headers) |
| 2634 | 2656 | ||
| 2635 | (defcustom ps-right-header | 2657 | (defcustom ps-right-header |
| 2636 | (list "/pagenumberstring load" 'time-stamp-mon-dd-yyyy 'time-stamp-hh:mm:ss) | 2658 | (list "/pagenumberstring load" |
| 2659 | 'ps-time-stamp-mon-dd-yyyy 'ps-time-stamp-hh:mm:ss) | ||
| 2637 | "*The items to display (each on a line) on the right part of the page header. | 2660 | "*The items to display (each on a line) on the right part of the page header. |
| 2638 | This applies to generating PostScript. | 2661 | This applies to generating PostScript. |
| 2639 | 2662 | ||
| @@ -2964,7 +2987,7 @@ The table depends on the current ps-print setup." | |||
| 2964 | ps-number-of-columns | 2987 | ps-number-of-columns |
| 2965 | ps-zebra-stripes | 2988 | ps-zebra-stripes |
| 2966 | ps-zebra-stripe-height | 2989 | ps-zebra-stripe-height |
| 2967 | ps-zebra-stripe-follow | 2990 | (ps-print-quote ps-zebra-stripe-follow) |
| 2968 | (ps-print-quote ps-zebra-color) | 2991 | (ps-print-quote ps-zebra-color) |
| 2969 | ps-line-number | 2992 | ps-line-number |
| 2970 | (ps-print-quote ps-line-number-step) | 2993 | (ps-print-quote ps-line-number-step) |
| @@ -3004,7 +3027,7 @@ The table depends on the current ps-print setup." | |||
| 3004 | ps-n-up-margin | 3027 | ps-n-up-margin |
| 3005 | ps-n-up-border-p | 3028 | ps-n-up-border-p |
| 3006 | (ps-print-quote ps-n-up-filling) | 3029 | (ps-print-quote ps-n-up-filling) |
| 3007 | (ps-print-quote ps-multibyte-buffer) ; see `ps-mule.el' | 3030 | (ps-print-quote (symbol-value 'ps-multibyte-buffer)) ; see `ps-mule.el' |
| 3008 | (ps-print-quote ps-font-family) | 3031 | (ps-print-quote ps-font-family) |
| 3009 | (ps-print-quote ps-font-size) | 3032 | (ps-print-quote ps-font-size) |
| 3010 | (ps-print-quote ps-header-font-family) | 3033 | (ps-print-quote ps-header-font-family) |
| @@ -3027,6 +3050,14 @@ The table depends on the current ps-print setup." | |||
| 3027 | ;; Utility functions and variables: | 3050 | ;; Utility functions and variables: |
| 3028 | 3051 | ||
| 3029 | 3052 | ||
| 3053 | (defun ps-time-stamp-mon-dd-yyyy () | ||
| 3054 | (format-time-string "%b %d %Y")) | ||
| 3055 | |||
| 3056 | |||
| 3057 | (defun ps-time-stamp-hh:mm:ss () | ||
| 3058 | (format-time-string "%T")) | ||
| 3059 | |||
| 3060 | |||
| 3030 | (defun ps-print-quote (sym) | 3061 | (defun ps-print-quote (sym) |
| 3031 | (cond ((null sym) | 3062 | (cond ((null sym) |
| 3032 | nil) | 3063 | nil) |
| @@ -3094,6 +3125,9 @@ The table depends on the current ps-print setup." | |||
| 3094 | 3125 | ||
| 3095 | (cond ((eq ps-print-emacs-type 'emacs) ; emacs | 3126 | (cond ((eq ps-print-emacs-type 'emacs) ; emacs |
| 3096 | 3127 | ||
| 3128 | ;; to avoid XEmacs compilation gripes | ||
| 3129 | (defvar coding-system-for-write nil) | ||
| 3130 | |||
| 3097 | (defun ps-color-values (x-color) | 3131 | (defun ps-color-values (x-color) |
| 3098 | (cond | 3132 | (cond |
| 3099 | ((fboundp 'color-values) | 3133 | ((fboundp 'color-values) |
| @@ -3107,11 +3141,11 @@ The table depends on the current ps-print setup." | |||
| 3107 | (defalias 'ps-face-background-name 'face-background) | 3141 | (defalias 'ps-face-background-name 'face-background) |
| 3108 | 3142 | ||
| 3109 | (defun ps-face-bold-p (face) | 3143 | (defun ps-face-bold-p (face) |
| 3110 | (or (face-bold-p face) | 3144 | (or (ps-e-face-bold-p face) |
| 3111 | (memq face ps-bold-faces))) | 3145 | (memq face ps-bold-faces))) |
| 3112 | 3146 | ||
| 3113 | (defun ps-face-italic-p (face) | 3147 | (defun ps-face-italic-p (face) |
| 3114 | (or (face-italic-p face) | 3148 | (or (ps-e-face-italic-p face) |
| 3115 | (memq face ps-italic-faces))) | 3149 | (memq face ps-italic-faces))) |
| 3116 | ) | 3150 | ) |
| 3117 | ; xemacs | 3151 | ; xemacs |
| @@ -3166,22 +3200,22 @@ The table depends on the current ps-print setup." | |||
| 3166 | (memq face ps-underlined-faces))) | 3200 | (memq face ps-underlined-faces))) |
| 3167 | 3201 | ||
| 3168 | 3202 | ||
| 3169 | (require 'time-stamp) | ||
| 3170 | |||
| 3171 | |||
| 3172 | (defun ps-prologue-file (filenumber) | 3203 | (defun ps-prologue-file (filenumber) |
| 3173 | (save-excursion | 3204 | "If prologue FILENUMBER exists and is readable, returns contents as string. |
| 3174 | (let* ((filename (convert-standard-filename | 3205 | |
| 3175 | (expand-file-name (format "ps-prin%d.ps" filenumber) | 3206 | Note: No major/minor-mode is activated and no local variables are evaluated for |
| 3176 | ps-postscript-code-directory))) | 3207 | FILENUMBER, but proper EOL-conversion and character interpretation is |
| 3177 | (buffer | 3208 | done!" |
| 3178 | (or (find-file-noselect filename 'no-warn 'rawfile) | 3209 | (let ((filename (convert-standard-filename |
| 3179 | (error "ps-print PostScript prologue `%s' file was not found." | 3210 | (expand-file-name (format "ps-prin%d.ps" filenumber) |
| 3180 | filename)))) | 3211 | ps-postscript-code-directory)))) |
| 3181 | (set-buffer buffer) | 3212 | (if (and (file-exists-p filename) |
| 3182 | (prog1 | 3213 | (file-readable-p filename)) |
| 3183 | (buffer-string) | 3214 | (with-temp-buffer |
| 3184 | (kill-buffer buffer))))) | 3215 | (insert-file-contents filename) |
| 3216 | (buffer-string)) | ||
| 3217 | (error "ps-print PostScript prologue `%s' file was not found." | ||
| 3218 | filename)))) | ||
| 3185 | 3219 | ||
| 3186 | 3220 | ||
| 3187 | (defvar ps-mark-code-directory nil) | 3221 | (defvar ps-mark-code-directory nil) |
| @@ -3230,6 +3264,7 @@ The table depends on the current ps-print setup." | |||
| 3230 | (defvar ps-current-color nil) | 3264 | (defvar ps-current-color nil) |
| 3231 | (defvar ps-current-bg nil) | 3265 | (defvar ps-current-bg nil) |
| 3232 | 3266 | ||
| 3267 | (defvar ps-zebra-stripe-full-p nil) | ||
| 3233 | (defvar ps-razchunk 0) | 3268 | (defvar ps-razchunk 0) |
| 3234 | 3269 | ||
| 3235 | (defvar ps-color-p nil) | 3270 | (defvar ps-color-p nil) |
| @@ -3758,7 +3793,24 @@ page-height == bm + print-height + tm - ho - hh | |||
| 3758 | (* (ps-line-height 'ps-font-for-header) | 3793 | (* (ps-line-height 'ps-font-for-header) |
| 3759 | (1- ps-header-lines)) | 3794 | (1- ps-header-lines)) |
| 3760 | ps-header-pad) | 3795 | ps-header-pad) |
| 3761 | ps-print-height)))) | 3796 | ps-print-height)) |
| 3797 | ;; ps-zebra-stripe-follow is `full' or `full-follow' | ||
| 3798 | (if ps-zebra-stripe-full-p | ||
| 3799 | (let* ((line-height (ps-line-height 'ps-font-for-text)) | ||
| 3800 | (zebra (* line-height ps-zebra-stripe-height))) | ||
| 3801 | (setq ps-print-height (- (* (floor ps-print-height zebra) zebra) | ||
| 3802 | line-height)) | ||
| 3803 | (if (<= ps-print-height 0) | ||
| 3804 | (error "Bad vertical layout: | ||
| 3805 | ps-zebra-stripe-follow == %s | ||
| 3806 | ps-zebra-stripe-height == %s | ||
| 3807 | font-text-height == %s | ||
| 3808 | page-height == ((floor print-height (th * zh)) * (th * zh)) - th | ||
| 3809 | => print-height == %d !" | ||
| 3810 | ps-zebra-stripe-follow | ||
| 3811 | ps-zebra-stripe-height | ||
| 3812 | (ps-line-height 'ps-font-for-text) | ||
| 3813 | ps-print-height)))))) | ||
| 3762 | 3814 | ||
| 3763 | (defun ps-print-preprint (prefix-arg) | 3815 | (defun ps-print-preprint (prefix-arg) |
| 3764 | (and prefix-arg | 3816 | (and prefix-arg |
| @@ -3953,8 +4005,8 @@ page-height == bm + print-height + tm - ho - hh | |||
| 3953 | (while (and (< count ps-header-lines) | 4005 | (while (and (< count ps-header-lines) |
| 3954 | (setq contents (cdr contents))) | 4006 | (setq contents (cdr contents))) |
| 3955 | (ps-generate-header-line "/h1" (car contents)) | 4007 | (ps-generate-header-line "/h1" (car contents)) |
| 3956 | (setq count (1+ count))) | 4008 | (setq count (1+ count))))) |
| 3957 | (ps-output "] def\n")))) | 4009 | (ps-output "] def\n")) |
| 3958 | 4010 | ||
| 3959 | 4011 | ||
| 3960 | (defun ps-output-boolean (name bool) | 4012 | (defun ps-output-boolean (name bool) |
| @@ -4547,7 +4599,14 @@ XSTART YSTART are the relative position for the first page in a sheet.") | |||
| 4547 | (paper . 1) | 4599 | (paper . 1) |
| 4548 | (system . 2) | 4600 | (system . 2) |
| 4549 | (paper-and-system . 3)) | 4601 | (paper-and-system . 3)) |
| 4550 | "Alist for error handler message") | 4602 | "Alist for error handler message.") |
| 4603 | |||
| 4604 | |||
| 4605 | (defconst ps-zebra-stripe-alist | ||
| 4606 | '((follow . 1) | ||
| 4607 | (full . 2) | ||
| 4608 | (full-follow . 3)) | ||
| 4609 | "Alist for zebra stripe continuation.") | ||
| 4551 | 4610 | ||
| 4552 | 4611 | ||
| 4553 | (defun ps-begin-file () | 4612 | (defun ps-begin-file () |
| @@ -4570,8 +4629,7 @@ XSTART YSTART are the relative position for the first page in a sheet.") | |||
| 4570 | ; first buffer printed | 4629 | ; first buffer printed |
| 4571 | "\n%%Creator: " (user-full-name) | 4630 | "\n%%Creator: " (user-full-name) |
| 4572 | " (using ps-print v" ps-print-version | 4631 | " (using ps-print v" ps-print-version |
| 4573 | ")\n%%CreationDate: " | 4632 | ")\n%%CreationDate: " (format-time-string "%T %b %d %Y") |
| 4574 | (time-stamp-hh:mm:ss) " " (time-stamp-mon-dd-yyyy) | ||
| 4575 | "\n%%Orientation: " | 4633 | "\n%%Orientation: " |
| 4576 | (if ps-landscape-mode "Landscape" "Portrait") | 4634 | (if ps-landscape-mode "Landscape" "Portrait") |
| 4577 | "\n%%DocumentNeededResources: font Times-Roman Times-Italic\n%%+ font " | 4635 | "\n%%DocumentNeededResources: font Times-Roman Times-Italic\n%%+ font " |
| @@ -4638,18 +4696,21 @@ XSTART YSTART are the relative position for the first page in a sheet.") | |||
| 4638 | (ps-output-boolean "ShowNofN " ps-show-n-of-n) | 4696 | (ps-output-boolean "ShowNofN " ps-show-n-of-n) |
| 4639 | 4697 | ||
| 4640 | (let ((line-height (ps-line-height 'ps-font-for-text))) | 4698 | (let ((line-height (ps-line-height 'ps-font-for-text))) |
| 4641 | (ps-output (format "/LineHeight %s def\n" line-height) | 4699 | (ps-output (format "/LineHeight %s def\n" line-height) |
| 4642 | (format "/LinesPerColumn %d def\n" | 4700 | (format "/LinesPerColumn %d def\n" |
| 4643 | (round (/ (+ ps-print-height | 4701 | (round (/ (+ ps-print-height |
| 4644 | (* line-height 0.45)) | 4702 | (* line-height 0.45)) |
| 4645 | line-height))))) | 4703 | line-height))))) |
| 4646 | 4704 | ||
| 4647 | (ps-output-boolean "WarnPaperSize " ps-warn-paper-type) | 4705 | (ps-output-boolean "WarnPaperSize " ps-warn-paper-type) |
| 4648 | (ps-output-boolean "Zebra " ps-zebra-stripes) | 4706 | (ps-output-boolean "Zebra " ps-zebra-stripes) |
| 4649 | (ps-output-boolean "ZebraFollow " ps-zebra-stripe-follow) | ||
| 4650 | (ps-output-boolean "PrintLineNumber " ps-line-number) | 4707 | (ps-output-boolean "PrintLineNumber " ps-line-number) |
| 4651 | (ps-output-boolean "SyncLineZebra " (not (integerp ps-line-number-step))) | 4708 | (ps-output-boolean "SyncLineZebra " (not (integerp ps-line-number-step))) |
| 4652 | (ps-output (format "/PrintLineStep %d def\n" | 4709 | (ps-output (format "/ZebraFollow %d def\n" |
| 4710 | (or (cdr (assq ps-zebra-stripe-follow | ||
| 4711 | ps-zebra-stripe-alist)) | ||
| 4712 | 0)) | ||
| 4713 | (format "/PrintLineStep %d def\n" | ||
| 4653 | (if (integerp ps-line-number-step) | 4714 | (if (integerp ps-line-number-step) |
| 4654 | ps-line-number-step | 4715 | ps-line-number-step |
| 4655 | ps-zebra-stripe-height)) | 4716 | ps-zebra-stripe-height)) |
| @@ -4861,7 +4922,9 @@ XSTART YSTART are the relative position for the first page in a sheet.") | |||
| 4861 | (and (re-search-backward "^%%Trailer$" nil t) | 4922 | (and (re-search-backward "^%%Trailer$" nil t) |
| 4862 | (delete-region (match-beginning 0) (point-max)))) | 4923 | (delete-region (match-beginning 0) (point-max)))) |
| 4863 | ;; miscellaneous | 4924 | ;; miscellaneous |
| 4864 | (setq ps-page-postscript 0 | 4925 | (setq ps-zebra-stripe-full-p (memq ps-zebra-stripe-follow |
| 4926 | '(full full-follow)) | ||
| 4927 | ps-page-postscript 0 | ||
| 4865 | ps-page-sheet 0 | 4928 | ps-page-sheet 0 |
| 4866 | ps-page-n-up 0 | 4929 | ps-page-n-up 0 |
| 4867 | ps-page-column 0 | 4930 | ps-page-column 0 |
| @@ -5443,7 +5506,8 @@ If FACE is not a valid face name, it is used default face." | |||
| 5443 | (setq property-change (next-property-change from nil to))) | 5506 | (setq property-change (next-property-change from nil to))) |
| 5444 | (and (< overlay-change to) ; Don't search for overlay change | 5507 | (and (< overlay-change to) ; Don't search for overlay change |
| 5445 | ; unless previous search succeeded. | 5508 | ; unless previous search succeeded. |
| 5446 | (setq overlay-change (min (next-overlay-change from) to))) | 5509 | (setq overlay-change (min (ps-e-next-overlay-change from) |
| 5510 | to))) | ||
| 5447 | (setq position (min property-change overlay-change)) | 5511 | (setq position (min property-change overlay-change)) |
| 5448 | ;; The code below is not quite correct, | 5512 | ;; The code below is not quite correct, |
| 5449 | ;; because a non-nil overlay invisible property | 5513 | ;; because a non-nil overlay invisible property |
| @@ -5461,13 +5525,13 @@ If FACE is not a valid face name, it is used default face." | |||
| 5461 | 'emacs--invisible--face) | 5525 | 'emacs--invisible--face) |
| 5462 | ((get-text-property from 'face)) | 5526 | ((get-text-property from 'face)) |
| 5463 | (t 'default))) | 5527 | (t 'default))) |
| 5464 | (let ((overlays (overlays-at from)) | 5528 | (let ((overlays (ps-e-overlays-at from)) |
| 5465 | (face-priority -1)) ; text-property | 5529 | (face-priority -1)) ; text-property |
| 5466 | (while (and overlays | 5530 | (while (and overlays |
| 5467 | (not (eq face 'emacs--invisible--face))) | 5531 | (not (eq face 'emacs--invisible--face))) |
| 5468 | (let* ((overlay (car overlays)) | 5532 | (let* ((overlay (car overlays)) |
| 5469 | (overlay-invisible (overlay-get overlay 'invisible)) | 5533 | (overlay-invisible (ps-e-overlay-get overlay 'invisible)) |
| 5470 | (overlay-priority (or (overlay-get overlay 'priority) | 5534 | (overlay-priority (or (ps-e-overlay-get overlay 'priority) |
| 5471 | 0))) | 5535 | 0))) |
| 5472 | (and (> overlay-priority face-priority) | 5536 | (and (> overlay-priority face-priority) |
| 5473 | (setq face | 5537 | (setq face |
| @@ -5478,7 +5542,7 @@ If FACE is not a valid face name, it is used default face." | |||
| 5478 | (assq overlay-invisible | 5542 | (assq overlay-invisible |
| 5479 | save-buffer-invisibility-spec))) | 5543 | save-buffer-invisibility-spec))) |
| 5480 | 'emacs--invisible--face) | 5544 | 'emacs--invisible--face) |
| 5481 | ((overlay-get overlay 'face)) | 5545 | ((ps-e-overlay-get overlay 'face)) |
| 5482 | (t face)) | 5546 | (t face)) |
| 5483 | face-priority overlay-priority))) | 5547 | face-priority overlay-priority))) |
| 5484 | (setq overlays (cdr overlays)))) | 5548 | (setq overlays (cdr overlays)))) |
| @@ -5616,7 +5680,7 @@ If FACE is not a valid face name, it is used default face." | |||
| 5616 | (let* ((coding-system-for-write 'raw-text-unix) | 5680 | (let* ((coding-system-for-write 'raw-text-unix) |
| 5617 | (ps-printer-name (or ps-printer-name | 5681 | (ps-printer-name (or ps-printer-name |
| 5618 | (and (boundp 'printer-name) | 5682 | (and (boundp 'printer-name) |
| 5619 | printer-name))) | 5683 | (symbol-value 'printer-name)))) |
| 5620 | (ps-lpr-switches | 5684 | (ps-lpr-switches |
| 5621 | (append ps-lpr-switches | 5685 | (append ps-lpr-switches |
| 5622 | (and (stringp ps-printer-name) | 5686 | (and (stringp ps-printer-name) |