Fix an issue with sy-htmlize-buffer.
[syinit] / 07-html-sy.el
index 99206c5..54aa9df 100644 (file)
@@ -5,7 +5,7 @@
 ;;     Author: Steve Youngs <steve@sxemacs.org>
 ;; Maintainer: Steve Youngs <steve@sxemacs.org>
 ;;    Created: <2007-12-02>
-;; Time-stamp: <Friday May 15, 2015 22:21:58 steve>
+;; Time-stamp: <Wednesday Dec 30, 2015 18:18:26 steve>
 ;;   Download: <http://bastard.steveyoungs.com/~steve/SXEmacs/inits/>
 ;;   HTMLised: <http://bastard.steveyoungs.com/~steve/SXEmacs/htmlinits/07-html-sy.html>
 ;;   Git Repo: git clone http://git.sxemacs.org/syinit
@@ -249,8 +249,33 @@ Get the latest <a href=\"/src/foo.el\">version here</a>."
 <meta name=\"owner\" content=\"steve@sxemacs.org\">
 ")
 
+(setq htmlize-hyperlink-style "
+      a {
+        color: #FF0000;
+        background-color: inherit;
+        font: inherit;
+        font-weight: bold;
+        text-decoration: underline;
+      }
+      a:hover {
+        color: #FFFFFF;
+        background-color: #FD00FD;
+        text-decoration: underline;
+      }
+")
+
+
 ;; Hooks
-(add-hook 'htmlize-before-hook 'font-lock-fontify-buffer)
+(defun sy-htmlize-before-hook ()
+  "Prepares the buffer for htmlising.
+Turns off howm-mode as it can play havoc with the font-locking, and we
+force a fontify of the buffer."
+  (progn
+    (and howm-mode
+        (turn-off-howm-mode))
+    (font-lock-fontify-buffer)))
+
+(add-hook 'htmlize-before-hook #'sy-htmlize-before-hook)
 (add-hook 'htmlize-after-hook 
          #'(lambda ()
              (sy-htmlize-after-hook)