[emacs/org] add the org-mode font-lock-keywords only for dark theme
[~bandali/configs] / init.org
index 505a793..800af12 100644 (file)
--- a/init.org
+++ b/init.org
@@ -41,11 +41,10 @@ then bootstrap Borg, tell Borg to retrieve package submodules, and
 byte-compiled the packages. Something along these lines should work:
 
 #+begin_src sh :tangle no
 byte-compiled the packages. Something along these lines should work:
 
 #+begin_src sh :tangle no
-git clone https://github.com/aminb/dotfiles ~/.emacs.d
+git clone https://git.sr.ht/~bandali/dotfiles ~/.emacs.d
 cd ~/.emacs.d
 make bootstrap-borg
 make bootstrap
 cd ~/.emacs.d
 make bootstrap-borg
 make bootstrap
-make build
 #+end_src
 
 * Contents                                                   :toc_1:noexport:
 #+end_src
 
 * Contents                                                   :toc_1:noexport:
@@ -758,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)
         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)
   :bind (:map org-mode-map ("M-L" . org-insert-last-stored-link))
   :hook ((org-mode . org-indent-mode)
          (org-mode . auto-fill-mode)
@@ -789,11 +781,8 @@ In short, my favourite way of life.
                  ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
                  ("\\paragraph{%s}"     . "\\paragraph*{%s}")
                  ("\\subparagraph{%s}"  . "\\subparagraph*{%s}"))
                  ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
                  ("\\paragraph{%s}"     . "\\paragraph*{%s}")
                  ("\\subparagraph{%s}"  . "\\subparagraph*{%s}"))
-               t))
-
-(use-package ox-beamer
-  :demand
-  :after ox)
+               t)
+  (require 'ox-beamer))
 #+end_src
 
 **** asynchronous tangle
 #+end_src
 
 **** asynchronous tangle
@@ -1776,19 +1765,29 @@ Emacs package that displays available keybindings in popup
 ** theme helper functions
 
 #+begin_src emacs-lisp
 ** 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)
 (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)
 
 (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)
 
 (bind-keys
  ("s-t d" . a/lights-off)
@@ -2248,6 +2247,7 @@ Convenient footnotes in =message-mode=.
 
 #+begin_src emacs-lisp
 (use-package ebdb
 
 #+begin_src emacs-lisp
 (use-package ebdb
+  :defer 2
   :after gnus
   :bind (:map gnus-group-mode-map ("e" . ebdb))
   :config
   :after gnus
   :bind (:map gnus-group-mode-map ("e" . ebdb))
   :config
@@ -2264,16 +2264,12 @@ Convenient footnotes in =message-mode=.
 ;;   (ebdb-complete-enable))
 
 (use-package company-ebdb
 ;;   (ebdb-complete-enable))
 
 (use-package company-ebdb
-  :after (:all company message)
+  :defer 2
   :config
   :config
-  (defun company-ebdb--post-complete (_) nil)
-  :hook
-  (message-mode . (lambda ()
-                    (add-to-list (make-local-variable 'company-backends)
-                                 'company-ebdb))))
+  (defun company-ebdb--post-complete (_) nil))
 
 (use-package ebdb-gnus
 
 (use-package ebdb-gnus
-  :demand
+  :defer 3
   :after ebdb
   :custom
   (ebdb-gnus-window-configuration
   :after ebdb
   :custom
   (ebdb-gnus-window-configuration
@@ -2285,7 +2281,7 @@ Convenient footnotes in =message-mode=.
                            (ebdb-gnus 0.3))))))
 
 (use-package ebdb-mua
                            (ebdb-gnus 0.3))))))
 
 (use-package ebdb-mua
-  :demand
+  :defer 3
   :after ebdb
   ;; :custom (ebdb-mua-pop-up nil)
   )
   :after ebdb
   ;; :custom (ebdb-mua-pop-up nil)
   )