]> git.donarmstrong.com Git - org-ref.git/commitdiff
make hi-lock-mode buffer local when colorizing links.
authorJohn Kitchin <jkitchin@andrew.cmu.edu>
Thu, 26 Feb 2015 13:38:21 +0000 (08:38 -0500)
committerJohn Kitchin <jkitchin@andrew.cmu.edu>
Thu, 26 Feb 2015 13:38:21 +0000 (08:38 -0500)
org-ref.org

index f0d94ec9c438e464a973331b2c3949f61b291e0a..f01473b388c5fa6f1f25db89eb1b6d638ab5f4c2 100644 (file)
@@ -452,11 +452,15 @@ label:test
   `((t (:inherit org-link :foreground ,org-ref-ref-color)))
   "Face for ref links in org-ref.")
 
-(global-hi-lock-mode 1)
-(when org-ref-colorize-links
+(defun org-ref-colorize-links ()
+  "Colorize org-ref links."
+  (hi-lock-mode 1)
   (highlight-regexp org-ref-cite-re 'org-ref-cite-face)
   (highlight-regexp org-ref-label-re 'org-ref-label-face)
   (highlight-regexp org-ref-ref-re 'org-ref-ref-face))
+
+(when org-ref-colorize-links
+  (add-hook 'org-mode-hook 'org-ref-colorize-links))
 #+END_SRC
 
 #+RESULTS: