From 84086e532ddc377628d578b975990b637dbfae3b Mon Sep 17 00:00:00 2001 From: Liam Hupfer Date: Sun, 3 Mar 2024 23:55:40 -0600 Subject: [PATCH] refactor(biblio): tidy use-package usage :after can be misleading, so avoid it. :no-require is for working around byte compilation issues; deferral is sufficient here. Ref: https://github.com/jwiegley/use-package/issues/829 --- modules/tools/biblio/config.el | 41 +++++++++++++++------------------- 1 file changed, 18 insertions(+), 23 deletions(-) diff --git a/modules/tools/biblio/config.el b/modules/tools/biblio/config.el index 2a02a994f..61caf6677 100644 --- a/modules/tools/biblio/config.el +++ b/modules/tools/biblio/config.el @@ -3,9 +3,7 @@ ;; ;;; `org-cite' -(use-package! oc - :defer t - :config +(after! oc (setq org-cite-global-bibliography (ensure-list (or (bound-and-true-p citar-bibliography) @@ -13,16 +11,30 @@ ;; Setup export processor; default csl/citeproc-el, with biblatex for ;; latex org-cite-export-processors '((latex biblatex) (t csl)) - org-support-shift-select t)) + org-support-shift-select t) + + (require 'oc-biblatex)) + +;; oc-csl requires citeproc, which requires the top-level org, so loading oc-csl +;; after oc interferes with incremental loading of Org +(after! org (require 'oc-csl)) (use-package! citar :when (modulep! :completion vertico) - :no-require - :config + :defer t + :init (setq org-cite-insert-processor 'citar org-cite-follow-processor 'citar org-cite-activate-processor 'citar) + + :config + (after! embark + (citar-embark-mode)) + + (after! org-roam + (citar-org-roam-mode)) + (when (modulep! :completion vertico +icons) (defvar citar-indicator-files-icons (citar-indicator-create @@ -65,23 +77,6 @@ citar-indicator-notes-icons citar-indicator-cited-icons)))) -(use-package! citar-embark - :when (modulep! :completion vertico) - :after citar embark - :config (citar-embark-mode)) - -(use-package! citar-org-roam - :when (and (modulep! +roam2) - (modulep! :completion vertico)) - :after citar org-roam - :config (citar-org-roam-mode)) - -;; `org-cite' processors -(use-package! oc-biblatex :after oc) -;; oc-csl requires citeproc, which requires the top-level org, so loading oc-csl -;; after oc interferes with incremental loading of Org -(use-package! oc-csl :after org) - ;; ;;; Third-party