Highlight checkboxes in Org mode

Checked and unchecked checkboxes will have the same color as the DONE and TODO keywords, respectively.
This commit is contained in:
Gergely Polonkai 2018-10-19 09:25:16 +02:00
parent 08e7ad233f
commit 60d61f1f4c

View File

@ -2377,6 +2377,20 @@ This is a big one; I use a lot of customisation here.
:demand :demand
:init :init
(require 'xdg-paths) (require 'xdg-paths)
(defface org-checkbox-todo-text
'((t (:inherit org-todo)))
"Face for the text part of an unchecked org-mode checkbox.")
(defface org-checkbox-done-text
'((t (:inherit org-done)))
"Face for the text part of a checked org-mode checkbox.")
(font-lock-add-keywords
'org-mode
`(("^[ \t]*\\(?:[-+*]\\|[0-9]+[).]\\)[ \t]+\\(\\(?:\\[@\\(?:start:\\)?[0-9]+\\][ \t]*\\)?\\[\\(?: \\|\\([0-9]+\\)/\\2\\)\\][^\n]*\n\\)" 1 'org-checkbox-todo-text prepend))
'append)
(font-lock-add-keywords
'org-mode
`(("^[ \t]*\\(?:[-+*]\\|[0-9]+[).]\\)[ \t]+\\(\\(?:\\[@\\(?:start:\\)?[0-9]+\\][ \t]*\\)?\\[\\(?:X\\|\\([0-9]+\\)/\\2\\)\\][^\n]*\n\\)" 12 'org-checkbox-done-text prepend))
'append)
(setq-default org-crypt-key "B0740C4C" (setq-default org-crypt-key "B0740C4C"
org-default-notes-file (concat user-documents-directory org-default-notes-file (concat user-documents-directory
(convert-standard-filename (convert-standard-filename