]> git.eshelyaron.com Git - emacs.git/commitdiff
Let htmlfontify recognize face aliases (Bug#6279).
authorChong Yidong <cyd@stupidchicken.com>
Thu, 27 May 2010 15:28:58 +0000 (11:28 -0400)
committerChong Yidong <cyd@stupidchicken.com>
Thu, 27 May 2010 15:28:58 +0000 (11:28 -0400)
* 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).

lisp/ChangeLog
lisp/htmlfontify.el
lisp/progmodes/verilog-mode.el

index 10cd04ec60d10cc1af2b01b34b07f50d763de2b8..a18eea12ee3dbee154de01fc3694a44253b5507c 100644 (file)
@@ -1,3 +1,13 @@
+2010-05-27  Chong Yidong  <cyd@stupidchicken.com>
+
+       * progmodes/verilog-mode.el (verilog-type-font-keywords): Use
+       font-lock-constant-face, not obsolete font-lock-reference-face.
+
+2010-05-27  Masatake YAMATO  <yamato@redhat.com>
+
+       * htmlfontify.el (hfy-face-resolve-face): New function.
+       (hfy-face-to-style): Use it (Bug#6279).
+
 2010-05-27  Kenichi Handa  <handa@m17n.org>
 
        * language/hebrew.el (hebrew-shape-gstring): Check if a glyph
index d4dd49ac17dc1332ead390fd23c76eaf6d034881..12e5497246163fe483b6bd7d8951bbdb0bc6ee42 100644 (file)
@@ -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)))
index bf9d4b8da47fcfb69a77d0ccf86157eb672aef1e..5e7699b35435145f6336d7841b3a15281b559a1d 100644 (file)
@@ -2446,12 +2446,12 @@ See also `verilog-font-lock-extra-types'.")
                 (list
                  (concat "\\<function\\>\\s-+\\(integer\\|real\\(time\\)?\\|time\\)\\s-+\\(\\sw+\\)" )
                       '(1 font-lock-keyword-face)
-                      '(3 font-lock-reference-face prepend))
+                      '(3 font-lock-constant-face prepend))
                 '("\\<function\\>\\s-+\\(\\[[^]]+\\]\\)\\s-+\\(\\sw+\\)"
                   (1 font-lock-keyword-face)
-                  (2 font-lock-reference-face append))
+                  (2 font-lock-constant-face append))
                 '("\\<function\\>\\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