]> code.delx.au - gnu-emacs-elpa/blob - packages/muse/htmlize-hack.el
Merge commit '0cda39255827f283e7578cd469ae42daad9556a2' from js2-mode
[gnu-emacs-elpa] / packages / muse / htmlize-hack.el
1 ;; This file provides a fix for htmlize.el and Emacs 23.
2 ;; To use it, add the path to this directory to your load path and
3 ;; add (require 'htmlize-hack) to your Emacs init file.
4
5 (require 'cl)
6 (if t (require 'htmlize)) ; Don't load during compilation.
7
8 (when (equal htmlize-version "1.34")
9 (defun htmlize-face-size (face)
10 ;; The size (height) of FACE, taking inheritance into account.
11 ;; Only works in Emacs 21 and later.
12 (let ((size-list
13 (loop
14 for f = face then (face-attribute f :inherit)
15 until (or (null f) (eq f 'unspecified))
16 for h = (face-attribute f :height)
17 collect (if (eq h 'unspecified) nil h))))
18 (reduce 'htmlize-merge-size (cons nil size-list)))))
19
20 (provide 'htmlize-hack)