diff lisp/htmlfontify.el @ 108669:c1945e85d4b9

* progmodes/verilog-mode.el (verilog-type-font-keywords): Use font-lock-constant-face, not obsolete font-lock-reference-face. * htmlfontify.el (hfy-face-resolve-face): New function. (hfy-face-to-style): Use it (Bug#6279).
author Chong Yidong <cyd@stupidchicken.com>
date Thu, 27 May 2010 11:25:58 -0400
parents ab970852cf46
children 3c15269db196
line wrap: on
line diff
--- a/lisp/htmlfontify.el	Tue May 25 13:53:37 2010 -0400
+++ b/lisp/htmlfontify.el	Thu May 27 11:25:58 2010 -0400
@@ -1059,14 +1059,25 @@
     (setq  n (apply '* m))
     (nconc r (hfy-size (if x (round n) (* n 1.0)))) ))
 
+(defun hfy-face-resolve-face (fn)
+  (cond
+   ((facep fn)
+    (hfy-face-attr-for-class fn hfy-display-class))
+   ((and (symbolp fn)
+	 (facep (symbol-value fn)))
+    ;; Obsolete faces like `font-lock-reference-face' are defined as
+    ;; aliases for another face.
+    (hfy-face-attr-for-class (symbol-value fn) hfy-display-class))
+   (t nil)))
+
+
 (defun hfy-face-to-style (fn)
   "Take FN, a font or `defface' style font specification,
 \(as returned by `face-attr-construct' or `hfy-face-attr-for-class')
 and return a `hfy-style-assoc'.\n
 See also `hfy-face-to-style-i', `hfy-flatten-style'."
   ;;(message "hfy-face-to-style");;DBUG
-  (let ((face-def (if (facep fn)
-                      (hfy-face-attr-for-class fn hfy-display-class) fn))
+  (let ((face-def (hfy-face-resolve-face fn))
         (final-style nil))
 
     (setq final-style (hfy-flatten-style (hfy-face-to-style-i face-def)))