Skip to content

Instantly share code, notes, and snippets.

@fredRos fredRos/.emacs
Last active Apr 25, 2017

Embed
What would you like to do?
Syntax highlighting of doxygen-style markdown in emacs
;; After a part is matched, it is no longer modified
;; => put catch-all patterns last
;; https://www.emacswiki.org/emacs/AddKeywords
;; https://www.emacswiki.org/emacs/RegularExpression
;; https://www.gnu.org/software/emacs/manual/html_node/elisp/Faces-for-Font-Lock.html#Faces-for-Font-Lock
(font-lock-add-keywords 'markdown-mode
;; mark each of three groups differently
;; @section label title
'(("^\\(@section\\) \\(.+?\\) \\(.+?\\)$"
(1 font-lock-constant-face)
(2 font-lock-comment-face)
(3 font-lock-builtin-face))
;; @ref label
("\\(@ref\\)[[:space:]]+?\\(\\_<.+?\\_>\\)"
(1 font-lock-constant-face)
(2 font-lock-comment-face))
;; `@' not treated as part of symbol but look for next symbol end after `@'
("@.+?\\_>" . font-lock-constant-face)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.