# HG changeset patch # User Chong Yidong # Date 1274974138 14400 # Node ID 9b941507a02cd144c6df86d3310d91dc46a6a504 # Parent 5a61e28431af03531b56c7465887a8e08fd6e5f7 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). diff -r 5a61e28431af -r 9b941507a02c lisp/ChangeLog --- a/lisp/ChangeLog Thu May 27 16:09:18 2010 +0900 +++ b/lisp/ChangeLog Thu May 27 11:28:58 2010 -0400 @@ -1,3 +1,13 @@ +2010-05-27 Chong Yidong + + * progmodes/verilog-mode.el (verilog-type-font-keywords): Use + font-lock-constant-face, not obsolete font-lock-reference-face. + +2010-05-27 Masatake YAMATO + + * htmlfontify.el (hfy-face-resolve-face): New function. + (hfy-face-to-style): Use it (Bug#6279). + 2010-05-27 Kenichi Handa * language/hebrew.el (hebrew-shape-gstring): Check if a glyph diff -r 5a61e28431af -r 9b941507a02c lisp/htmlfontify.el --- a/lisp/htmlfontify.el Thu May 27 16:09:18 2010 +0900 +++ b/lisp/htmlfontify.el Thu May 27 11:28:58 2010 -0400 @@ -1026,14 +1026,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))) diff -r 5a61e28431af -r 9b941507a02c lisp/progmodes/verilog-mode.el --- a/lisp/progmodes/verilog-mode.el Thu May 27 16:09:18 2010 +0900 +++ b/lisp/progmodes/verilog-mode.el Thu May 27 11:28:58 2010 -0400 @@ -2446,12 +2446,12 @@ (list (concat "\\\\s-+\\(integer\\|real\\(time\\)?\\|time\\)\\s-+\\(\\sw+\\)" ) '(1 font-lock-keyword-face) - '(3 font-lock-reference-face prepend)) + '(3 font-lock-constant-face prepend)) '("\\\\s-+\\(\\[[^]]+\\]\\)\\s-+\\(\\sw+\\)" (1 font-lock-keyword-face) - (2 font-lock-reference-face append)) + (2 font-lock-constant-face append)) '("\\\\s-+\\(\\sw+\\)" - 1 'font-lock-reference-face append)))) + 1 'font-lock-constant-face append)))) (setq verilog-font-lock-keywords-2 (append verilog-font-lock-keywords-1