From b1c000ddf5477b97116f151a5a0c79f8969215a0 Mon Sep 17 00:00:00 2001 From: Amin Bandali Date: Tue, 25 Dec 2018 13:28:05 -0500 Subject: [PATCH] [emacs/org] add the org-mode font-lock-keywords only for dark theme --- init.org | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/init.org b/init.org index 058d8ef..800af12 100644 --- a/init.org +++ b/init.org @@ -757,13 +757,6 @@ In short, my favourite way of life. org-catch-invisible-edits 'show-and-error org-log-done 'time) (add-to-list 'org-structure-template-alist '("L" . "src emacs-lisp") t) - (font-lock-add-keywords - 'org-mode - '(("[ \t]*\\(#\\+\\(BEGIN\\|END\\|begin\\|end\\)_\\(\\S-+\\)\\)[ \t]*\\([^\n:]*\\)" - (1 '(:foreground "#5a5b5a" :background "#292b2b") t) ; directive - (3 '(:foreground "#81a2be" :background "#292b2b") t) ; kind - (4 '(:foreground "#c5c8c6") t))) ; title - t) :bind (:map org-mode-map ("M-L" . org-insert-last-stored-link)) :hook ((org-mode . org-indent-mode) (org-mode . auto-fill-mode) @@ -1772,19 +1765,29 @@ Emacs package that displays available keybindings in popup ** theme helper functions #+begin_src emacs-lisp +(defvar a/org-mode-font-lock-keywords + '(("[ \t]*\\(#\\+\\(BEGIN\\|END\\|begin\\|end\\)_\\(\\S-+\\)\\)[ \t]*\\([^\n:]*\\)" + (1 '(:foreground "#5a5b5a" :background "#292b2b") t) ; directive + (3 '(:foreground "#81a2be" :background "#292b2b") t) ; kind + (4 '(:foreground "#c5c8c6") t)))) ; title + (defun a/lights-on () "Enable my favourite light theme." (interactive) (mapc #'disable-theme custom-enabled-themes) (load-theme 'tangomod t) - (sml/apply-theme 'automatic)) + (sml/apply-theme 'automatic) + (font-lock-remove-keywords + 'org-mode a/org-mode-font-lock-keywords)) (defun a/lights-off () "Go dark." (interactive) (mapc #'disable-theme custom-enabled-themes) (load-theme 'doom-tomorrow-night t) - (sml/apply-theme 'automatic)) + (sml/apply-theme 'automatic) + (font-lock-add-keywords + 'org-mode a/org-mode-font-lock-keywords t)) (bind-keys ("s-t d" . a/lights-off) -- 2.20.1