diff options
| author | Richard M. Stallman | 2002-09-29 03:30:41 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2002-09-29 03:30:41 +0000 |
| commit | eafa92bfe04933aed26a5b40559c554fbf075d4d (patch) | |
| tree | 844a6293712b3e709527aab72fa8b693a08bd690 | |
| parent | f029e7b0e917f0e349806b40ea3deb0f71d50141 (diff) | |
| download | emacs-eafa92bfe04933aed26a5b40559c554fbf075d4d.tar.gz emacs-eafa92bfe04933aed26a5b40559c554fbf075d4d.zip | |
(ps-print-emacs-type): Error if ps-print is
activated in Epoch, inLucid or in Emacs v19 or lesser.
Value can no longer be `lucid'.
(ps-print-version): New version number (6.5.8).
(faces): Never do (require 'faces).
| -rw-r--r-- | lisp/ps-print.el | 58 |
1 files changed, 31 insertions, 27 deletions
diff --git a/lisp/ps-print.el b/lisp/ps-print.el index 4e6ef9b87e0..67b25b3094a 100644 --- a/lisp/ps-print.el +++ b/lisp/ps-print.el | |||
| @@ -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 | ;; Vinicius Jose Latorre <vinicius@cpqd.com.br> | 11 | ;; Vinicius Jose Latorre <vinicius@cpqd.com.br> |
| 12 | ;; Keywords: wp, print, PostScript | 12 | ;; Keywords: wp, print, PostScript |
| 13 | ;; Time-stamp: <2002/09/11 15:52:39 vinicius> | 13 | ;; Time-stamp: <2002/09/13 10:10:20 vinicius> |
| 14 | ;; Version: 6.5.7 | 14 | ;; Version: 6.5.8 |
| 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.5.7" | 17 | (defconst ps-print-version "6.5.8" |
| 18 | "ps-print.el, v 6.5.7 <2002/09/11 vinicius> | 18 | "ps-print.el, v 6.5.8 <2002/09/13 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 |
| @@ -49,8 +49,8 @@ Please send all bug fixes and enhancements to | |||
| 49 | ;; | 49 | ;; |
| 50 | ;; This package provides printing of Emacs buffers on PostScript printers; the | 50 | ;; This package provides printing of Emacs buffers on PostScript printers; the |
| 51 | ;; buffer's bold and italic text attributes are preserved in the printer | 51 | ;; buffer's bold and italic text attributes are preserved in the printer |
| 52 | ;; output. ps-print is intended for use with Emacs or Lucid Emacs, together | 52 | ;; output. ps-print is intended for use with Emacs or XEmacs, together with a |
| 53 | ;; with a fontifying package such as font-lock or hilit. | 53 | ;; fontifying package such as font-lock or hilit. |
| 54 | ;; | 54 | ;; |
| 55 | ;; ps-print uses the same face attributes defined through font-lock or hilit to | 55 | ;; ps-print uses the same face attributes defined through font-lock or hilit to |
| 56 | ;; print a PostScript file, but some faces are better seeing on the screen than | 56 | ;; print a PostScript file, but some faces are better seeing on the screen than |
| @@ -1329,7 +1329,7 @@ Please send all bug fixes and enhancements to | |||
| 1329 | ;; | 1329 | ;; |
| 1330 | ;; Faces are always treated as opaque. | 1330 | ;; Faces are always treated as opaque. |
| 1331 | ;; | 1331 | ;; |
| 1332 | ;; Epoch and Emacs 19 not supported. At all. | 1332 | ;; Epoch, Lucid and Emacs 19 not supported. At all. |
| 1333 | ;; | 1333 | ;; |
| 1334 | ;; Fixed-pitch fonts work better for line folding, but are not required. | 1334 | ;; Fixed-pitch fonts work better for line folding, but are not required. |
| 1335 | ;; | 1335 | ;; |
| @@ -1442,6 +1442,20 @@ Please send all bug fixes and enhancements to | |||
| 1442 | (error "`ps-print' requires floating point support")) | 1442 | (error "`ps-print' requires floating point support")) |
| 1443 | 1443 | ||
| 1444 | 1444 | ||
| 1445 | (defvar ps-print-emacs-type | ||
| 1446 | (let ((case-fold-search t)) | ||
| 1447 | (cond ((string-match "XEmacs" emacs-version) 'xemacs) | ||
| 1448 | ((string-match "Lucid" emacs-version) | ||
| 1449 | (error "`ps-print' doesn't support Lucid")) | ||
| 1450 | ((string-match "Epoch" emacs-version) | ||
| 1451 | (error "`ps-print' doesn't support Epoch")) | ||
| 1452 | (t | ||
| 1453 | (unless (and (boundp 'emacs-major-version) | ||
| 1454 | (> emacs-major-version 19)) | ||
| 1455 | (error "`ps-print' only supports Emacs 20 and higher")) | ||
| 1456 | 'emacs)))) | ||
| 1457 | |||
| 1458 | |||
| 1445 | ;; For Emacs 20.2 and the earlier version. | 1459 | ;; For Emacs 20.2 and the earlier version. |
| 1446 | 1460 | ||
| 1447 | (or (fboundp 'set-buffer-multibyte) | 1461 | (or (fboundp 'set-buffer-multibyte) |
| @@ -1510,16 +1524,6 @@ Please send all bug fixes and enhancements to | |||
| 1510 | (memq system-type '(usg-unix-v dgux hpux irix))) | 1524 | (memq system-type '(usg-unix-v dgux hpux irix))) |
| 1511 | 1525 | ||
| 1512 | 1526 | ||
| 1513 | (defvar ps-print-emacs-type | ||
| 1514 | (cond ((string-match "XEmacs" emacs-version) 'xemacs) | ||
| 1515 | ((string-match "Lucid" emacs-version) 'lucid) | ||
| 1516 | ((string-match "Epoch" emacs-version) 'epoch) | ||
| 1517 | (t 'emacs))) | ||
| 1518 | |||
| 1519 | (or (memq ps-print-emacs-type '(lucid xemacs)) | ||
| 1520 | (require 'faces)) ; face-font, face-underline-p, | ||
| 1521 | ; x-font-regexp | ||
| 1522 | |||
| 1523 | (defun ps-xemacs-color-name (color) | 1527 | (defun ps-xemacs-color-name (color) |
| 1524 | (if (ps-x-color-specifier-p color) | 1528 | (if (ps-x-color-specifier-p color) |
| 1525 | (ps-x-color-name color) | 1529 | (ps-x-color-name color) |
| @@ -1533,7 +1537,7 @@ Please send all bug fixes and enhancements to | |||
| 1533 | (defalias 'ps-face-foreground-name 'face-foreground) | 1537 | (defalias 'ps-face-foreground-name 'face-foreground) |
| 1534 | (defalias 'ps-face-background-name 'face-background) | 1538 | (defalias 'ps-face-background-name 'face-background) |
| 1535 | ) | 1539 | ) |
| 1536 | (t ; xemacs, lucid, epoch | 1540 | (t ; xemacs |
| 1537 | (defalias 'ps-mark-active-p 'region-active-p) | 1541 | (defalias 'ps-mark-active-p 'region-active-p) |
| 1538 | (defun ps-face-foreground-name (face) | 1542 | (defun ps-face-foreground-name (face) |
| 1539 | (ps-xemacs-color-name (face-foreground face))) | 1543 | (ps-xemacs-color-name (face-foreground face))) |
| @@ -3177,13 +3181,13 @@ It's like the very first character of buffer (or region) is ^L (\\014)." | |||
| 3177 | (or (cond | 3181 | (or (cond |
| 3178 | ((eq ps-print-emacs-type 'emacs) ; emacs | 3182 | ((eq ps-print-emacs-type 'emacs) ; emacs |
| 3179 | data-directory) | 3183 | data-directory) |
| 3180 | ((fboundp 'locate-data-directory) ; emacsens (xemacs, etc.) | 3184 | ((fboundp 'locate-data-directory) ; xemacs |
| 3181 | (locate-data-directory "ps-print")) | 3185 | (locate-data-directory "ps-print")) |
| 3182 | ((boundp 'data-directory) ; emacsens (xemacs, etc.) | 3186 | ((boundp 'data-directory) ; xemacs |
| 3183 | data-directory) | 3187 | data-directory) |
| 3184 | (t ; don't know what to do | 3188 | (t ; don't know what to do |
| 3185 | nil)) | 3189 | nil)) |
| 3186 | (error "ps-postscript-code-directory isn't set properly")) | 3190 | (error "`ps-postscript-code-directory' isn't set properly")) |
| 3187 | "*Directory where it's located the PostScript prologue file used by ps-print. | 3191 | "*Directory where it's located the PostScript prologue file used by ps-print. |
| 3188 | By default, this directory is the same as in the variable `data-directory'." | 3192 | By default, this directory is the same as in the variable `data-directory'." |
| 3189 | :type 'directory | 3193 | :type 'directory |
| @@ -3642,7 +3646,7 @@ It can be retrieved with `(ps-get ALIST-SYM KEY)'." | |||
| 3642 | 3646 | ||
| 3643 | 3647 | ||
| 3644 | (eval-and-compile | 3648 | (eval-and-compile |
| 3645 | (and (memq ps-print-emacs-type '(lucid xemacs)) | 3649 | (and (eq ps-print-emacs-type 'xemacs) |
| 3646 | ;; XEmacs change: Need to check for emacs-major-version too. | 3650 | ;; XEmacs change: Need to check for emacs-major-version too. |
| 3647 | (or (< emacs-major-version 19) | 3651 | (or (< emacs-major-version 19) |
| 3648 | (and (= emacs-major-version 19) (< emacs-minor-version 12))) | 3652 | (and (= emacs-major-version 19) (< emacs-minor-version 12))) |
| @@ -3707,7 +3711,7 @@ It can be retrieved with `(ps-get ALIST-SYM KEY)'." | |||
| 3707 | (memq face ps-italic-faces))) | 3711 | (memq face ps-italic-faces))) |
| 3708 | ) | 3712 | ) |
| 3709 | 3713 | ||
| 3710 | (t ; xemacs, lucid, epoch | 3714 | (t ; xemacs |
| 3711 | 3715 | ||
| 3712 | ;; to avoid XEmacs compilation gripes | 3716 | ;; to avoid XEmacs compilation gripes |
| 3713 | (defvar coding-system-for-write nil) | 3717 | (defvar coding-system-for-write nil) |
| @@ -3829,7 +3833,7 @@ Note: No major/minor-mode is activated and no local variables are evaluated for | |||
| 3829 | ;; PostScript output. | 3833 | ;; PostScript output. |
| 3830 | "%0.3f %0.3f %0.3f" | 3834 | "%0.3f %0.3f %0.3f" |
| 3831 | 3835 | ||
| 3832 | ;; Lucid emacsen will have to make do with %s (princ) for floats. | 3836 | ;; XEmacs will have to make do with %s (princ) for floats. |
| 3833 | "%s %s %s")) | 3837 | "%s %s %s")) |
| 3834 | 3838 | ||
| 3835 | ;; These values determine how much print-height to deduct when headers/footers | 3839 | ;; These values determine how much print-height to deduct when headers/footers |
| @@ -4690,11 +4694,11 @@ page-height == ((floor print-height ((th + ls) * zh)) * ((th + ls) * zh)) - th | |||
| 4690 | 4694 | ||
| 4691 | ;; Emacs understands the %f format; we'll use it to limit color RGB values | 4695 | ;; Emacs understands the %f format; we'll use it to limit color RGB values |
| 4692 | ;; to three decimals to cut down some on the size of the PostScript output. | 4696 | ;; to three decimals to cut down some on the size of the PostScript output. |
| 4693 | ;; Lucid emacsen will have to make do with %s (princ) for floats. | 4697 | ;; XEmacs will have to make do with %s (princ) for floats. |
| 4694 | 4698 | ||
| 4695 | (defvar ps-float-format (if (eq ps-print-emacs-type 'emacs) | 4699 | (defvar ps-float-format (if (eq ps-print-emacs-type 'emacs) |
| 4696 | "%0.3f " ; emacs | 4700 | "%0.3f " ; emacs |
| 4697 | "%s ")) ; Lucid emacsen | 4701 | "%s ")) ; xemacs |
| 4698 | 4702 | ||
| 4699 | 4703 | ||
| 4700 | (defun ps-float-format (value &optional default) | 4704 | (defun ps-float-format (value &optional default) |
| @@ -6184,7 +6188,7 @@ If FACE is not a valid face name, it is used default face." | |||
| 6184 | (let ((face 'default) | 6188 | (let ((face 'default) |
| 6185 | (position to)) | 6189 | (position to)) |
| 6186 | (cond | 6190 | (cond |
| 6187 | ((memq ps-print-emacs-type '(xemacs lucid)) | 6191 | ((eq ps-print-emacs-type 'xemacs) |
| 6188 | ;; Build the list of extents... | 6192 | ;; Build the list of extents... |
| 6189 | (let ((a (cons 'dummy nil)) | 6193 | (let ((a (cons 'dummy nil)) |
| 6190 | record type extent extent-list) | 6194 | record type extent extent-list) |