]> git.eshelyaron.com Git - emacs.git/commitdiff
Use default color when color is unspecified.
authorVinicius Jose Latorre <viniciusjl@ig.com.br>
Sun, 13 May 2007 21:33:57 +0000 (21:33 +0000)
committerVinicius Jose Latorre <viniciusjl@ig.com.br>
Sun, 13 May 2007 21:33:57 +0000 (21:33 +0000)
lisp/ChangeLog.unicode
lisp/ps-print.el

index 792aabf03b88db350933efaa43d98f64a15536db..88bc519abdd1f5eac211018c0825f4d1f771c7d0 100644 (file)
@@ -1,3 +1,12 @@
+2007-05-13  Vinicius Jose Latorre  <viniciusjl@ig.com.br>
+
+       * ps-print.el: Use default color when foreground or background color
+       are unspecified.  Reported by Leo <sdl.web@gmail.com>.
+       (ps-print-version): New version 7.2.3.
+       (ps-rgb-color): New argument.  Use default color when color is
+       unspecified.
+       (ps-begin-job): Fix code.
+
 2007-03-28  Riccardo Murri  <riccardo.murri@gmail.com>
 
        * vc-bzr.el: New file.
index 71117a2f240b155cc207315c81d71a934cc63842..3cc887fd40f36283c3033958cdd2e99177197961 100644 (file)
 ;; Maintainer: Kenichi Handa <handa@m17n.org> (multi-byte characters)
 ;;     Vinicius Jose Latorre <viniciusjl@ig.com.br>
 ;; Keywords: wp, print, PostScript
-;; Version: 7.2.2
+;; Version: 7.2.3
 ;; X-URL: http://www.emacswiki.org/cgi-bin/wiki/ViniciusJoseLatorre
 
-(defconst ps-print-version "7.2.2"
-  "ps-print.el, v 7.2.2 <2007/02/07 vinicius>
+(defconst ps-print-version "7.2.3"
+  "ps-print.el, v 7.2.3 <2007/05/13 vinicius>
 
 Vinicius's last change version -- this file may have been edited as part of
 Emacs without changes to the version number.  When reporting bugs, please also
@@ -5603,21 +5603,27 @@ XSTART YSTART are the relative position for the first page in a sheet.")
   (ps-get-size (symbol-value font-sym) "font size" font-sym))
 
 
-(defun ps-rgb-color (color default)
-  (cond ((and color (listp color) (= (length color) 3)
-             (let ((cl color)
-                   (ok t) e)
-               (while (and ok cl)
-                 (setq e  (car cl)
-                       cl (cdr cl)
-                       ok (and (floatp e) (<= 0.0 e) (<= e 1.0))))
-               ok))
-        color)
-       ((and (floatp color) (<= 0.0 color) (<= color 1.0))
-        (list color color color))
-       ((stringp color) (ps-color-scale color))
-       (t (list default default default))
-       ))
+(defun ps-rgb-color (color unspecified default)
+  (cond
+   ;; (float float float) ==> (R G B)
+   ((and color (listp color) (= (length color) 3)
+        (let ((cl color)
+              (ok t) e)
+          (while (and ok cl)
+            (setq e  (car cl)
+                  cl (cdr cl)
+                  ok (and (floatp e) (<= 0.0 e) (<= e 1.0))))
+          ok))
+    color)
+   ;; float ==> 0.0 = black .. 1.0 = white
+   ((and (floatp color) (<= 0.0 color) (<= color 1.0))
+    (list color color color))
+   ;; "colorName" but different from "unspecified-[bf]g"
+   ((and (stringp color) (not (string= color unspecified)))
+    (ps-color-scale color))
+   ;; ok, use the default
+   (t
+    (list default default default))))
 
 (defvar ps-basic-plot-string-function 'ps-basic-plot-string)
 
@@ -5700,6 +5706,7 @@ XSTART YSTART are the relative position for the first page in a sheet.")
                                 (ps-face-background-name 'default))
                                (t
                                 ps-default-bg))
+                              "unspecified-bg"
                               1.0)
        ps-default-foreground (ps-rgb-color
                               (cond
@@ -5711,6 +5718,7 @@ XSTART YSTART are the relative position for the first page in a sheet.")
                                 (ps-face-foreground-name 'default))
                                (t
                                 ps-default-fg))
+                              "unspecified-fg"
                               0.0)
        ps-default-color (and (eq ps-print-color-p t) ps-default-foreground)
        ps-current-color ps-default-color