Skip to content

Instantly share code, notes, and snippets.

@fluffysquirrels
Last active September 14, 2018 09:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fluffysquirrels/1aaec7cab234893bfd46cdad721dda85 to your computer and use it in GitHub Desktop.
Save fluffysquirrels/1aaec7cab234893bfd46cdad721dda85 to your computer and use it in GitHub Desktop.
Emacs org mode highlight list item bullets WIP

List styles

Should match:

  • x
  • x
    • x
  1. x
  2. x
  3. x
  4. x

Shouldn’t match:

-x

; ## Highlight list items
; See ./org-mode-highlight-list-items-test-cases.org
(progn
(font-lock-add-keywords 'org-mode
'(("^ *\\([-+]\\|[0-9]+[.)]\\) " . 'org-bullet-face)))
(defgroup org-faces nil
"Faces used in Org Mode"
:group 'org
:group 'faces)
(defface org-bullet-face
'((t (:foreground "coral" :weight bold)))
"Face for org list bullets (e.g. '-', '+', '1.', '1)')"
:group 'org-faces)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment