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
This commit is contained in:
Henrik Lissner 2020-07-29 14:28:27 -04:00
parent d2f7999c29
commit 34e8047180
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -62,7 +62,16 @@
;; Hide the mode line in the org-roam buffer, since it serves no purpose. This ;; Hide the mode line in the org-roam buffer, since it serves no purpose. This
;; makes it easier to distinguish among other org buffers. ;; 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 ;; Since the org module lazy loads org-protocol (waits until an org URL is