refactor(org): update org-roam emacsql deferral advice

org-roam-setup was made obsolete in Org Roam 2.0.

Ref: org-roam/org-roam@5dce6261a2
This commit is contained in:
Henrik Lissner 2022-02-06 03:24:38 +01:00
parent 8cbfbce394
commit 7e6baca99d

View file

@ -45,7 +45,8 @@ the database. See `+org-init-roam-h' for the launch process."
"Setup `org-roam' but don't immediately initialize its database. "Setup `org-roam' but don't immediately initialize its database.
Instead, initialize it when it will be actually needed." Instead, initialize it when it will be actually needed."
(letf! ((#'org-roam-db-sync #'ignore)) (letf! ((#'org-roam-db-sync #'ignore))
(org-roam-setup)) (org-roam-db-autosync-enable)))
(defadvice! +org-roam-try-init-db-a (&rest _) (defadvice! +org-roam-try-init-db-a (&rest _)
"Try to initialize org-roam database at the last possible safe moment. "Try to initialize org-roam database at the last possible safe moment.
In case of failure, fail gracefully." In case of failure, fail gracefully."
@ -64,7 +65,7 @@ In case of failure, fail gracefully."
"see *Compile-Log* buffer for details.\n" "see *Compile-Log* buffer for details.\n"
"To try reinitialize org-roam, run \"M-x org-roam-setup\""))))) "To try reinitialize org-roam, run \"M-x org-roam-setup\"")))))
(advice-remove 'org-roam-db-query #'+org-roam-try-init-db-a) (advice-remove 'org-roam-db-query #'+org-roam-try-init-db-a)
(org-roam-db-sync))) (org-roam-db-sync))
(setq org-roam-directory (setq org-roam-directory
(thread-first (or org-roam-directory "roam") (thread-first (or org-roam-directory "roam")