Mercurial > emacs
comparison lisp/ps-print.el @ 32914:29cbd0eb60e6
Avoid compilation gripes.
(ps-print-version): New version number (6.2.1).
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Thu, 26 Oct 2000 14:15:15 +0000 |
parents | 2d9f4fc56dba |
children | a48e4118492d |
comparison
equal
deleted
inserted
replaced
32913:8a79f057b2a5 | 32914:29cbd0eb60e6 |
---|---|
7 ;; Author: Vinicius Jose Latorre <vinicius@cpqd.com.br> | 7 ;; Author: Vinicius Jose Latorre <vinicius@cpqd.com.br> |
8 ;; Author: Kenichi Handa <handa@etl.go.jp> (multi-byte characters) | 8 ;; Author: Kenichi Handa <handa@etl.go.jp> (multi-byte characters) |
9 ;; Maintainer: Kenichi Handa <handa@etl.go.jp> (multi-byte characters) | 9 ;; Maintainer: Kenichi Handa <handa@etl.go.jp> (multi-byte characters) |
10 ;; Maintainer: Vinicius Jose Latorre <vinicius@cpqd.com.br> | 10 ;; Maintainer: Vinicius Jose Latorre <vinicius@cpqd.com.br> |
11 ;; Keywords: wp, print, PostScript | 11 ;; Keywords: wp, print, PostScript |
12 ;; Time-stamp: <2000/10/18 18:31:37 vinicius> | 12 ;; Time-stamp: <2000/10/19 11:54:10 vinicius> |
13 ;; Version: 6.2 | 13 ;; Version: 6.2.1 |
14 ;; X-URL: http://www.cpqd.com.br/~vinicius/emacs/ | 14 ;; X-URL: http://www.cpqd.com.br/~vinicius/emacs/ |
15 | 15 |
16 (defconst ps-print-version "6.2" | 16 (defconst ps-print-version "6.2.1" |
17 "ps-print.el, v 6.2 <2000/10/18 vinicius> | 17 "ps-print.el, v 6.2.1 <2000/10/19 vinicius> |
18 | 18 |
19 Vinicius's last change version -- this file may have been edited as part of | 19 Vinicius's last change version -- this file may have been edited as part of |
20 Emacs without changes to the version number. When reporting bugs, please also | 20 Emacs without changes to the version number. When reporting bugs, please also |
21 report the version of Emacs, if any, that ps-print was distributed with. | 21 report the version of Emacs, if any, that ps-print was distributed with. |
22 | 22 |
2921 (t ; emacs | 2921 (t ; emacs |
2922 (defun ps-color-device () | 2922 (defun ps-color-device () |
2923 t) | 2923 t) |
2924 )) | 2924 )) |
2925 | 2925 |
2926 (defun ps-mapper (extent list) | |
2927 (nconc list | |
2928 (list (list (ps-x-extent-start-position extent) 'push extent) | |
2929 (list (ps-x-extent-end-position extent) 'pull extent))) | |
2930 nil) | |
2931 | |
2932 (defun ps-extent-sorter (a b) | |
2933 (< (ps-x-extent-priority a) (ps-x-extent-priority b))) | |
2934 | |
2935 (defun ps-xemacs-face-kind-p (face kind kind-regex) | |
2936 (let* ((frame-font (or (ps-x-face-font-instance face) | |
2937 (ps-x-face-font-instance 'default))) | |
2938 (kind-cons | |
2939 (and frame-font | |
2940 (assq kind | |
2941 (ps-x-font-instance-properties frame-font)))) | |
2942 (kind-spec (cdr-safe kind-cons)) | |
2943 (case-fold-search t)) | |
2944 (and kind-spec (string-match kind-regex kind-spec)))) | |
2945 | |
2946 (defun ps-xemacs-color-name (color) | |
2947 (if (ps-x-color-specifier-p color) | |
2948 (ps-x-color-name color) | |
2949 color)) | |
2950 | |
2926 (cond ((eq ps-print-emacs-type 'emacs) ; emacs | 2951 (cond ((eq ps-print-emacs-type 'emacs) ; emacs |
2927 | 2952 |
2928 (defun ps-color-values (x-color) | 2953 (defun ps-color-values (x-color) |
2929 (if (fboundp 'x-color-values) | 2954 (if (fboundp 'x-color-values) |
2930 (x-color-values x-color) | 2955 (x-color-values x-color) |
2945 ; lucid | 2970 ; lucid |
2946 (t ; epoch | 2971 (t ; epoch |
2947 | 2972 |
2948 (or (ps-x-find-coding-system 'raw-text-unix) | 2973 (or (ps-x-find-coding-system 'raw-text-unix) |
2949 (ps-x-copy-coding-system 'no-conversion-unix 'raw-text-unix)) | 2974 (ps-x-copy-coding-system 'no-conversion-unix 'raw-text-unix)) |
2950 | |
2951 (defun ps-mapper (extent list) | |
2952 (nconc list | |
2953 (list (list (ps-x-extent-start-position extent) 'push extent) | |
2954 (list (ps-x-extent-end-position extent) 'pull extent))) | |
2955 nil) | |
2956 | |
2957 (defun ps-extent-sorter (a b) | |
2958 (< (ps-x-extent-priority a) (ps-x-extent-priority b))) | |
2959 | |
2960 (defun ps-xemacs-face-kind-p (face kind kind-regex) | |
2961 (let* ((frame-font (or (ps-x-face-font-instance face) | |
2962 (ps-x-face-font-instance 'default))) | |
2963 (kind-cons | |
2964 (and frame-font | |
2965 (assq kind | |
2966 (ps-x-font-instance-properties frame-font)))) | |
2967 (kind-spec (cdr-safe kind-cons)) | |
2968 (case-fold-search t)) | |
2969 (and kind-spec (string-match kind-regex kind-spec)))) | |
2970 | |
2971 (defun ps-xemacs-color-name (color) | |
2972 (if (ps-x-color-specifier-p color) | |
2973 (ps-x-color-name color) | |
2974 color)) | |
2975 | 2975 |
2976 (defun ps-color-values (x-color) | 2976 (defun ps-color-values (x-color) |
2977 (let ((color (ps-xemacs-color-name x-color))) | 2977 (let ((color (ps-xemacs-color-name x-color))) |
2978 (cond | 2978 (cond |
2979 ((fboundp 'x-color-values) | 2979 ((fboundp 'x-color-values) |
3002 (ps-xemacs-face-kind-p face 'SLANT "i\\|o") | 3002 (ps-xemacs-face-kind-p face 'SLANT "i\\|o") |
3003 (memq face ps-italic-faces))) ; Kludge-compatible | 3003 (memq face ps-italic-faces))) ; Kludge-compatible |
3004 ))) | 3004 ))) |
3005 | 3005 |
3006 | 3006 |
3007 (defvar ps-print-color-scale nil) | |
3008 | |
3007 (defun ps-color-scale (color) | 3009 (defun ps-color-scale (color) |
3008 ;; Scale 16-bit X-COLOR-VALUE to PostScript color value in [0, 1] interval. | 3010 ;; Scale 16-bit X-COLOR-VALUE to PostScript color value in [0, 1] interval. |
3009 (mapcar #'(lambda (value) (/ value ps-print-color-scale)) | 3011 (mapcar #'(lambda (value) (/ value ps-print-color-scale)) |
3010 (ps-color-values color))) | 3012 (ps-color-values color))) |
3011 | 3013 |
3106 (defvar ps-print-width nil) | 3108 (defvar ps-print-width nil) |
3107 (defvar ps-print-height nil) | 3109 (defvar ps-print-height nil) |
3108 | 3110 |
3109 (defvar ps-height-remaining nil) | 3111 (defvar ps-height-remaining nil) |
3110 (defvar ps-width-remaining nil) | 3112 (defvar ps-width-remaining nil) |
3111 | |
3112 (defvar ps-print-color-scale nil) | |
3113 | 3113 |
3114 (defvar ps-font-size-internal nil) | 3114 (defvar ps-font-size-internal nil) |
3115 (defvar ps-header-font-size-internal nil) | 3115 (defvar ps-header-font-size-internal nil) |
3116 (defvar ps-header-title-font-size-internal nil) | 3116 (defvar ps-header-title-font-size-internal nil) |
3117 | 3117 |
5214 (ps-face-background-name face)))) | 5214 (ps-face-background-name face)))) |
5215 | 5215 |
5216 | 5216 |
5217 ;; to avoid compilation gripes | 5217 ;; to avoid compilation gripes |
5218 (eval-and-compile | 5218 (eval-and-compile |
5219 (require 'lazy-lock) | |
5220 | |
5219 (defun ps-print-ensure-fontified (start end) | 5221 (defun ps-print-ensure-fontified (start end) |
5220 (and (boundp 'lazy-lock-mode) (symbol-value 'lazy-lock-mode) | 5222 (and (boundp 'lazy-lock-mode) (symbol-value 'lazy-lock-mode) |
5221 (lazy-lock-fontify-region start end)))) | 5223 (lazy-lock-fontify-region start end)))) |
5222 | 5224 |
5223 | 5225 |