Optimise loading order for citar-embark

Reduce duplication in setting bibliography file variables, whilst also
being a bit more flexible
This commit is contained in:
Evie Litherland-Smith 2024-05-30 18:26:27 +01:00
parent 2e87268d59
commit 4c4c4e7882

17
init.el
View file

@ -768,15 +768,10 @@ it will be tried first."
(org-noter-prefer-root-as-file-level nil)) (org-noter-prefer-root-as-file-level nil))
(use-package citar (use-package citar
:after org
:custom :custom
(org-cite-global-bibliography (citar-bibliography
(list (list
(expand-file-name "citar/main.bib" org-directory))) (expand-file-name "citar/main.bib" org-directory)))
(org-cite-insert-processor 'citar)
(org-cite-follow-processor 'citar)
(org-cite-activate-processor 'citar)
(citar-bibliography org-cite-global-bibliography)
(citar-library-paths (citar-library-paths
(list (list
(expand-file-name "citar/library/" org-directory))) (expand-file-name "citar/library/" org-directory)))
@ -787,8 +782,14 @@ it will be tried first."
(LaTeX-mode . citar-capf-setup) (LaTeX-mode . citar-capf-setup)
(org-mode . citar-capf-setup) (org-mode . citar-capf-setup)
:config :config
(require 'org)
(require 'nerd-icons) (require 'nerd-icons)
(require 'citar-embark) (require 'citar-embark)
(setopt org-cite-insert-processor 'citar
org-cite-follow-processor 'citar
org-cite-activate-processor 'citar)
(dolist (bibfile citar-bibliography)
(add-to-list 'org-cite-global-bibliography bibfile))
(defvar citar-indicator-files-icons (defvar citar-indicator-files-icons
(citar-indicator-create (citar-indicator-create
:symbol (nerd-icons-octicon :symbol (nerd-icons-octicon
@ -830,9 +831,11 @@ it will be tried first."
citar-indicator-cited-icons))) citar-indicator-cited-icons)))
(use-package citar-embark (use-package citar-embark
:after (citar embark) :after citar
:diminish :diminish
:init :init
(require 'embark)
:config
(citar-embark-mode +1)) (citar-embark-mode +1))
(setq org-latex-compiler "lualatex") (setq org-latex-compiler "lualatex")