org-roam / org-roam-bibtex

Org Roam integration with bibliography management software
GNU General Public License v3.0
565 stars 47 forks source link

Unable to create new notes #243

Closed MCSH closed 2 years ago

MCSH commented 2 years ago

Describe the bug I recently updated all my emacs packages and this started happening.

Whenever I open a citation that doesn't have an existing note and chose notes, I get an error saying (wrong-type-argument char-or-string-p nil). Here is the backtrace:

Debugger entered--Lisp error: (wrong-type-argument char-or-string-p nil)
  string-glyph-decompose(nil)
  #f(compiled-function (--cl-nonspacing-mark-p-- s) #<bytecode -0x140d60bd0a29e616>)(#f(compiled-function (char) #<bytecode 0x1710bb8673248f4c>) nil)
  #f(compiled-function (node) "Return the slug of NODE." #<bytecode 0x1c46401c5d3dcc94>)(#s(org-roam-node :file nil :file-title nil :file-hash nil :file-atime nil :file-mtime nil :id "945439d8-272b-461b-b0e2-62763ee8351b" :level nil :point nil :todo nil :priority nil :scheduled nil :deadline "Beltrami flow and neural diffusion on graphs" :title nil :properties nil :olp nil :tags nil :aliases nil :refs 
  apply(#f(compiled-function (node) "Return the slug of NODE." #<bytecode 0x1c46401c5d3dcc94>) #s(org-roam-node :file nil :file-title nil :file-hash nil :file-atime nil :file-mtime nil :id "945439d8-272b-461b-b0e2-62763ee8351b" :level nil :point nil :todo nil :priority nil :scheduled nil :deadline "Beltrami flow and neural diffusion on graphs" :title nil :properties nil :olp nil :tags nil :aliases nil :refs 
  org-roam-node-slug(#s(org-roam-node :file nil :file-title nil :file-hash nil :file-atime nil :file-mtime nil :id "945439d8-272b-461b-b0e2-62763ee8351b" :level nil :point nil :todo nil :priority nil :scheduled nil :deadline "Beltrami flow and neural diffusion on graphs" :title nil :properties nil :olp nil :tags nil :aliases nil :refs 
  #f(compiled-function (key default-val) #<bytecode -0x1f1f941b3015fcd4>)("slug" nil)
  #f(compiled-function (md) #<bytecode 0xf27c0f3bd78ef19>)("${slug}")
  replace-regexp-in-string("\\${\\([^}]+\\)}" #f(compiled-function (md) #<bytecode 0xf27c0f3bd78ef19>) "${slug}.org" t t)
  org-roam-format-template("${slug}.org" #f(compiled-function (key default-val) #<bytecode -0x1f1f941b3015fcd4>))
  org-roam-capture--fill-template("${slug}.org")
  org-roam-capture--target-truepath("${slug}.org")
  org-roam-capture--setup-target-location()
  org-roam-capture--prepare-buffer()
  org-capture-set-target-location(nil)
  org-capture(nil "d")
  org-roam-capture-(:node #s(org-roam-node :file nil :file-title nil :file-hash nil :file-atime nil :file-mtime nil :id "945439d8-272b-461b-b0e2-62763ee8351b" :level nil :point nil :todo nil :priority nil :scheduled nil :deadline "Beltrami flow and neural diffusion on graphs" :title nil :properties nil :olp nil :tags nil :aliases nil :refs 
  orb--new-note("chamberlain2021beltrami")
  orb-edit-note("chamberlain2021beltrami")
  orb-bibtex-completion-edit-note(("chamberlain2021beltrami"))
  bibtex-completion-edit-notes(("chamberlain2021beltrami"))
  org-ref-open-notes-at-point()
  funcall-interactively(org-ref-open-notes-at-point)
  call-interactively(org-ref-open-notes-at-point)
  hydra--call-interactively-remap-maybe(org-ref-open-notes-at-point)
  org-ref-citation-hydra/org-ref-open-notes-at-point-and-exit()
  funcall-interactively(org-ref-citation-hydra/org-ref-open-notes-at-point-and-exit)
  call-interactively(org-ref-citation-hydra/org-ref-open-notes-at-point-and-exit nil nil)
  command-execute(org-ref-citation-hydra/org-ref-open-notes-at-point-and-exit)

ORB configuration

  1. How the package is loaded.
    (use-package org-roam-bibtex
    :ensure t
    :config
    (org-roam-bibtex-mode 1))
  2. ORB options set to non-default values (e.g. orb-templates) Everything is set to default.

Environment (please complete the following information):

I would appreciate any help in case this isn't related to org-roam-bibtex.

myshevchuk commented 2 years ago

Hi,

I cannot reproduce this. Since it has started happening after an upgrade and you see a bunch of compiled functions in the backtrace, the cause may be corrupted byte-compiled files. Try reinstalling ORB, Org-roam, and Org. How exactly you do this depends on your Emacs package manager.

MCSH commented 2 years ago

I can't believe I didn't try this, that actually worked, I only reinstalled orb as that's where the compiled functions were created and it worked. Thank you.

myshevchuk commented 2 years ago

It's great it worked! I haven't looked into ORB for a while and thought maybe there had been incompatible changes in Org-roam recently.