summaryrefslogtreecommitdiff
path: root/lisp/htmlfontify.el
diff options
context:
space:
mode:
authorChong Yidong <cyd@stupidchicken.com>2010-05-27 11:28:58 -0400
committerChong Yidong <cyd@stupidchicken.com>2010-05-27 11:28:58 -0400
commitecb0ab90c41745fa95741291288ea22c7bc7561b (patch)
treeb83e7fec1332c63ed62641050943d011b7981d58 /lisp/htmlfontify.el
parent478ebb73bb3b80bf2a0a55081f9753639d98fd4a (diff)
downloademacs-ecb0ab90c41745fa95741291288ea22c7bc7561b.tar.gz
Let htmlfontify recognize face aliases (Bug#6279).
* 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).
Diffstat (limited to 'lisp/htmlfontify.el')
-rw-r--r--lisp/htmlfontify.el15
1 files changed, 13 insertions, 2 deletions
diff --git a/lisp/htmlfontify.el b/lisp/htmlfontify.el
index d4dd49ac17d..12e54972461 100644
--- a/lisp/htmlfontify.el
+++ b/lisp/htmlfontify.el
@@ -1026,14 +1026,25 @@ haven't encountered them yet. Returns a `hfy-style-assoc'."
(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)))