Mercurial > emacs
comparison lisp/ps-print.el @ 49763:e19e88bc6e58
Change the policy of background/foreground default color.
(ps-print-version): New version number (6.5.9).
(ps-default-fg, ps-default-bg): Adjust default value.
(ps-begin-file, ps-begin-job): ps-default-fg and ps-default-bg variables now use
`t' to indicate the use of Emacs session background/foreground color.
(ps-output-string-prim): If index out of range, insert hexadecimal
representation of character.
author | Juanma Barranquero <lekktu@gmail.com> |
---|---|
date | Thu, 13 Feb 2003 11:54:34 +0000 |
parents | 330113e9df2b |
children | c919f0375a3e d7ddb3e565de |
comparison
equal
deleted
inserted
replaced
49762:3c0d2b073718 | 49763:e19e88bc6e58 |
---|---|
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, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 | 3 ;; Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, |
4 ;; Free Software Foundation, Inc. | 4 ;; 2003 Free Software Foundation, Inc. |
5 | 5 |
6 ;; Author: Jim Thompson (was <thompson@wg2.waii.com>) | 6 ;; Author: Jim Thompson (was <thompson@wg2.waii.com>) |
7 ;; Jacques Duthen (was <duthen@cegelec-red.fr>) | 7 ;; Jacques Duthen (was <duthen@cegelec-red.fr>) |
8 ;; Vinicius Jose Latorre <vinicius@cpqd.com.br> | 8 ;; Vinicius Jose Latorre <vinicius@cpqd.com.br> |
9 ;; Kenichi Handa <handa@etl.go.jp> (multi-byte characters) | 9 ;; Kenichi Handa <handa@etl.go.jp> (multi-byte characters) |
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/13 10:10:20 vinicius> | 13 ;; Time-stamp: <2003/02/12 14:05:44 vinicius> |
14 ;; Version: 6.5.8 | 14 ;; Version: 6.5.9 |
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.8" | 17 (defconst ps-print-version "6.5.9" |
18 "ps-print.el, v 6.5.8 <2002/09/13 vinicius> | 18 "ps-print.el, v 6.5.9 <2003/02/12 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 |
22 report the version of Emacs, if any, that ps-print was distributed with. | 22 report the version of Emacs, if any, that ps-print was distributed with. |
23 | 23 |
2915 (const :tag "Do NOT Print Color" nil) | 2915 (const :tag "Do NOT Print Color" nil) |
2916 (const :tag "Print Always Color" t) | 2916 (const :tag "Print Always Color" t) |
2917 (const :tag "Print Black/White Color" black-white)) | 2917 (const :tag "Print Black/White Color" black-white)) |
2918 :group 'ps-print-color) | 2918 :group 'ps-print-color) |
2919 | 2919 |
2920 (defcustom ps-default-fg (or (ps-face-foreground-name 'default) | 2920 (defcustom ps-default-fg '(0.0 0.0 0.0) ; black |
2921 '(0.0 0.0 0.0)) ; black | |
2922 "*RGB values of the default foreground color. Defaults to black." | 2921 "*RGB values of the default foreground color. Defaults to black." |
2923 :type '(choice :menu-tag "Default Foreground Gray/Color" | 2922 :type '(choice :menu-tag "Default Foreground Gray/Color" |
2924 :tag "Default Foreground Gray/Color" | 2923 :tag "Default Foreground Gray/Color" |
2924 (const :tag "Session Foreground" t) | |
2925 (number :tag "Gray Scale" :value 0.0) | 2925 (number :tag "Gray Scale" :value 0.0) |
2926 (string :tag "Color Name" :value "black") | 2926 (string :tag "Color Name" :value "black") |
2927 (list :tag "RGB Color" :value (0.0 0.0 0.0) | 2927 (list :tag "RGB Color" :value (0.0 0.0 0.0) |
2928 (number :tag "Red") | 2928 (number :tag "Red") |
2929 (number :tag "Green") | 2929 (number :tag "Green") |
2930 (number :tag "Blue"))) | 2930 (number :tag "Blue"))) |
2931 :group 'ps-print-color) | 2931 :group 'ps-print-color) |
2932 | 2932 |
2933 (defcustom ps-default-bg (or (ps-face-background-name 'default) | 2933 (defcustom ps-default-bg '(1.0 1.0 1.0) ; white |
2934 '(1.0 1.0 1.0)) ; white | |
2935 "*RGB values of the default background color. Defaults to white." | 2934 "*RGB values of the default background color. Defaults to white." |
2936 :type '(choice :menu-tag "Default Background Gray/Color" | 2935 :type '(choice :menu-tag "Default Background Gray/Color" |
2937 :tag "Default Background Gray/Color" | 2936 :tag "Default Background Gray/Color" |
2937 (const :tag "Session Background" t) | |
2938 (number :tag "Gray Scale" :value 1.0) | 2938 (number :tag "Gray Scale" :value 1.0) |
2939 (string :tag "Color Name" :value "white") | 2939 (string :tag "Color Name" :value "white") |
2940 (list :tag "RGB Color" :value (1.0 1.0 1.0) | 2940 (list :tag "RGB Color" :value (1.0 1.0 1.0) |
2941 (number :tag "Red") | 2941 (number :tag "Red") |
2942 (number :tag "Green") | 2942 (number :tag "Green") |
4516 ;; Find and quote special characters as necessary for PS | 4516 ;; Find and quote special characters as necessary for PS |
4517 ;; This skips everything except control chars, non-ASCII chars, (, ) and \. | 4517 ;; This skips everything except control chars, non-ASCII chars, (, ) and \. |
4518 (while (progn (skip-chars-forward " -'*-[]-~") (not (eobp))) | 4518 (while (progn (skip-chars-forward " -'*-[]-~") (not (eobp))) |
4519 (let ((special (following-char))) | 4519 (let ((special (following-char))) |
4520 (delete-char 1) | 4520 (delete-char 1) |
4521 (insert (aref ps-string-escape-codes special)))) | 4521 (insert |
4522 (if (and (<= 0 special) (<= special 255)) | |
4523 (aref ps-string-escape-codes special) | |
4524 ;; insert hexadecimal representation if character code is out of range | |
4525 (format "\\%04X" special) | |
4526 )))) | |
4522 (goto-char (point-max)) | 4527 (goto-char (point-max)) |
4523 (insert ")")) ;insert end-string delimiter | 4528 (insert ")")) ;insert end-string delimiter |
4524 | 4529 |
4525 (defsubst ps-init-output-queue () | 4530 (defsubst ps-init-output-queue () |
4526 (setq ps-output-head (list "") | 4531 (setq ps-output-head (list "") |
5378 (format "def\n/ZebraHeight %d def\n" | 5383 (format "def\n/ZebraHeight %d def\n" |
5379 ps-zebra-stripe-height) | 5384 ps-zebra-stripe-height) |
5380 "/ZebraColor " | 5385 "/ZebraColor " |
5381 (ps-format-color ps-zebra-color 0.95) | 5386 (ps-format-color ps-zebra-color 0.95) |
5382 "def\n/BackgroundColor " | 5387 "def\n/BackgroundColor " |
5383 (ps-format-color ps-default-bg 1.0) | 5388 (ps-format-color |
5389 (if (eq ps-default-bg t) | |
5390 (ps-face-background-name 'default) | |
5391 ps-default-bg) | |
5392 1.0) | |
5384 "def\n/UseSetpagedevice " | 5393 "def\n/UseSetpagedevice " |
5385 (if (eq ps-spool-config 'setpagedevice) | 5394 (if (eq ps-spool-config 'setpagedevice) |
5386 "/setpagedevice where{pop languagelevel 2 eq}{false}ifelse" | 5395 "/setpagedevice where{pop languagelevel 2 eq}{false}ifelse" |
5387 "false") | 5396 "false") |
5388 " def\n\n/PageWidth " | 5397 " def\n\n/PageWidth " |
5639 ((eq ps-print-control-characters 'control-8-bit) | 5648 ((eq ps-print-control-characters 'control-8-bit) |
5640 (string-as-unibyte "[\000-\037\177-\237]")) | 5649 (string-as-unibyte "[\000-\037\177-\237]")) |
5641 ((eq ps-print-control-characters 'control) | 5650 ((eq ps-print-control-characters 'control) |
5642 "[\000-\037\177]") | 5651 "[\000-\037\177]") |
5643 (t "[\t\n\f]")) | 5652 (t "[\t\n\f]")) |
5644 ps-default-foreground (ps-rgb-color ps-default-fg 0.0) | 5653 ps-default-foreground (ps-rgb-color |
5654 (if (eq ps-default-fg t) | |
5655 (ps-face-foreground-name 'default) | |
5656 ps-default-fg) | |
5657 0.0) | |
5645 ps-default-color (and (eq ps-print-color-p t) ps-default-foreground) | 5658 ps-default-color (and (eq ps-print-color-p t) ps-default-foreground) |
5646 ps-current-color ps-default-color | 5659 ps-current-color ps-default-color |
5647 ;; Set the color scale. We do it here instead of in the defvar so | 5660 ;; Set the color scale. We do it here instead of in the defvar so |
5648 ;; that ps-print can be dumped into emacs. This expression can't be | 5661 ;; that ps-print can be dumped into emacs. This expression can't be |
5649 ;; evaluated at dump-time because X isn't initialized. | 5662 ;; evaluated at dump-time because X isn't initialized. |