From 02aafcce348c4f137171f909c9d278cbb446b0fc Mon Sep 17 00:00:00 2001 From: morioka Date: Fri, 14 Mar 1997 05:30:33 +0000 Subject: [PATCH] (emh-set-face-foreground): New inline function. --- emh-face.el | 48 +++++++++++++++++------------------------------- 1 file changed, 17 insertions(+), 31 deletions(-) diff --git a/emh-face.el b/emh-face.el index 0eefd15..d122a20 100644 --- a/emh-face.el +++ b/emh-face.el @@ -4,7 +4,7 @@ ;; Author: MORIOKA Tomohiko ;; Created: 1997/3/4 -;; Version: $Id: emh-face.el,v 0.1 1997-03-05 13:50:05 morioka Exp $ +;; Version: $Id: emh-face.el,v 0.2 1997-03-14 05:30:33 morioka Exp $ ;; Keywords: header, highlighting ;; This file is part of emh. @@ -28,92 +28,78 @@ (require 'emu) +(defsubst emh-set-face-foreground (face color) + (condition-case err + (set-face-foreground face color) + (error (message "Color `%s' is not found." color)) + )) + (or (find-face 'from-field-body) (progn (make-face 'from-field-body) - (if (member "dark slate blue" (x-defined-colors)) - (set-face-foreground 'from-field-body "dark slate blue") - ) + (emh-set-face-foreground 'from-field-body "dark slate blue") (make-face-bold 'from-field-body nil 'no-error) )) (or (find-face 'subject-field-body) (progn (make-face 'subject-field-body) - (if (member "violet red" (x-defined-colors)) - (set-face-foreground 'subject-field-body "violet red") - ) + (emh-set-face-foreground 'subject-field-body "violet red") (make-face-bold 'subject-field-body nil 'no-error) )) (or (find-face 'to-field-body) (progn (make-face 'to-field-body) - (if (member "red" (x-defined-colors)) - (set-face-foreground 'to-field-body "red") - ) + (emh-set-face-foreground 'to-field-body "red") (make-face-bold 'to-field-body nil 'no-error) )) (or (find-face 'cc-field-body) (progn (make-face 'cc-field-body) - (if (member "salmon" (x-defined-colors)) - (set-face-foreground 'cc-field-body "salmon") - ) + (emh-set-face-foreground 'cc-field-body "salmon") (make-face-bold 'cc-field-body nil 'no-error) )) (or (find-face 'reply-to-field-body) (progn (make-face 'reply-to-field-body) - (if (member "salmon" (x-defined-colors)) - (set-face-foreground 'reply-to-field-body "salmon") - ) + (emh-set-face-foreground 'reply-to-field-body "salmon") (make-face-bold 'reply-to-field-body nil 'no-error) )) (or (find-face '-to-field-body) (progn (make-face '-to-field-body) - (if (member "red" (x-defined-colors)) - (set-face-foreground '-to-field-body "red") - ) + (emh-set-face-foreground '-to-field-body "red") )) (or (find-face 'date-field-body) (progn (make-face 'date-field-body) - (if (member "blue violet" (x-defined-colors)) - (set-face-foreground 'date-field-body "blue violet") - ) + (emh-set-face-foreground 'date-field-body "blue violet") (make-face-bold 'date-field-body nil 'no-error) )) (or (find-face 'message-id-field-body) (progn (make-face 'message-id-field-body) - (if (member "cadet blue" (x-defined-colors)) - (set-face-foreground 'message-id-field-body "royal blue") - ) + (emh-set-face-foreground 'message-id-field-body "royal blue") (make-face-bold 'message-id-field-body nil 'no-error) )) (or (find-face 'field-body) (progn (make-face 'field-body) - (and (member "dark green" (x-defined-colors)) - (set-face-foreground 'field-body "dark green") - ) + (emh-set-face-foreground 'field-body "dark green") (make-face-italic 'field-body nil 'no-error) )) (or (find-face 'field-name) (progn (make-face 'field-name) - (and (member "dark green" (x-defined-colors)) - (set-face-foreground 'field-name "dark green") - ) + (emh-set-face-foreground 'field-name "dark green") (make-face-bold 'field-name nil 'no-error) )) -- 1.7.10.4