summaryrefslogtreecommitdiff
path: root/bog.el
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2016-05-23 01:39:09 -0400
committerKyle Meyer <kyle@kyleam.com>2016-05-23 01:39:09 -0400
commit00d7142a0828910dd56c8a778cf656b92a532c0a (patch)
treee0b39c4c848ea26924a3c98c4ba1f9d77a1188c0 /bog.el
parent0e685a392de3bece7ae9660599b8ce9dfd7f83e0 (diff)
downloadbog-00d7142a0828910dd56c8a778cf656b92a532c0a.tar.gz
Use bog-fontify-non-heading-citekeys in non-Org buffers
Diffstat (limited to 'bog.el')
-rw-r--r--bog.el17
1 files changed, 9 insertions, 8 deletions
diff --git a/bog.el b/bog.el
index 089dff0..93870c0 100644
--- a/bog.el
+++ b/bog.el
@@ -1324,16 +1324,17 @@ Topic headings are determined by `bog-topic-heading-level'."
(defun bog-fontify-non-heading-citekeys (limit)
"Highlight non-heading citekeys."
- (with-syntax-table bog-citekey-syntax-table
- (let ((case-fold-search nil))
- (while (re-search-forward bog-citekey-format limit t)
- (unless (save-match-data (org-at-heading-p))
- (add-text-properties (match-beginning 0) (match-end 0)
- '(face bog-citekey-face)))))))
+ (let ((org-buffer-p (derived-mode-p 'org-mode)))
+ (with-syntax-table bog-citekey-syntax-table
+ (let ((case-fold-search nil))
+ (while (re-search-forward bog-citekey-format limit t)
+ (unless (and org-buffer-p
+ (save-match-data (org-at-heading-p)))
+ (add-text-properties (match-beginning 0) (match-end 0)
+ '(face bog-citekey-face))))))))
(defvar bog-citekey-font-lock-keywords
- `((,bog-citekey-format . 'bog-citekey-face))
- "Citekey font-lock for non-Org buffers.")
+ '((bog-fontify-non-heading-citekeys . bog-citekey-face)))
(defvar bog-font-lock-function
(if (fboundp 'font-lock-flush)