aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVinicius Jose Latorre2007-10-11 01:58:43 +0000
committerVinicius Jose Latorre2007-10-11 01:58:43 +0000
commitadbafedd6ee622053b3b8308c3d6cf6396ad5af7 (patch)
tree2bcd53f8e7c24ba4588c0ef873fd476aa4362cdb
parent49c23b705bf6f6819b290df0a88afe5091205e66 (diff)
downloademacs-adbafedd6ee622053b3b8308c3d6cf6396ad5af7.tar.gz
emacs-adbafedd6ee622053b3b8308c3d6cf6396ad5af7.zip
Fix :foreground and :background face attributes
-rw-r--r--lisp/ChangeLog10
-rw-r--r--lisp/ps-print.el31
2 files changed, 31 insertions, 10 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 6d9360a1b43..c59aa7b77d0 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -7,6 +7,16 @@
7 7
8 * loadhist.el (unload-feature): Doc fix. 8 * loadhist.el (unload-feature): Doc fix.
9 9
102007-10-10 Vinicius Jose Latorre <viniciusjl@ig.com.br>
11
12 * ps-print.el: Fix the usage of :foreground and :background face
13 attributes. Reported by Nikolaj Schumacher <n_schumacher@web.de>.
14 (ps-print-version): New version 6.7.6.
15 (ps-face-attributes, ps-face-attribute-list, ps-face-background): Fix
16 code.
17 (ps-face-foreground-color-p, ps-face-background-color-p)
18 (ps-face-color-p): New inline funs.
19
102007-10-10 Juanma Barranquero <lekktu@gmail.com> 202007-10-10 Juanma Barranquero <lekktu@gmail.com>
11 21
12 * follow.el: Change all instances of "Follow Mode" to "Follow 22 * follow.el: Change all instances of "Follow Mode" to "Follow
diff --git a/lisp/ps-print.el b/lisp/ps-print.el
index 83367a06f60..bdc21a2e7ab 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.5 13;; Version: 6.7.6
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.5" 16(defconst ps-print-version "6.7.6"
17 "ps-print.el, v 6.7.5 <2007/07/20 vinicius> 17 "ps-print.el, v 6.7.6 <2007/10/10 vinicius>
18 18
19Vinicius's last change version -- this file may have been edited as part of 19Vinicius's last change version -- this file may have been edited as part of
20Emacs without changes to the version number. When reporting bugs, please also 20Emacs without changes to the version number. When reporting bugs, please also
@@ -6341,6 +6341,18 @@ to the equivalent Latin-1 characters.")
6341 (ps-output " S\n"))) 6341 (ps-output " S\n")))
6342 6342
6343 6343
6344(defsubst ps-face-foreground-color-p (attr)
6345 (memq attr '(foreground-color :foreground)))
6346
6347
6348(defsubst ps-face-background-color-p (attr)
6349 (memq attr '(background-color :background)))
6350
6351
6352(defsubst ps-face-color-p (attr)
6353 (memq attr '(foreground-color :foreground background-color :background)))
6354
6355
6344(defun ps-face-attributes (face) 6356(defun ps-face-attributes (face)
6345 "Return face attribute vector. 6357 "Return face attribute vector.
6346 6358
@@ -6364,9 +6376,9 @@ If FACE is not a valid face name, use default face."
6364 (setq ps-print-face-alist 6376 (setq ps-print-face-alist
6365 (cons new-face ps-print-face-alist))) 6377 (cons new-face ps-print-face-alist)))
6366 new-face)))) 6378 new-face))))
6367 ((eq (car face) 'foreground-color) 6379 ((ps-face-foreground-color-p (car face))
6368 (vector 0 (cdr face) nil)) 6380 (vector 0 (cdr face) nil))
6369 ((eq (car face) 'background-color) 6381 ((ps-face-background-color-p (car face))
6370 (vector 0 nil (cdr face))) 6382 (vector 0 nil (cdr face)))
6371 (t 6383 (t
6372 (vector 0 nil nil)))) 6384 (vector 0 nil nil))))
@@ -6379,12 +6391,11 @@ If FACE is not a valid face name, use default face."
6379 ((symbolp face) 6391 ((symbolp face)
6380 (memq face ps-use-face-background)) 6392 (memq face ps-use-face-background))
6381 ((listp face) 6393 ((listp face)
6382 (or (memq (car face) '(foreground-color background-color)) 6394 (or (ps-face-color-p (car face))
6383 (let (ok) 6395 (let (ok)
6384 (while face 6396 (while face
6385 (if (or (memq (car face) ps-use-face-background) 6397 (if (or (memq (car face) ps-use-face-background)
6386 (memq (car face) 6398 (ps-face-color-p (car face)))
6387 '(foreground-color background-color)))
6388 (setq face nil 6399 (setq face nil
6389 ok t) 6400 ok t)
6390 (setq face (cdr face)))) 6401 (setq face (cdr face))))
@@ -6401,10 +6412,10 @@ If FACE is not a valid face name, use default face."
6401 ((not (listp face-or-list)) 6412 ((not (listp face-or-list))
6402 (ps-face-attributes face-or-list)) 6413 (ps-face-attributes face-or-list))
6403 ;; only foreground color, not a `real' face 6414 ;; only foreground color, not a `real' face
6404 ((eq (car face-or-list) 'foreground-color) 6415 ((ps-face-foreground-color-p (car face-or-list))
6405 (vector 0 (cdr face-or-list) nil)) 6416 (vector 0 (cdr face-or-list) nil))
6406 ;; only background color, not a `real' face 6417 ;; only background color, not a `real' face
6407 ((eq (car face-or-list) 'background-color) 6418 ((ps-face-background-color-p (car face-or-list))
6408 (vector 0 nil (cdr face-or-list))) 6419 (vector 0 nil (cdr face-or-list)))
6409 ;; list of faces 6420 ;; list of faces
6410 (t 6421 (t