emacs won’t load my init.el due to an error loading org-roam, though it worked a couple of days ago. I just did a system update, perhaps that’s what triggered it?
Debugger entered--Lisp error: (error "Selecting deleted buffer")
set-buffer(#<killed buffer>)
(save-current-buffer (set-buffer (emacsql-buffer connection)) (and (>= (buffer-size) 2) (string= "#\n" (buffer-substring (- (point-max) 2) (point-max)))))
(progn (save-current-buffer (set-buffer (emacsql-buffer connection)) (and (>= (buffer-size) 2) (string= "#\n" (buffer-substring (- (point-max) 2) (point-max))))))
(closure (t) (connection) "Return true if the end of the buffer has a properl..." (progn (save-current-buffer (set-buffer (emacsql-buffer connection)) (and (>= (buffer-size) 2) (string= "#\n" (buffer-substring (- ... 2) (point-max)))))))(#<emacsql-sqlite-connection emacsql-sqlite-connection-1559bf72ba10>)
apply((closure (t) (connection) "Return true if the end of the buffer has a properl..." (progn (save-current-buffer (set-buffer (emacsql-buffer connection)) (and (>= (buffer-size) 2) (string= "#\n" (buffer-substring (- ... 2) (point-max))))))) #<emacsql-sqlite-connection emacsql-sqlite-connection-1559bf72ba10> nil)
emacsql-waiting-p(#<emacsql-sqlite-connection emacsql-sqlite-connection-1559bf72ba10>)
(not (emacsql-waiting-p connection))
(and (or (null real-timeout) (< (float-time) end)) (not (emacsql-waiting-p connection)))
(while (and (or (null real-timeout) (< (float-time) end)) (not (emacsql-waiting-p connection))) (let ((saved-match-data (match-data))) (unwind-protect (progn (accept-process-output (emacsql-process connection) real-timeout)) (set-match-data saved-match-data t))))
(let* ((real-timeout (or timeout emacsql-global-timeout)) (end (if real-timeout (progn (+ (float-time) real-timeout))))) (while (and (or (null real-timeout) (< (float-time) end)) (not (emacsql-waiting-p connection))) (let ((saved-match-data (match-data))) (unwind-protect (progn (accept-process-output (emacsql-process connection) real-timeout)) (set-match-data saved-match-data t)))) (if (emacsql-waiting-p connection) nil (signal 'emacsql-timeout (list "Query timed out" real-timeout))))
(progn (let* ((real-timeout (or timeout emacsql-global-timeout)) (end (if real-timeout (progn (+ (float-time) real-timeout))))) (while (and (or (null real-timeout) (< (float-time) end)) (not (emacsql-waiting-p connection))) (let ((saved-match-data (match-data))) (unwind-protect (progn (accept-process-output (emacsql-process connection) real-timeout)) (set-match-data saved-match-data t)))) (if (emacsql-waiting-p connection) nil (signal 'emacsql-timeout (list "Query timed out" real-timeout)))))
(closure (t) (connection &optional timeout) "Block until CONNECTION is waiting for further inpu..." (progn (let* ((real-timeout (or timeout emacsql-global-timeout)) (end (if real-timeout (progn ...)))) (while (and (or (null real-timeout) (< ... end)) (not (emacsql-waiting-p connection))) (let ((saved-match-data ...)) (unwind-protect (progn ...) (set-match-data saved-match-data t)))) (if (emacsql-waiting-p connection) nil (signal 'emacsql-timeout (list "Query timed out" real-timeout))))))(#<emacsql-sqlite-connection emacsql-sqlite-connection-1559bf72ba10>)
apply((closure (t) (connection &optional timeout) "Block until CONNECTION is waiting for further inpu..." (progn (let* ((real-timeout (or timeout emacsql-global-timeout)) (end (if real-timeout (progn ...)))) (while (and (or (null real-timeout) (< ... end)) (not (emacsql-waiting-p connection))) (let ((saved-match-data ...)) (unwind-protect (progn ...) (set-match-data saved-match-data t)))) (if (emacsql-waiting-p connection) nil (signal 'emacsql-timeout (list "Query timed out" real-timeout)))))) #<emacsql-sqlite-connection emacsql-sqlite-connection-1559bf72ba10> nil)
emacsql-wait(#<emacsql-sqlite-connection emacsql-sqlite-connection-1559bf72ba10>)
(let ((sql-string (apply #'emacsql-compile connection sql args))) (emacsql-clear connection) (emacsql-send-message connection sql-string) (emacsql-wait connection) (emacsql-parse connection))
(progn (let ((sql-string (apply #'emacsql-compile connection sql args))) (emacsql-clear connection) (emacsql-send-message connection sql-string) (emacsql-wait connection) (emacsql-parse connection)))
(closure (t) (connection sql &rest args) "\n\n(fn CONNECTION SQL &rest ARGS)" (progn (let ((sql-string (apply #'emacsql-compile connection sql args))) (emacsql-clear connection) (emacsql-send-message connection sql-string) (emacsql-wait connection) (emacsql-parse connection))))(#<emacsql-sqlite-connection emacsql-sqlite-connection-1559bf72ba10> [:pragma (= busy-timeout $s1)] 15000)
apply((closure (t) (connection sql &rest args) "\n\n(fn CONNECTION SQL &rest ARGS)" (progn (let ((sql-string (apply #'emacsql-compile connection sql args))) (emacsql-clear connection) (emacsql-send-message connection sql-string) (emacsql-wait connection) (emacsql-parse connection)))) #<emacsql-sqlite-connection emacsql-sqlite-connection-1559bf72ba10> ([:pragma (= busy-timeout $s1)] 15000))
emacsql(#<emacsql-sqlite-connection emacsql-sqlite-connection-1559bf72ba10> [:pragma (= busy-timeout $s1)] 15000)
(let* ((process-connection-type nil) (coding-system-for-write 'utf-8-auto) (coding-system-for-read 'utf-8-auto) (file (slot-value connection 'file)) (buffer (generate-new-buffer " *emacsql-sqlite*")) (fullfile (if file (expand-file-name file) ":memory:")) (process (start-process "emacsql-sqlite" buffer emacsql-sqlite-executable fullfile))) (let* ((v connection)) (eieio-oset v 'process process)) (let* ((v process)) (set-process-sentinel v #'(lambda (proc _) (kill-buffer (process-buffer proc))))) (emacsql-wait connection) (emacsql connection [:pragma (= busy-timeout $s1)] (/ (* emacsql-global-timeout 1000) 2)) (emacsql-register connection))
(progn (emacsql-sqlite-ensure-binary) (let* ((process-connection-type nil) (coding-system-for-write 'utf-8-auto) (coding-system-for-read 'utf-8-auto) (file (slot-value connection 'file)) (buffer (generate-new-buffer " *emacsql-sqlite*")) (fullfile (if file (expand-file-name file) ":memory:")) (process (start-process "emacsql-sqlite" buffer emacsql-sqlite-executable fullfile))) (let* ((v connection)) (eieio-oset v 'process process)) (let* ((v process)) (set-process-sentinel v #'(lambda (proc _) (kill-buffer (process-buffer proc))))) (emacsql-wait connection) (emacsql connection [:pragma (= busy-timeout $s1)] (/ (* emacsql-global-timeout 1000) 2)) (emacsql-register connection)))
(progn (progn (emacsql-sqlite-ensure-binary) (let* ((process-connection-type nil) (coding-system-for-write 'utf-8-auto) (coding-system-for-read 'utf-8-auto) (file (slot-value connection 'file)) (buffer (generate-new-buffer " *emacsql-sqlite*")) (fullfile (if file (expand-file-name file) ":memory:")) (process (start-process "emacsql-sqlite" buffer emacsql-sqlite-executable fullfile))) (let* ((v connection)) (eieio-oset v 'process process)) (let* ((v process)) (set-process-sentinel v #'(lambda (proc _) (kill-buffer ...)))) (emacsql-wait connection) (emacsql connection [:pragma (= busy-timeout $s1)] (/ (* emacsql-global-timeout 1000) 2)) (emacsql-register connection))))
(closure (t) (connection &rest _rest) "\n\n(fn CONNECTION &rest REST)" (progn (progn (emacsql-sqlite-ensure-binary) (let* ((process-connection-type nil) (coding-system-for-write 'utf-8-auto) (coding-system-for-read 'utf-8-auto) (file (slot-value connection ...)) (buffer (generate-new-buffer " *emacsql-sqlite*")) (fullfile (if file ... ":memory:")) (process (start-process "emacsql-sqlite" buffer emacsql-sqlite-executable fullfile))) (let* ((v connection)) (eieio-oset v 'process process)) (let* ((v process)) (set-process-sentinel v #'...)) (emacsql-wait connection) (emacsql connection [:pragma (= busy-timeout $s1)] (/ (* emacsql-global-timeout 1000) 2)) (emacsql-register connection)))))(#<emacsql-sqlite-connection emacsql-sqlite-connection-1559bf72ba10> (:file "~/.emacs.d/org-roam.db"))
apply((closure (t) (connection &rest _rest) "\n\n(fn CONNECTION &rest REST)" (progn (progn (emacsql-sqlite-ensure-binary) (let* ((process-connection-type nil) (coding-system-for-write 'utf-8-auto) (coding-system-for-read 'utf-8-auto) (file (slot-value connection ...)) (buffer (generate-new-buffer " *emacsql-sqlite*")) (fullfile (if file ... ":memory:")) (process (start-process "emacsql-sqlite" buffer emacsql-sqlite-executable fullfile))) (let* ((v connection)) (eieio-oset v 'process process)) (let* ((v process)) (set-process-sentinel v #'...)) (emacsql-wait connection) (emacsql connection [:pragma (= busy-timeout $s1)] (/ (* emacsql-global-timeout 1000) 2)) (emacsql-register connection))))) (#<emacsql-sqlite-connection emacsql-sqlite-connection-1559bf72ba10> (:file "~/.emacs.d/org-roam.db")))
#f(compiled-function (&rest args) #<bytecode -0x1a921b7df21097a0>)(#<emacsql-sqlite-connection emacsql-sqlite-connection-1559bf72ba10> (:file "~/.emacs.d/org-roam.db"))
apply(#f(compiled-function (&rest args) #<bytecode -0x1a921b7df21097a0>) #<emacsql-sqlite-connection emacsql-sqlite-connection-1559bf72ba10> (:file "~/.emacs.d/org-roam.db"))
initialize-instance(#<emacsql-sqlite-connection emacsql-sqlite-connection-1559bf72ba10> (:file "~/.emacs.d/org-roam.db"))
#f(compiled-function (class &rest slots) "Default constructor for CLASS `eieio-default-superclass'.\nSLOTS are the initialization slots used by `initialize-instance'.\nThis static method is called when an object is constructed.\nIt allocates the vector used to represent an EIEIO object, and then\ncalls `initialize-instance' on that object." #<bytecode -0xadfb7d5e44f8b22>)(emacsql-sqlite-connection :file "~/.emacs.d/org-roam.db")
apply(#f(compiled-function (class &rest slots) "Default constructor for CLASS `eieio-default-superclass'.\nSLOTS are the initialization slots used by `initialize-instance'.\nThis static method is called when an object is constructed.\nIt allocates the vector used to represent an EIEIO object, and then\ncalls `initialize-instance' on that object." #<bytecode -0xadfb7d5e44f8b22>) emacsql-sqlite-connection (:file "~/.emacs.d/org-roam.db"))
make-instance(emacsql-sqlite-connection :file "~/.emacs.d/org-roam.db")
(let ((connection (make-instance 'emacsql-sqlite-connection :file file))) (if debug (progn (emacsql-enable-debugging connection))) connection)
(progn (let ((--cl-keys-- --cl-rest--)) (while --cl-keys-- (cond ((memq (car --cl-keys--) '(:debug :allow-other-keys)) (if (cdr --cl-keys--) nil (error "Missing argument for %s" (car --cl-keys--))) (setq --cl-keys-- (cdr (cdr --cl-keys--)))) ((car (cdr (memq ... --cl-rest--))) (setq --cl-keys-- nil)) (t (error "Keyword argument %s not one of (:debug)" (car --cl-keys--)))))) (let ((connection (make-instance 'emacsql-sqlite-connection :file file))) (if debug (progn (emacsql-enable-debugging connection))) connection))
(let* ((debug (car (cdr (plist-member --cl-rest-- ':debug))))) (progn (let ((--cl-keys-- --cl-rest--)) (while --cl-keys-- (cond ((memq (car --cl-keys--) '...) (if (cdr --cl-keys--) nil (error "Missing argument for %s" ...)) (setq --cl-keys-- (cdr ...))) ((car (cdr ...)) (setq --cl-keys-- nil)) (t (error "Keyword argument %s not one of (:debug)" (car --cl-keys--)))))) (let ((connection (make-instance 'emacsql-sqlite-connection :file file))) (if debug (progn (emacsql-enable-debugging connection))) connection)))
emacsql-sqlite("~/.emacs.d/org-roam.db")
org-roam-db()
org-roam-db-sync()
org-roam-db-autosync-mode()
eval-buffer(#<buffer *load*> nil "/home/rhombus/.emacs.d/init.el" nil t) ; Reading at buffer position 2060
load-with-code-conversion("/home/rhombus/.emacs.d/init.el" "/home/rhombus/.emacs.d/init.el" t t)
load("/home/rhombus/.emacs.d/init" noerror nomessage)
startup--load-user-init-file(#f(compiled-function () #<bytecode 0x1eb2de4572631591>) #f(compiled-function () #<bytecode -0x1f3c61addc0b8a75>) t)
command-line()
normal-top-level()
None of the standard bits of advice I’ve tried have worked:
Deleting org-roam.db and running org-roam-db-sync fails with the same “Selected deleted buffer” error.
I have updated emacsql, no change.
I have manually built emacsql with make, no change.
Does anyone have any other suggestions? Any advice to help me interpret this error message?