]> code.delx.au - gnu-emacs-elpa/blobdiff - packages/muse/htmlize-hack.el
Remove version numbers in packages/ directory
[gnu-emacs-elpa] / packages / muse / htmlize-hack.el
diff --git a/packages/muse/htmlize-hack.el b/packages/muse/htmlize-hack.el
new file mode 100644 (file)
index 0000000..4c9e5e8
--- /dev/null
@@ -0,0 +1,19 @@
+;; This file provides a fix for htmlize.el and Emacs 23.
+;; To use it, add the path to this directory to your load path and
+;; add (require 'htmlize-hack) to your Emacs init file.
+
+(require 'htmlize)
+
+(when (equal htmlize-version "1.34")
+  (defun htmlize-face-size (face)
+    ;; The size (height) of FACE, taking inheritance into account.
+    ;; Only works in Emacs 21 and later.
+    (let ((size-list
+           (loop
+            for f = face then (face-attribute f :inherit)
+            until (or (null f) (eq f 'unspecified))
+            for h = (face-attribute f :height)
+            collect (if (eq h 'unspecified) nil h))))
+      (reduce 'htmlize-merge-size (cons nil size-list)))))
+
+(provide 'htmlize-hack)