Remove org-mode custom fontification

This has been merged into doom-themes.
This commit is contained in:
Henrik Lissner 2017-08-03 21:24:03 +02:00
parent a63640b120
commit 749553993d
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 4 additions and 45 deletions

View file

@ -132,51 +132,7 @@
(when (or (featurep! :completion ivy) (when (or (featurep! :completion ivy)
(featurep! :completion helm)) (featurep! :completion helm))
(setq-default org-completion-use-ido nil (setq-default org-completion-use-ido nil
org-outline-path-complete-in-steps nil)) org-outline-path-complete-in-steps nil)))
;; Custom fontification
(defsubst +org--tag-face (n)
(let ((kwd (match-string n)))
(or (and (equal kwd "#") 'org-tag)
(and (equal kwd "@") 'org-special-keyword))))
(defun +org|init-custom-fontification ()
"Correct (and improve) org-mode's font-lock keywords.
1. Re-set `org-todo' & `org-headline-done' faces, to make them respect
underlying faces.
2. Fontify item bullets
3. Fontify item checkboxes (and when they're marked done)
4. Fontify dividers/separators (5+ dashes)
5. Fontify #hashtags and @at-tags, for personal convenience"
(let ((org-todo (format org-heading-keyword-regexp-format
org-todo-regexp))
(org-done (format org-heading-keyword-regexp-format
(concat "\\(?:" (mapconcat #'regexp-quote org-done-keywords "\\|") "\\)"))))
(setq
org-font-lock-extra-keywords
(append (org-delete-all
`(("\\[\\([0-9]*%\\)\\]\\|\\[\\([0-9]*\\)/\\([0-9]*\\)\\]"
(0 (org-get-checkbox-statistics-face) t))
(,org-todo (2 (org-get-todo-face 2) t))
(,org-done (2 'org-headline-done t)))
org-font-lock-extra-keywords)
`((,org-todo (2 (org-get-todo-face 2) prepend))
(,org-done (2 'org-headline-done prepend))
;; Make checkbox statistic cookies respect underlying faces
("\\[\\([0-9]*%\\)\\]\\|\\[\\([0-9]*\\)/\\([0-9]*\\)\\]"
(0 (org-get-checkbox-statistics-face) prepend))
;; I like how org-mode fontifies checked TODOs and want this to extend to
;; checked checkbox items:
("^[ \t]*\\(?:[-+*]\\|[0-9]+[).]\\)[ \t]+\\(\\(?:\\[@\\(?:start:\\)?[0-9]+\\][ \t]*\\)?\\[\\(?:X\\|\\([0-9]+\\)/\\2\\)\\][^\n]*\n\\)"
1 'org-headline-done prepend)
;; make plain list bullets stand out
("^ *\\([-+]\\|[0-9]+[).]\\) " 1 'org-list-dt append)
;; and separators/dividers
("^ *\\(-----+\\)$" 1 'org-meta-line)
;; custom #hashtags & @at-tags for another level of organization
("\\s-\\(\\([#@]\\)[^ \n.,]+\\)" 1 (+org--tag-face 2)))))))
(add-hook 'org-font-lock-set-keywords-hook #'+org|init-custom-fontification))
(defun +org-init-keybinds () (defun +org-init-keybinds ()
"Sets up org-mode and evil keybindings. Tries to fix the idiosyncrasies "Sets up org-mode and evil keybindings. Tries to fix the idiosyncrasies

View file

@ -16,6 +16,9 @@
(load "doom-themes-common.el" nil t)) (load "doom-themes-common.el" nil t))
(add-hook 'doom-pre-reload-theme-hook #'+doom|reload-theme) (add-hook 'doom-pre-reload-theme-hook #'+doom|reload-theme)
;; improve integration with org-mode
(add-hook 'doom-init-ui-hook #'doom-themes-org-config)
;; blink mode-line on errors ;; blink mode-line on errors
(add-hook 'doom-init-ui-hook #'doom-themes-visual-bell-config) (add-hook 'doom-init-ui-hook #'doom-themes-visual-bell-config)