From fd8091590517160c946c178aa15d493446781abe Mon Sep 17 00:00:00 2001 From: Vinicius Jose Latorre Date: Sun, 25 Jan 2009 01:20:28 +0000 Subject: [PATCH] Fix face background/foreground extraction. --- lisp/ChangeLog | 10 ++++++++++ lisp/ps-print.el | 21 ++++++++++++++------- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 84ee20c0ccd..9a60d9b9a28 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -4,6 +4,16 @@ change its title from "Recursive grep..." to "Grep via Find...". Add menu items for lgrep and rgrep. +2009-01-24 Vinicius Jose Latorre + + * ps-print.el (ps-print-version): New version 7.3.4. + +2009-01-24 Eduard Wiebe (tiny change) + + * ps-print.el: Fix face background/foreground extraction. + (ps-face-extract-color): New fun. + (ps-face-attributes, ps-face-attribute-list): Code fix. + 2009-01-24 Geoff Gole (tiny change) * align.el (align-region): Avoid infloop. diff --git a/lisp/ps-print.el b/lisp/ps-print.el index b49d17ba070..89bcb6e0afb 100644 --- a/lisp/ps-print.el +++ b/lisp/ps-print.el @@ -11,11 +11,11 @@ ;; Maintainer: Kenichi Handa (multi-byte characters) ;; Vinicius Jose Latorre ;; Keywords: wp, print, PostScript -;; Version: 7.3.3 +;; Version: 7.3.4 ;; X-URL: http://www.emacswiki.org/cgi-bin/wiki/ViniciusJoseLatorre -(defconst ps-print-version "7.3.3" - "ps-print.el, v 7.3.3 <2008/10/22 vinicius> +(defconst ps-print-version "7.3.4" + "ps-print.el, v 7.3.4 <2009/01/24 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 @@ -6235,6 +6235,13 @@ to the equivalent Latin-1 characters.") (memq attr '(foreground-color :foreground background-color :background))) +(defun ps-face-extract-color (face-attrs) + (let ((color (cdr face-attrs))) + (if (listp color) + (car color) + color))) + + (defun ps-face-attributes (face) "Return face attribute vector. @@ -6259,9 +6266,9 @@ If FACE is not a valid face name, use default face." (cons new-face ps-print-face-alist))) new-face)))) ((ps-face-foreground-color-p (car face)) - (vector 0 (cdr face) nil)) + (vector 0 (ps-face-extract-color face) nil)) ((ps-face-background-color-p (car face)) - (vector 0 nil (cdr face))) + (vector 0 nil (ps-face-extract-color face))) (t (vector 0 nil nil)))) @@ -6295,10 +6302,10 @@ If FACE is not a valid face name, use default face." (ps-face-attributes face-or-list)) ;; only foreground color, not a `real' face ((ps-face-foreground-color-p (car face-or-list)) - (vector 0 (cdr face-or-list) nil)) + (vector 0 (ps-face-extract-color face-or-list) nil)) ;; only background color, not a `real' face ((ps-face-background-color-p (car face-or-list)) - (vector 0 nil (cdr face-or-list))) + (vector 0 nil (ps-face-extract-color face-or-list))) ;; list of faces (t (let ((effects 0) -- 2.39.2