From cce48501c0c1475dc5bd66f517cde508823480d3 Mon Sep 17 00:00:00 2001 From: bth Date: Sun, 4 Jan 2026 11:56:49 -0800 Subject: [PATCH] font-lock-um-*-face added to markdown-mode defaulting to :inherit shadow --- elisp/um.el | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/elisp/um.el b/elisp/um.el index 9fb2447..7e37146 100644 --- a/elisp/um.el +++ b/elisp/um.el @@ -47,6 +47,48 @@ :type '(string) ) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; faces + +(defconst um-date-re "^: \\([[:digit:]]+\\.[[:digit:]]+\\.[[:digit:]]+$\\)" "um date regexp") + +;; NOTE: regexp-opt wraps the whole expression in (), so I can't omit the -. +(defcustom um-locale-re (regexp-opt '( + "- Brooklyn" + "- Fool's Bluff" + )) "um locale regexp") + +(defconst um-tag-re "^\\+ \\([[:alpha:]\\_\\-]+$\\)" "um tag regexp") + +(defface font-lock-um-date-face + `((((type tty) (class mono))) + (t ( + :inherit shadow + ))) + "um date face") + +(defface font-lock-um-locale-face + `((((type tty) (class mono))) + (t ( + :inherit shadow + ))) + "um locale face") + +(defface font-lock-um-tag-face + `((((type tty) (class mono))) + (t ( + :inherit shadow + ))) + "um tag face") + +;; TODO: should this be a user setup hook? +(font-lock-add-keywords 'markdown-mode + `( + (,um-date-re 1 'font-lock-um-date-face) + (,um-locale-re 0 'font-lock-um-locale-face) + (,um-tag-re 1 'font-lock-um-tag-face) + )) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; journal header