summaryrefslogtreecommitdiff
path: root/gnosis.el
diff options
context:
space:
mode:
Diffstat (limited to 'gnosis.el')
-rw-r--r--gnosis.el16
1 files changed, 16 insertions, 0 deletions
diff --git a/gnosis.el b/gnosis.el
index bd80a83..137d00e 100644
--- a/gnosis.el
+++ b/gnosis.el
@@ -319,6 +319,22 @@ History is disabled."
(overlay-put overlay 'face 'gnosis-face-separator)
(overlay-put overlay 'display (make-string width ?\s))))))
+(defun gnosis-apply-overlays ()
+ "Apply custom font overlays for syntax highlighting."
+ (save-excursion
+ (goto-char (point-min))
+ (while (re-search-forward "\\*\\([^*]+\\)\\*" nil t)
+ (overlay-put (make-overlay (match-beginning 1) (match-end 1)) 'face 'bold))
+ (goto-char (point-min))
+ (while (re-search-forward "/\\([^/]+\\)/" nil t)
+ (overlay-put (make-overlay (match-beginning 1) (match-end 1)) 'face 'italic))
+ (goto-char (point-min))
+ (while (re-search-forward "=\\([^=]+\\)=" nil t)
+ (overlay-put (make-overlay (match-beginning 1) (match-end 1)) 'face 'font-lock-constant-face))
+ (goto-char (point-min))
+ (while (re-search-forward "~\\([^~]+\\)~" nil t)
+ (overlay-put (make-overlay (match-beginning 1) (match-end 1)) 'face 'font-lock-keyword-face))))
+
(defun gnosis-display-question (id &optional fill-paragraph-p)
"Display main row for note ID.