summaryrefslogtreecommitdiff
path: root/bog.el
diff options
context:
space:
mode:
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)