diff options
| author | Vinicius Jose Latorre | 2007-05-13 21:29:33 +0000 |
|---|---|---|
| committer | Vinicius Jose Latorre | 2007-05-13 21:29:33 +0000 |
| commit | c6f33bac6aa79e01e5f450f1973aab5566d01d6a (patch) | |
| tree | 14b079c81cd11ef9c66a9a12dbe065827f6811f1 | |
| parent | 3683c27d6afbb2ea1d950dd3f8ef7d6f8096bbcd (diff) | |
| download | emacs-c6f33bac6aa79e01e5f450f1973aab5566d01d6a.tar.gz emacs-c6f33bac6aa79e01e5f450f1973aab5566d01d6a.zip | |
Use default color when color is unspecified.
| -rw-r--r-- | lisp/ChangeLog | 9 | ||||
| -rw-r--r-- | lisp/ps-print.el | 44 |
2 files changed, 35 insertions, 18 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3eb974292d9..32a307cb809 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,12 @@ | |||
| 1 | 2007-05-13 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 | |||
| 1 | 2007-05-12 Chong Yidong <cyd@stupidchicken.com> | 10 | 2007-05-12 Chong Yidong <cyd@stupidchicken.com> |
| 2 | 11 | ||
| 3 | * longlines.el (longlines-mode): Make longlines-auto-wrap | 12 | * longlines.el (longlines-mode): Make longlines-auto-wrap |
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 | ||
| 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 |
| @@ -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 |