lang/org: remove org-list-bullet face (use org-list-dt); polish custom font-lock keywords

This commit is contained in:
Henrik Lissner 2017-04-27 15:07:47 -04:00
parent 2652fe9e87
commit 9164da8b1f

View file

@ -180,25 +180,20 @@
ext-regexp "\\)\\(\\]\\]\\|>\\|'\\)?") . 2) ext-regexp "\\)\\(\\]\\]\\|>\\|'\\)?") . 2)
(,(concat "<\\(http://.+\\." ext-regexp "\\)>") . 1)))) (,(concat "<\\(http://.+\\." ext-regexp "\\)>") . 1))))
;; Fontify checkboxes and dividers ;;; Custom fontification
(defface org-list-bullet
'((t (:inherit font-lock-keyword-face)))
"Face for list bullets"
:group 'doom)
;; I like how org-mode fontifies checked TODOs and want this to extend to ;; I like how org-mode fontifies checked TODOs and want this to extend to
;; checked checkbox items, so we remove the old checkbox highlight rule... ;; checked checkbox items, so we remove the old checkbox highlight rule...
(font-lock-remove-keywords (font-lock-remove-keywords
'org-mode 'org-mode '(("^[ \t]*\\(?:[-+*]\\|[0-9]+[.)]\\)[ \t]+\\(?:\\[@\\(?:start:\\)?[0-9]+\\][ \t]*\\)?\\(\\[[- X]\\]\\)"
'(("^[ \t]*\\(?:[-+*]\\|[0-9]+[.)]\\)[ \t]+\\(?:\\[@\\(?:start:\\)?[0-9]+\\][ \t]*\\)?\\(\\[[- X]\\]\\)"
1 'org-checkbox prepend))) 1 'org-checkbox prepend)))
(font-lock-add-keywords (font-lock-add-keywords
'org-mode '(;; ...and replace it with my own 'org-mode '(;; ...and replace it with my own
("^[ \t]*\\(\\(?:[-+]\\|[0-9]+[).]\\)[ \t]+\\(?:\\[@\\(?:start:\\)?[0-9]+\\][ \t]*\\)?\\[X\\][^\n]*\n\\)" ("^[ \t]*\\(?:[-+*]\\|[0-9]+[).]\\)[ \t]+\\(\\(?:\\[@\\(?:start:\\)?[0-9]+\\][ \t]*\\)?\\[X\\][^\n]*\n\\)"
1 'org-headline-done t) 1 'org-headline-done t)
("^[ \t]*\\(?:[-+*]\\|[0-9]+[.)]\\)[ \t]+\\(?:\\[@\\(?:start:\\)?[0-9]+\\][ \t]*\\)?\\(\\[[- ]\\]\\)" ("^[ \t]*\\(?:[-+*]\\|[0-9]+[.)]\\)[ \t]+\\(?:\\[@\\(?:start:\\)?[0-9]+\\][ \t]*\\)?\\(\\[[- ]\\]\\)"
1 'org-checkbox prepend) 1 'org-checkbox append)
;; Also highlight list bullets ;; Also highlight list bullets
("^ *\\([-+]\\|[0-9]+[).]\\) " 1 'org-list-bullet append) ("^ *\\([-+]\\|[0-9]+[).]\\) " 1 'org-list-dt append)
;; and separators ;; and separators
("^ *\\(-----+\\)$" 1 'org-meta-line))) ("^ *\\(-----+\\)$" 1 'org-meta-line)))