From 5167749c66455ef691d2011ce32a863a28e9f481 Mon Sep 17 00:00:00 2001 From: Vinicius Jose Latorre Date: Wed, 7 Feb 2007 13:40:10 +0000 Subject: [PATCH] Fix background color printing --- lisp/ChangeLog | 10 +++++++++ lisp/ps-print.el | 54 +++++++++++++++++++++++++++--------------------- 2 files changed, 40 insertions(+), 24 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d1a7f56b2e1..1488d6ef4bc 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,13 @@ +2007-02-07 Vinicius Jose Latorre + + * ps-print.ps: The ps-print commands without face printing should not + print background color. Reported by Leo . + (ps-print-version): New version 6.7.3. + (ps-begin-job): New arg. Fix ps-default-background and + ps-default-foreground initialization. + (ps-face-attributes): Fix doc string. + (ps-face-background, ps-generate-postscript, ps-generate): Fix code. + 2007-02-06 Chong Yidong * faces.el (face-set-after-frame-default): Compile attributes to diff --git a/lisp/ps-print.el b/lisp/ps-print.el index 514c55e7dd6..7a9263b0ea8 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: 6.7.2 +;; Version: 6.7.3 ;; X-URL: http://www.emacswiki.org/cgi-bin/wiki/ViniciusJoseLatorre -(defconst ps-print-version "6.7.2" - "ps-print.el, v 6.7.2 <2007/01/26 vinicius> +(defconst ps-print-version "6.7.3" + "ps-print.el, v 6.7.3 <2007/02/06 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 @@ -5838,7 +5838,7 @@ XSTART YSTART are the relative position for the first page in a sheet.") )) -(defun ps-begin-job () +(defun ps-begin-job (genfunc) ;; prologue files (or (equal ps-mark-code-directory ps-postscript-code-directory) (setq ps-print-prologue-0 (ps-prologue-file 0) @@ -5909,6 +5909,8 @@ XSTART YSTART are the relative position for the first page in a sheet.") (t "[\t\n\f]")) ps-default-background (ps-rgb-color (cond + ((eq genfunc 'ps-generate-postscript) + nil) ((eq ps-default-bg 'frame-parameter) (ps-frame-parameter 'background-color)) ((eq ps-default-bg t) @@ -5918,6 +5920,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) + nil) ((eq ps-default-fg 'frame-parameter) (ps-frame-parameter 'foreground-color)) ((eq ps-default-fg t) @@ -6321,7 +6325,7 @@ If FACE is not in `ps-print-face-extension-alist' or in `ps-print-face-alist', insert it on `ps-print-face-alist' and return the attribute vector. -If FACE is not a valid face name, it is used default face." +If FACE is not a valid face name, use default face." (cond (ps-black-white-faces-alist (or (and (symbolp face) @@ -6346,23 +6350,25 @@ If FACE is not a valid face name, it is used default face." (defun ps-face-background (face background) - (and (or (eq ps-use-face-background t) - (cond ((symbolp face) - (memq face ps-use-face-background)) - ((listp face) - (or (memq (car face) '(foreground-color background-color)) - (let (ok) - (while face - (if (or (memq (car face) ps-use-face-background) - (memq (car face) - '(foreground-color background-color))) - (setq face nil - ok t) - (setq face (cdr face)))) - ok))) - (t - nil) - )) + (and (cond ((eq ps-use-face-background t)) ; always + ((null ps-use-face-background) nil) ; never + ;; ps-user-face-background is a symbol face list + ((symbolp face) + (memq face ps-use-face-background)) + ((listp face) + (or (memq (car face) '(foreground-color background-color)) + (let (ok) + (while face + (if (or (memq (car face) ps-use-face-background) + (memq (car face) + '(foreground-color background-color))) + (setq face nil + ok t) + (setq face (cdr face)))) + ok))) + (t + nil) + ) background)) @@ -6629,7 +6635,7 @@ If FACE is not a valid face name, it is used default face." (ps-plot-with-face from to face)))) (defun ps-generate-postscript (from to) - (ps-plot-region from to 0 nil)) + (ps-plot-region from to 0)) (defun ps-generate (buffer from to genfunc) (save-excursion @@ -6665,7 +6671,7 @@ If FACE is not a valid face name, it is used default face." (save-excursion (let ((ps-print-page-p t) ps-even-or-odd-pages) - (ps-begin-job) + (ps-begin-job genfunc) (when needs-begin-file (ps-begin-file) (ps-mule-initialize)) -- 2.39.2