From 34e8047180ea046a118d83f0c9279c5d17a844a5 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 29 Jul 2020 14:28:27 -0400 Subject: [PATCH] Fix #3645: stringp error starting up org-roam A naive check upstream expects emacsql-sqlite3-executable to always be a string, but it will be nil if sqlite3 isn't installed, so it throws an unhelpful type error. Relevant to #3643 --- modules/lang/org/contrib/roam.el | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/modules/lang/org/contrib/roam.el b/modules/lang/org/contrib/roam.el index 3a350de8d..716069e90 100644 --- a/modules/lang/org/contrib/roam.el +++ b/modules/lang/org/contrib/roam.el @@ -62,7 +62,16 @@ ;; Hide the mode line in the org-roam buffer, since it serves no purpose. This ;; makes it easier to distinguish among other org buffers. - (add-hook 'org-roam-buffer-prepare-hook #'hide-mode-line-mode)) + (add-hook 'org-roam-buffer-prepare-hook #'hide-mode-line-mode) + + ;; REVIEW Fixes an unhelpful "wrong-type-argument: stringp" error which occurs + ;; if sqlite3 isn't installed. Remove this once addressed upstream. + (defadvice! +org-fail-gracefully-when-sqlite-is-absent-a (orig-fn &rest args) + :around #'org-roam-mode + (let ((emacsql-sqlite3-executable + (or (bound-and-true-p emacsql-sqlite3-executable) + "sqlite3"))) + (apply orig-fn args)))) ;; Since the org module lazy loads org-protocol (waits until an org URL is