um-minor-mode
This commit is contained in:
parent
315cbb7884
commit
00390f0cfd
2 changed files with 32 additions and 3 deletions
33
um.el
33
um.el
|
|
@ -124,8 +124,6 @@ ISO8601."
|
|||
:group 'um
|
||||
)
|
||||
|
||||
;; TODO: should this be a user setup hook?
|
||||
;; TODO: these matchers should be functions which only match against the header.
|
||||
(font-lock-add-keywords 'markdown-mode
|
||||
`(
|
||||
(,um-date-re 1 'font-lock-um-date-face)
|
||||
|
|
@ -133,6 +131,13 @@ ISO8601."
|
|||
(,um-tag-re 1 'font-lock-um-tag-face)
|
||||
))
|
||||
|
||||
(defvar um-minor-mode-keywords
|
||||
`(
|
||||
(,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
|
||||
|
||||
|
|
@ -372,4 +377,28 @@ Returns the value of next-file computed by um next
|
|||
)
|
||||
)
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; um-minor-mode
|
||||
|
||||
(defvar-keymap um-minor-mode-map
|
||||
:doc "Keymap for `um-minor-mode'."
|
||||
"M-s t" #'um-tag-grep
|
||||
;; M-r is not exactly right, but can't think of a better binding:
|
||||
"M-r t" #'um-tag-dwim
|
||||
)
|
||||
|
||||
(define-minor-mode um-minor-mode
|
||||
"Minor mode for `um' commands.
|
||||
\\{um-minor-mode-map}"
|
||||
:init-value nil
|
||||
:lighter " um"
|
||||
:keymap um-minor-mode-map
|
||||
(if um-minor-mode
|
||||
(progn
|
||||
(font-lock-add-keywords nil um-minor-mode-keywords)
|
||||
(font-lock-flush))
|
||||
(font-lock-remove-keywords nil um-minor-mode-keywords)
|
||||
(font-lock-flush))
|
||||
)
|
||||
|
||||
(provide 'um)
|
||||
|
|
|
|||
Loading…
Reference in a new issue