aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVinicius Jose Latorre2007-05-18 02:39:28 +0000
committerVinicius Jose Latorre2007-05-18 02:39:28 +0000
commitadbdb661ada01b7916dd6bd2f0c27d6bfe65da8e (patch)
tree4d794bbad8e5fa8d84cdbdc0cfd3a3f2a9010f56
parentc667e20d3cc84e84bf9f43997d4885586f4d00ba (diff)
downloademacs-adbdb661ada01b7916dd6bd2f0c27d6bfe65da8e.tar.gz
emacs-adbdb661ada01b7916dd6bd2f0c27d6bfe65da8e.zip
Use default color when foreground or background color are unspecified.
-rw-r--r--lisp/ChangeLog9
-rw-r--r--lisp/ps-print.el44
2 files changed, 35 insertions, 18 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 7d083fb7976..22aab5cfe4d 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,12 @@
12007-05-17 Vinicius Jose Latorre <viniciusjl@ig.com.br>
2
3 * ps-print.el: Use default color when foreground or background color
4 are unspecified. Reported by Leo <sdl.web@gmail.com>.
5 (ps-print-version): New version 6.7.4.
6 (ps-rgb-color): New argument. Use default color when color is
7 unspecified.
8 (ps-begin-job): Fix code.
9
12007-05-17 Martin Rudalics <rudalics@gmx.at> 102007-05-17 Martin Rudalics <rudalics@gmx.at>
2 11
3 * textmodes/ispell.el (ispell-start-process): Defend against bad 12 * textmodes/ispell.el (ispell-start-process): Defend against bad
diff --git a/lisp/ps-print.el b/lisp/ps-print.el
index 4762f5173c3..ea86d15e557 100644
--- a/lisp/ps-print.el
+++ b/lisp/ps-print.el
@@ -10,11 +10,11 @@
10;; Maintainer: Kenichi Handa <handa@m17n.org> (multi-byte characters) 10;; Maintainer: Kenichi Handa <handa@m17n.org> (multi-byte characters)
11;; Vinicius Jose Latorre <viniciusjl@ig.com.br> 11;; Vinicius Jose Latorre <viniciusjl@ig.com.br>
12;; Keywords: wp, print, PostScript 12;; Keywords: wp, print, PostScript
13;; Version: 6.7.3 13;; Version: 6.7.4
14;; X-URL: http://www.emacswiki.org/cgi-bin/wiki/ViniciusJoseLatorre 14;; X-URL: http://www.emacswiki.org/cgi-bin/wiki/ViniciusJoseLatorre
15 15
16(defconst ps-print-version "6.7.3" 16(defconst ps-print-version "6.7.4"
17 "ps-print.el, v 6.7.3 <2007/02/06 vinicius> 17 "ps-print.el, v 6.7.4 <2007/05/13 vinicius>
18 18
19Vinicius's last change version -- this file may have been edited as part of 19Vinicius's last change version -- this file may have been edited as part of
20Emacs without changes to the version number. When reporting bugs, please also 20Emacs without changes to the version number. When reporting bugs, please also
@@ -5817,21 +5817,27 @@ XSTART YSTART are the relative position for the first page in a sheet.")
5817 (ps-get-size (symbol-value font-sym) "font size" font-sym)) 5817 (ps-get-size (symbol-value font-sym) "font size" font-sym))
5818 5818
5819 5819
5820(defun ps-rgb-color (color default) 5820(defun ps-rgb-color (color unspecified default)
5821 (cond ((and color (listp color) (= (length color) 3) 5821 (cond
5822 (let ((cl color) 5822 ;; (float float float) ==> (R G B)
5823 (ok t) e) 5823 ((and color (listp color) (= (length color) 3)
5824 (while (and ok cl) 5824 (let ((cl color)
5825 (setq e (car cl) 5825 (ok t) e)
5826 cl (cdr cl) 5826 (while (and ok cl)
5827 ok (and (floatp e) (<= 0.0 e) (<= e 1.0)))) 5827 (setq e (car cl)
5828 ok)) 5828 cl (cdr cl)
5829 color) 5829 ok (and (floatp e) (<= 0.0 e) (<= e 1.0))))
5830 ((and (floatp color) (<= 0.0 color) (<= color 1.0)) 5830 ok))
5831 (list color color color)) 5831 color)
5832 ((stringp color) (ps-color-scale color)) 5832 ;; float ==> 0.0 = black .. 1.0 = white
5833 (t (list default default default)) 5833 ((and (floatp color) (<= 0.0 color) (<= color 1.0))
5834 )) 5834 (list color color color))
5835 ;; "colorName" but different from "unspecified-[bf]g"
5836 ((and (stringp color) (not (string= color unspecified)))
5837 (ps-color-scale color))
5838 ;; ok, use the default
5839 (t
5840 (list default default default))))
5835 5841
5836 5842
5837(defun ps-begin-job (genfunc) 5843(defun ps-begin-job (genfunc)
@@ -5913,6 +5919,7 @@ XSTART YSTART are the relative position for the first page in a sheet.")
5913 (ps-face-background-name 'default)) 5919 (ps-face-background-name 'default))
5914 (t 5920 (t
5915 ps-default-bg)) 5921 ps-default-bg))
5922 "unspecified-bg"
5916 1.0) 5923 1.0)
5917 ps-default-foreground (ps-rgb-color 5924 ps-default-foreground (ps-rgb-color
5918 (cond 5925 (cond
@@ -5924,6 +5931,7 @@ XSTART YSTART are the relative position for the first page in a sheet.")
5924 (ps-face-foreground-name 'default)) 5931 (ps-face-foreground-name 'default))
5925 (t 5932 (t
5926 ps-default-fg)) 5933 ps-default-fg))
5934 "unspecified-fg"
5927 0.0) 5935 0.0)
5928 ps-default-color (and (eq ps-print-color-p t) ps-default-foreground) 5936 ps-default-color (and (eq ps-print-color-p t) ps-default-foreground)
5929 ps-current-color ps-default-color 5937 ps-current-color ps-default-color