lang/org: only reset latex background on theme load

Otherwise, many of these settings will overwrite user's customizations.

Fixes #1969
This commit is contained in:
Henrik Lissner 2019-10-27 17:23:22 -04:00
parent ba52f4c8e9
commit 987cece946
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -109,15 +109,18 @@ path too.")
org-tags-column -80 org-tags-column -80
org-use-sub-superscripts '{} org-use-sub-superscripts '{}
;; Scale up LaTeX previews a bit (default is too small) ;; Scale up LaTeX previews a bit (default is too small)
org-format-latex-options (plist-put org-format-latex-options :scale 1.5) org-format-latex-options (plist-put org-format-latex-options :scale 1.5))
;; Previews are usually rendered with light backgrounds, so ensure their
;; background (and foreground) match the current theme. (add-hook! 'doom-load-theme-hook
org-format-latex-options (defun +org-refresh-latex-background ()
(plist-put org-format-latex-options "Previews are usually rendered with light backgrounds, so ensure their
:background background (and foreground) match the current theme."
(face-attribute (or (cadr (assq 'default face-remapping-alist)) (setq org-format-latex-options
'default) (plist-put org-format-latex-options
:background nil t))) :background
(face-attribute (or (cadr (assq 'default face-remapping-alist))
'default)
:background nil t)))))
;; HACK Face specs fed directly to `org-todo-keyword-faces' don't respect ;; HACK Face specs fed directly to `org-todo-keyword-faces' don't respect
;; underlying faces like the `org-todo' face does, so we define our own ;; underlying faces like the `org-todo' face does, so we define our own
@ -155,14 +158,12 @@ path too.")
(apply orig-fn args))) (apply orig-fn args)))
;; Don't do automatic indent detection in org files ;; Don't do automatic indent detection in org files
(add-to-list 'doom-detect-indentation-excluded-modes 'org-mode nil #'eq) (cl-pushnew 'org-mode doom-detect-indentation-excluded-modes :test #'eq)
(set-pretty-symbols! 'org-mode (set-pretty-symbols! 'org-mode
:name "#+NAME:" :name "#+NAME:"
:src_block "#+BEGIN_SRC" :src_block "#+BEGIN_SRC"
:src_block_end "#+END_SRC") :src_block_end "#+END_SRC"))
(add-hook 'doom-load-theme-hook #'+org-init-appearance-h))
(defun +org-init-babel-h () (defun +org-init-babel-h ()