diff options
| author | Chong Yidong | 2010-05-27 11:28:58 -0400 |
|---|---|---|
| committer | Chong Yidong | 2010-05-27 11:28:58 -0400 |
| commit | ecb0ab90c41745fa95741291288ea22c7bc7561b (patch) | |
| tree | b83e7fec1332c63ed62641050943d011b7981d58 | |
| parent | 478ebb73bb3b80bf2a0a55081f9753639d98fd4a (diff) | |
| download | emacs-ecb0ab90c41745fa95741291288ea22c7bc7561b.tar.gz emacs-ecb0ab90c41745fa95741291288ea22c7bc7561b.zip | |
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).
| -rw-r--r-- | lisp/ChangeLog | 10 | ||||
| -rw-r--r-- | lisp/htmlfontify.el | 15 | ||||
| -rw-r--r-- | lisp/progmodes/verilog-mode.el | 6 |
3 files changed, 26 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 10cd04ec60d..a18eea12ee3 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,13 @@ | |||
| 1 | 2010-05-27 Chong Yidong <cyd@stupidchicken.com> | ||
| 2 | |||
| 3 | * progmodes/verilog-mode.el (verilog-type-font-keywords): Use | ||
| 4 | font-lock-constant-face, not obsolete font-lock-reference-face. | ||
| 5 | |||
| 6 | 2010-05-27 Masatake YAMATO <yamato@redhat.com> | ||
| 7 | |||
| 8 | * htmlfontify.el (hfy-face-resolve-face): New function. | ||
| 9 | (hfy-face-to-style): Use it (Bug#6279). | ||
| 10 | |||
| 1 | 2010-05-27 Kenichi Handa <handa@m17n.org> | 11 | 2010-05-27 Kenichi Handa <handa@m17n.org> |
| 2 | 12 | ||
| 3 | * language/hebrew.el (hebrew-shape-gstring): Check if a glyph | 13 | * language/hebrew.el (hebrew-shape-gstring): Check if a glyph |
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'." | |||
| 1026 | (setq n (apply '* m)) | 1026 | (setq n (apply '* m)) |
| 1027 | (nconc r (hfy-size (if x (round n) (* n 1.0)))) )) | 1027 | (nconc r (hfy-size (if x (round n) (* n 1.0)))) )) |
| 1028 | 1028 | ||
| 1029 | (defun hfy-face-resolve-face (fn) | ||
| 1030 | (cond | ||
| 1031 | ((facep fn) | ||
| 1032 | (hfy-face-attr-for-class fn hfy-display-class)) | ||
| 1033 | ((and (symbolp fn) | ||
| 1034 | (facep (symbol-value fn))) | ||
| 1035 | ;; Obsolete faces like `font-lock-reference-face' are defined as | ||
| 1036 | ;; aliases for another face. | ||
| 1037 | (hfy-face-attr-for-class (symbol-value fn) hfy-display-class)) | ||
| 1038 | (t nil))) | ||
| 1039 | |||
| 1040 | |||
| 1029 | (defun hfy-face-to-style (fn) | 1041 | (defun hfy-face-to-style (fn) |
| 1030 | "Take FN, a font or `defface' style font specification, | 1042 | "Take FN, a font or `defface' style font specification, |
| 1031 | \(as returned by `face-attr-construct' or `hfy-face-attr-for-class') | 1043 | \(as returned by `face-attr-construct' or `hfy-face-attr-for-class') |
| 1032 | and return a `hfy-style-assoc'.\n | 1044 | and return a `hfy-style-assoc'.\n |
| 1033 | See also `hfy-face-to-style-i', `hfy-flatten-style'." | 1045 | See also `hfy-face-to-style-i', `hfy-flatten-style'." |
| 1034 | ;;(message "hfy-face-to-style");;DBUG | 1046 | ;;(message "hfy-face-to-style");;DBUG |
| 1035 | (let ((face-def (if (facep fn) | 1047 | (let ((face-def (hfy-face-resolve-face fn)) |
| 1036 | (hfy-face-attr-for-class fn hfy-display-class) fn)) | ||
| 1037 | (final-style nil)) | 1048 | (final-style nil)) |
| 1038 | 1049 | ||
| 1039 | (setq final-style (hfy-flatten-style (hfy-face-to-style-i face-def))) | 1050 | (setq final-style (hfy-flatten-style (hfy-face-to-style-i face-def))) |
diff --git a/lisp/progmodes/verilog-mode.el b/lisp/progmodes/verilog-mode.el index bf9d4b8da47..5e7699b3543 100644 --- a/lisp/progmodes/verilog-mode.el +++ b/lisp/progmodes/verilog-mode.el | |||
| @@ -2446,12 +2446,12 @@ See also `verilog-font-lock-extra-types'.") | |||
| 2446 | (list | 2446 | (list |
| 2447 | (concat "\\<function\\>\\s-+\\(integer\\|real\\(time\\)?\\|time\\)\\s-+\\(\\sw+\\)" ) | 2447 | (concat "\\<function\\>\\s-+\\(integer\\|real\\(time\\)?\\|time\\)\\s-+\\(\\sw+\\)" ) |
| 2448 | '(1 font-lock-keyword-face) | 2448 | '(1 font-lock-keyword-face) |
| 2449 | '(3 font-lock-reference-face prepend)) | 2449 | '(3 font-lock-constant-face prepend)) |
| 2450 | '("\\<function\\>\\s-+\\(\\[[^]]+\\]\\)\\s-+\\(\\sw+\\)" | 2450 | '("\\<function\\>\\s-+\\(\\[[^]]+\\]\\)\\s-+\\(\\sw+\\)" |
| 2451 | (1 font-lock-keyword-face) | 2451 | (1 font-lock-keyword-face) |
| 2452 | (2 font-lock-reference-face append)) | 2452 | (2 font-lock-constant-face append)) |
| 2453 | '("\\<function\\>\\s-+\\(\\sw+\\)" | 2453 | '("\\<function\\>\\s-+\\(\\sw+\\)" |
| 2454 | 1 'font-lock-reference-face append)))) | 2454 | 1 'font-lock-constant-face append)))) |
| 2455 | 2455 | ||
| 2456 | (setq verilog-font-lock-keywords-2 | 2456 | (setq verilog-font-lock-keywords-2 |
| 2457 | (append verilog-font-lock-keywords-1 | 2457 | (append verilog-font-lock-keywords-1 |