From 90ede316983966b5c5f584bba679f65b3549b2d3 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 19 Nov 2024 00:29:53 -0500 Subject: [PATCH] fix(org): org-roam: remove emacsql-sqlite hacks emacs-sqlite.el was removed upstream in magit/emacsql@8ebf559, and the custom sqlite executable is no longer built as of magit/emacsql@7a79c2b, which renders these two advice mostly unnecessary (plus they throw void-function `emacsql-sqlite-ensure-binary` errors). Fix: #8167 Ref: org-roam/org-roam#2485 Ref: magit/emacsql@8ebf559f58fd Ref: magit/emacsql@7a79c2be3da8 --- modules/lang/org/contrib/roam2.el | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/modules/lang/org/contrib/roam2.el b/modules/lang/org/contrib/roam2.el index 4463a3d46..ad11b37ea 100644 --- a/modules/lang/org/contrib/roam2.el +++ b/modules/lang/org/contrib/roam2.el @@ -27,22 +27,11 @@ of org-mode to properly utilize ID links.") :init (doom-load-packages-incrementally - '(ansi-color dash f rx seq magit-section emacsql emacsql-sqlite)) + '(ansi-color dash f rx seq magit-section emacsql)) ;; Don't display warning message dedicated for v1 users. Need to be set early. (setq org-roam-v2-ack t) - (defadvice! +org-roam-suppress-sqlite-build-a (fn &rest args) - "Suppress automatic building of sqlite3 binary when loading `org-roam'. -This is a blocking operation that can take a while to complete -and better be deferred when there will be an actual demand for -the database. See `+org-init-roam-h' for the launch process." - :around #'emacsql-sqlite-ensure-binary - (if (not (boundp 'org-roam-db-version)) - (apply fn args) - (advice-remove #'emacsql-sqlite-ensure-binary #'+org-roam-suppress-sqlite-build-a) - nil)) - :config (defun +org-init-roam-h () "Setup `org-roam' but don't immediately initialize its database. @@ -55,18 +44,6 @@ Instead, initialize it when it will be actually needed." In case of failure, fail gracefully." :before #'org-roam-db-query (message "Initializing org-roam database...") - (let ((run-cleanup-p t)) - (unwind-protect - ;; Try to build the binary if it doesn't exist. In case of failure - ;; this will error, run the cleanup and exit, and in case of success - ;; this will return nil and sync the database. - (setq run-cleanup-p (emacsql-sqlite-ensure-binary)) - (when run-cleanup-p - (setq org-roam--sqlite-available-p nil) - (org-roam-teardown) - (message (concat "EmacSQL failied to build SQLite binary for org-roam; " - "see *Compile-Log* buffer for details.\n" - "To try reinitialize org-roam, run \"M-x org-roam-setup\""))))) (advice-remove 'org-roam-db-query #'+org-roam-try-init-db-a) (org-roam-db-sync))