[mew-dist 29120] Re: Mew 6.3
Kazu Yamamoto ( 山本和彦 )
kazu at example.com
2010年 2月 15日 (月) 15:22:40 JST
> で、手元の FreeBSD/i386 7.3-PRERELEASE で試してみました。書い
> て頂いたパッチは mew-6.3 と、お昼前に git したばかりの 7.0.50 で
> 試しましたが特に変化はありませんでした。
うーん、そうですか。今度のパッチは、問題ないと思うんですけどね。
一応、:weight を 'normal だと明示的に指定してみましょうか。
前のパッチを破棄して、このパッチを試して下さい。
ところで、お使いの Emacs では、
(fboundp 'face-all-attributes)
が、t を返すんですよね?
--かず
diff --git a/mew-env.el b/mew-env.el
index c1e13fc..492f514 100644
--- a/mew-env.el
+++ b/mew-env.el
@@ -229,6 +229,33 @@ requires PTY.")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
+;;; Face
+;;;
+
+(cond
+ ((fboundp 'face-all-attributes) ;; Emacs 23
+ (defalias 'mew-face-spec-func 'cons)
+ (defun mew-face-spec-primitive (col bold)
+ (if col
+ (if bold
+ (list :foreground col :weight 'bold)
+ (list :foreground col :weight 'normal))
+ (if bold
+ (list :weight 'bold)
+ (list :weight 'normal)))))
+ (t
+ (defalias 'mew-face-spec-func 'list)
+ (defun mew-face-spec-primitive (col bold)
+ (if col
+ (if bold
+ (list :foreground col :bold t)
+ (list :foreground col))
+ (if bold
+ (list :bold t)
+ nil)))))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;
;;; Misc
;;;
diff --git a/mew-vars2.el b/mew-vars2.el
index 3f021b9..0bac838 100644
--- a/mew-vars2.el
+++ b/mew-vars2.el
@@ -609,16 +609,18 @@ present, mew-face-header-marginal is used."
(mew-defstruct header-color field key val)
(defvar mew-header-color-alist nil)
+;; See also mew-face-make-spec.
+
(defun mew-header-color-base (field key-color val-color bold)
(unless val-color (setq val-color key-color))
(let ((face-key (intern (concat "mew-face-color-" key-color (if bold "-bold"))))
(face-val (intern (concat "mew-face-color-" val-color (if bold "-bold")))))
(unless (facep face-key)
(make-empty-face face-key)
- (face-spec-set face-key `((t (:foreground ,key-color :bold ,bold)))))
+ (face-spec-set face-key (list (mew-face-spec-func t (mew-face-spec-primitive key-color bold)))))
(unless (facep face-val)
(make-empty-face face-val)
- (face-spec-set face-val `((t (:foreground ,val-color :bold ,bold)))))
+ (face-spec-set face-val (list (mew-face-spec-func t (mew-face-spec-primitive val-color bold)))))
(setq mew-header-color-alist
(cons (list (capitalize field) face-key face-val) mew-header-color-alist))))
diff --git a/mew-vars3.el b/mew-vars3.el
index 2317a5a..0052688 100644
--- a/mew-vars3.el
+++ b/mew-vars3.el
@@ -15,24 +15,27 @@
(:light (background light))
(:dark (background dark))))
+;; See also mew-header-color-base
+
(defun mew-face-make-spec (bold &rest spec)
(let (ret key col)
(if (and bold (not (member :tty spec)))
- (setq ret (copy-sequence '((((class color) (type tty)) (:bold t))))))
+ (setq ret (cons (mew-face-spec-func '((class color) (type tty))
+ (mew-face-spec-primitive nil t))
+ ret)))
(while spec
(setq key (car spec))
(setq spec (cdr spec))
(setq col (car spec))
(setq spec (cdr spec))
- (setq ret (cons (list (list '(class color)
- (mew-alist-get-value (assoc key mew-face-spec-alist)))
- (if bold
- (list :foreground col :bold t)
- (list :foreground col)))
- ret)))
- (if bold
- (setq ret (cons '(t (:bold t)) ret))
- (setq ret (cons '(t nil) ret)))
+ (setq ret (cons
+ (mew-face-spec-func
+ (list '(class color)
+ (mew-alist-get-value (assoc key mew-face-spec-alist)))
+ (mew-face-spec-primitive col bold))
+ ret)))
+ (setq ret (cons (mew-face-spec-func t (mew-face-spec-primitive nil bold))
+ ret))
(nreverse ret)))
(defmacro mew-setface (sym &rest spec)
Mew-dist メーリングリストの案内