Minor edits.

This commit is contained in:
Derek Taylor
2020-11-05 13:27:52 -06:00
parent 8fbacc6392
commit 35112d3f8c
170 changed files with 1304 additions and 756 deletions

View File

@@ -66,13 +66,13 @@ Is relative to `org-directory', unless it is absolute. Is used in Doom's default
(defun +org-init-org-directory-h ()
(unless org-directory
(setq org-directory "~/org"))
(setq-default org-directory "~/org"))
(setq org-id-locations-file (expand-file-name ".orgids" org-directory)))
(defun +org-init-agenda-h ()
(unless org-agenda-files
(setq org-agenda-files (list org-directory)))
(setq-default org-agenda-files (list org-directory)))
(setq-default
;; Different colors for different priority levels
org-agenda-deadline-faces
@@ -129,19 +129,9 @@ Is relative to `org-directory', unless it is absolute. Is used in Doom's default
org-refile-use-outline-path 'file
org-outline-path-complete-in-steps nil)
;; Previews are rendered with the incorrect background
(plist-put org-format-latex-options :scale 1.5) ; larger previews
(add-hook! 'doom-load-theme-hook
(defun +org-refresh-latex-background-h ()
"Previews are rendered with the incorrect background.
This forces it to read the background before rendering."
(plist-put! org-format-latex-options
:background
(face-attribute (if-let (remap (cadr (assq 'default face-remapping-alist)))
(if (keywordp (car-safe remap))
(plist-get remap :background)
remap)
'default)
:background nil t))))
(plist-put org-format-latex-options :background 'default) ; match the background
;; 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
@@ -407,7 +397,7 @@ relative to `org-directory', unless it is an absolute path."
:config
(unless org-attach-id-dir
;; Centralized attachments directory by default
(setq org-attach-id-dir (expand-file-name ".attach/" org-directory)))
(setq-default org-attach-id-dir (expand-file-name ".attach/" org-directory)))
(after! projectile
(add-to-list 'projectile-globally-ignored-directories org-attach-id-dir)))
@@ -421,6 +411,8 @@ relative to `org-directory', unless it is an absolute path."
"file"
:face (lambda (path)
(if (or (file-remote-p path)
;; filter out network shares on windows (slow)
(and IS-WINDOWS (string-prefix-p "//" path))
(file-exists-p path))
'org-link
'error)))
@@ -493,13 +485,14 @@ the exported output (i.e. formatters)."
:around #'org-export-to-file
(if (not org-export-in-background)
(apply orig-fn args)
(setq org-export-async-init-file (make-temp-file "doom-org-async-export"))
(with-temp-file org-export-async-init-file
(prin1 `(progn (setq org-export-async-debug ,debug-on-error
load-path ',load-path)
(load ,user-init-file nil t))
(current-buffer)))
(apply orig-fn args))))
(let ((user-init-file (or org-export-async-init-file user-init-file)))
(setq org-export-async-init-file (make-temp-file "doom-org-async-export"))
(with-temp-file org-export-async-init-file
(prin1 `(progn (setq org-export-async-debug ,debug-on-error
load-path ',load-path)
(load ,user-init-file nil t))
(current-buffer)))
(apply orig-fn args)))))
(defun +org-init-habit-h ()
@@ -529,6 +522,14 @@ the exported output (i.e. formatters)."
;; Open directory links in dired
(add-to-list 'org-file-apps '(directory . emacs))
;; Some uses of `org-fix-tags-on-the-fly' occur without a check on
;; `org-auto-align-tags', such as in `org-self-insert-command' and
;; `org-delete-backward-char'.
;; TODO Should be reported/PR'ed upstream
(defadvice! +org--respect-org-auto-align-tags-a (&rest _)
:before-while #'org-fix-tags-on-the-fly
org-auto-align-tags)
;; HACK Org is known to use a lot of unicode symbols (and large org files tend
;; to be especially memory hungry). Compounded with
;; `inhibit-compacting-font-caches' being non-nil, org needs more memory