From: John Kitchin Date: Thu, 26 Feb 2015 13:38:21 +0000 (-0500) Subject: make hi-lock-mode buffer local when colorizing links. X-Git-Url: https://git.donarmstrong.com/?p=org-ref.git;a=commitdiff_plain;h=3dfba2deeaf9c0690527f9a351798af6bdb140ba;hp=b7bc5b7517bda34dd57e86500ac88ba2f01d515e make hi-lock-mode buffer local when colorizing links. --- diff --git a/org-ref.org b/org-ref.org index f0d94ec..f01473b 100644 --- a/org-ref.org +++ b/org-ref.org @@ -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: