From: Vinicius Jose Latorre Date: Fri, 20 Jul 2007 17:23:27 +0000 (+0000) Subject: Fix foreground/background color X-Git-Tag: emacs-pretest-23.0.90~8295^2~374 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f102435593f8ac06c795c6997df825412b481c70;p=emacs.git Fix foreground/background color --- diff --git a/lisp/ChangeLog.unicode b/lisp/ChangeLog.unicode index 1c973a9a614..7b245382c5e 100644 --- a/lisp/ChangeLog.unicode +++ b/lisp/ChangeLog.unicode @@ -1,3 +1,15 @@ +2007-07-20 Vinicius Jose Latorre + + * ps-print.el: Problem with foreground and background color when + printing a buffer with and without faces. Reported by Christian + Schlauer . + (ps-print-version): New version 7.2.4. + (ps-default-fg): Change default value to nil, so black color is used + when a face does not specify a foreground color. + (ps-default-bg): Change default value to nil, so white color is used + for background color. + (ps-begin-job): Fix code. + 2007-06-26 Kenichi Handa * dnd.el (dnd-get-local-file-name): Call replace-regexp-in-string diff --git a/lisp/ps-print.el b/lisp/ps-print.el index 0e7d044a0a6..eae05d2fc4a 100644 --- a/lisp/ps-print.el +++ b/lisp/ps-print.el @@ -10,11 +10,11 @@ ;; Maintainer: Kenichi Handa (multi-byte characters) ;; Vinicius Jose Latorre ;; Keywords: wp, print, PostScript -;; Version: 7.2.3 +;; Version: 7.2.4 ;; X-URL: http://www.emacswiki.org/cgi-bin/wiki/ViniciusJoseLatorre -(defconst ps-print-version "7.2.3" - "ps-print.el, v 7.2.3 <2007/05/13 vinicius> +(defconst ps-print-version "7.2.4" + "ps-print.el, v 7.2.4 <2007/07/20 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 @@ -2923,7 +2923,7 @@ Any other value is treated as t." :version "20" :group 'ps-print-color) -(defcustom ps-default-fg 'frame-parameter +(defcustom ps-default-fg nil "*RGB values of the default foreground color. The `ps-default-fg' variable contains the default foreground color used by @@ -2966,7 +2966,7 @@ It's used only when `ps-print-color-p' is non-nil." :version "20" :group 'ps-print-color) -(defcustom ps-default-bg 'frame-parameter +(defcustom ps-default-bg nil "*RGB values of the default background color. The `ps-default-bg' variable contains the default background color used by @@ -5696,9 +5696,17 @@ XSTART YSTART are the relative position for the first page in a sheet.") ((eq ps-print-control-characters 'control) "[\000-\037\177]") (t "[\t\n\f]")) + ;; Set the color scale. We do it here instead of in the defvar so + ;; that ps-print can be dumped into emacs. This expression can't be + ;; evaluated at dump-time because X isn't initialized. + ps-color-p (and ps-print-color-p (ps-color-device)) + ps-print-color-scale (if ps-color-p + (float (car (ps-color-values "white"))) + 1.0) ps-default-background (ps-rgb-color (cond - ((eq genfunc 'ps-generate-postscript) + ((or (not (eq ps-print-color-p t)) + (eq genfunc 'ps-generate-postscript)) nil) ((eq ps-default-bg 'frame-parameter) (ps-frame-parameter nil 'background-color)) @@ -5710,7 +5718,8 @@ XSTART YSTART are the relative position for the first page in a sheet.") 1.0) ps-default-foreground (ps-rgb-color (cond - ((eq genfunc 'ps-generate-postscript) + ((or (not (eq ps-print-color-p t)) + (eq genfunc 'ps-generate-postscript)) nil) ((eq ps-default-fg 'frame-parameter) (ps-frame-parameter nil 'foreground-color)) @@ -5720,15 +5729,9 @@ XSTART YSTART are the relative position for the first page in a sheet.") 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 - ;; Set the color scale. We do it here instead of in the defvar so - ;; that ps-print can be dumped into emacs. This expression can't be - ;; evaluated at dump-time because X isn't initialized. - ps-color-p (and ps-print-color-p (ps-color-device)) - ps-print-color-scale (if ps-color-p - (float (car (ps-color-values "white"))) - 1.0) + ps-default-color (and (eq ps-print-color-p t) + ps-default-foreground) + ps-current-color ps-default-color ;; Set up default functions. They may be overridden by ;; ps-mule-begin-job. ps-basic-plot-string-function 'ps-basic-plot-string