Skip to content

Conversation

@rasendubi
Copy link

When creating a non-bibtex note, it throws with the following error:

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  string-match("[\\\"]\\| " nil)
  #f(compiled-function (str) #<bytecode 0x334e725>)(nil)
  mapconcat(#f(compiled-function (str) #<bytecode 0x334e725>) (nil) " ")
  combine-and-quote-strings((nil))
  org-roam-add-property(nil "ROAM_REFS")
  (save-excursion (org-roam-add-property orb--current-citekey "ROAM_REFS"))
  orb--add-ref()
  run-hooks(org-roam-capture-new-node-hook)
  org-roam-capture--goto-location()
  org-roam-capture--get-point()
  org-capture-set-target-location(nil)
  org-capture(nil nil)
  org-roam-capture-(:node #s(org-roam-node :file nil :file-hash nil :file-atime nil :file-mtime nil :id nil :level nil :point nil :todo nil :priority nil :scheduled nil :deadline nil :title "hello" :properties nil :olp nil :tags nil :aliases nil :refs nil) :props (:finalize find-file :call-location #<marker at 129689 in README.org>))
  org-roam-node-find()
  funcall-interactively(org-roam-node-find)
  call-interactively(org-roam-node-find nil nil)
  command-execute(org-roam-node-find)

This happens because orb--current-citekey is nil but orb still tries
to set it to ROAM_REFS.

Add a conditional check, so orb does not interfere with non-bibtex
notes.

myshevchuk and others added 16 commits April 9, 2021 22:07
partially works for Org Roam commit 28580d7 in my private fork
renamed symbols:

orb-edit-notes -> orb-edit-note
orb-notes-fn -> orb-org-ref-edit-note
orb-edit-notes-ad -> orb-edit-notes

orb--edit-notes -> orb--new-note
orb--preformat-template -> orb--pre-expand-template
- orb-get-node-citekey
- update orb-manual.org
- use progress-reporter in orb--with-message! (not related to ORv2)
also get rid of the clumsy hook system
update Package-Version to 0.6
- update many docstrings
- update REAMDE and manual
- remove leftover functions and variables from v0.5
- remove deprecated functions and variables
- remove instructions to add `org-roam-bibtex-mode` to
`org-roam-mode-hook` from README
- add autoload tokens to `orb-org-ref-edit-note` and `orb-edit-notes`
Since template is only pre-selected in `orb--new-note`, not by proper
`org-capture`, pressing `q` does not return a proper template list, and
this case must be handled individually.
There seem to be issues on Emacs 27.1 with stock Org 9.3, see org-roam#188.
call `orb-make-notes-cache` in orb-edit-note, orb-insert-link and
org-roam-bibtex-mode

remove `orb-bibtex-completion-parse-bibliography-ad`
Provide `orb--add-ref` hook function for
`org-roam-capture-new-node-hook` to add the citation key to ROAM_REFS in
a newly created note.

The behaviour of `org-roam-node-at-point` has changed in 409a147
breaking the previous way citation keys were added to ROAM_REFS, see org-roam#193.

Should the upstream changes be reverted, this may be reverted as well.
When creating a non-bibtex note, it throws with the following error:

```
Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  string-match("[\\\"]\\| " nil)
  #f(compiled-function (str) #<bytecode 0x334e725>)(nil)
  mapconcat(#f(compiled-function (str) #<bytecode 0x334e725>) (nil) " ")
  combine-and-quote-strings((nil))
  org-roam-add-property(nil "ROAM_REFS")
  (save-excursion (org-roam-add-property orb--current-citekey "ROAM_REFS"))
  orb--add-ref()
  run-hooks(org-roam-capture-new-node-hook)
  org-roam-capture--goto-location()
  org-roam-capture--get-point()
  org-capture-set-target-location(nil)
  org-capture(nil nil)
  org-roam-capture-(:node #s(org-roam-node :file nil :file-hash nil :file-atime nil :file-mtime nil :id nil :level nil :point nil :todo nil :priority nil :scheduled nil :deadline nil :title "hello" :properties nil :olp nil :tags nil :aliases nil :refs nil) :props (:finalize find-file :call-location #<marker at 129689 in README.org>))
  org-roam-node-find()
  funcall-interactively(org-roam-node-find)
  call-interactively(org-roam-node-find nil nil)
  command-execute(org-roam-node-find)
```

This happens because orb--current-citekey is nil but orb still tries
to set it to ROAM_REFS.

Add a conditional check, so orb does not interfere with non-bibtex
notes.
@rasendubi
Copy link
Author

See also: #193 (comment) — another possible fix is reverting c7f7cb0

@myshevchuk
Copy link
Member

Thank you, see #193.

@myshevchuk myshevchuk closed this Jul 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants