Closed quarkquartet closed 3 years ago
Hi, please read the manual and adjust your configuration accordingly. In particular, pay attention to the new format of org-roam-capture-templates
, which was introduced in Org-roam v2. Notice also that v0.6 branch has just been merged into master and you can use this default branch from now on.
Hi, please read the manual and adjust your configuration accordingly. In particular, pay attention to the new format of
org-roam-capture-templates
, which was introduced in Org-roam v2. Notice also that v0.6 branch has just been merged into master and you can use this default branch from now on.
Thank you for your guidance.
Actually, if I delete the configuration for template (i.e. use the default value), the problem still exists. Is this due to some change of the source code?
Hi, please read the manual and adjust your configuration accordingly. In particular, pay attention to the new format of
org-roam-capture-templates
, which was introduced in Org-roam v2. Notice also that v0.6 branch has just been merged into master and you can use this default branch from now on.
I tried the configuration in the updated manual. But the problem is the same. Now my config is:
(setq bibliography-path "~/org/literature/library.bib")
(setq pdf-path "~/Dropbox/Zotero\ Papers")
(setq bibliography-notes "~/org/literature/")
(use-package! org-ref
:after org
:config
(setq
org-ref-completion-library 'org-ref-ivy-cite
org-ref-get-pdf-filename-function 'org-ref-get-pdf-filename-helm-bibtex
org-ref-default-bibliography (list "~/org/literature/library.bib")
org-ref-notes-directory bibliography-notes
org-ref-notes-function 'orb-edit-notes
)
)
(after! org-ref
:commands
(org-ref-ivy-cite-completion)
:config
(setq
bibtex-completion-notes-path bibliography-notes
bibtex-completion-bibliography bibliography-path
bibtex-completion-pdf-field "file"
)
)
(after! org-roam
(org-roam-bibtex-mode))
(use-package! org-roam-bibtex
:after org-roam
:config
(require 'org-ref)
(require 'ivy-bibtex)
(setq orb-insert-interface 'ivy-bibtex)
(setq orb-note-actions-interface 'ivy)
(setq orb-preformat-keywords '("citekey" "author" "date"))
(setq org-roam-capture-templates
'(("r" "bibliography reference" plain
"%?
%^{author} published %^{entry-type} in %^{date}: fullcite:%\\1."
:if-new
(file+head "references/${citekey}.org" "#+title: ${title}\n")
:unnarrowed t)))
)
Ok, it seems that orb-insert-edit-note
was expecting only a string data type and throwing the error when it was fed with a list from Bibtex-completion. Not sure how and when this was introduced and why it escaped my attention, but now it's fixed. Thank you for reporting this bug!
By the way, it is not necessary to set org-ref-notes-functions
- ORB does this automatically when org-roam-bibtex-mode
is on. If you with tp set it manually, you should use orb-org-ref-edit-note
- it also does arrange for a few other things required by Org-ref.
Ok, it seems that
orb-insert-edit-note
was expecting only a string data type and throwing the error when it was fed with a list from Bibtex-completion. Not sure how and when this was introduced and why it escaped my attention, but now it's fixed. Thank you for reporting this bug!By the way, it is not necessary to set
org-ref-notes-functions
- ORB does this automatically whenorg-roam-bibtex-mode
is on. If you with tp set it manually, you should useorb-org-ref-edit-note
- it also does arrange for a few other things required by Org-ref.
OK. Thanks for the update.
But now there is a strange behaviour. I run orb-insert-link
, press enter on one of the entry, it gives me this error:
user-error: Invalid capture template format: (r bibliography reference plain :if-new (file+head ~/org/literature/Bhattiprolu:2021rrj.org #+TITLE: High-quality axions in solutions to the $\mu$ problem ) :unnarrowed t) key :region cannot be nil
the Bhattiprolu:2021rrj
is the citekey, the High-quality axions in solutions to the $\mu$ problem
is the title.
My current configuration :
(setq bibliography-path "~/org/literature/library.bib")
(setq pdf-path "~/Dropbox/Zotero\ Papers")
(setq bibliography-notes "~/org/literature/")
(use-package! org-ref
:after org
:config
(setq
org-ref-completion-library 'org-ref-ivy-cite
org-ref-get-pdf-filename-function 'org-ref-get-pdf-filename-helm-bibtex
org-ref-default-bibliography (list "~/org/literature/library.bib")
org-ref-notes-directory bibliography-notes
org-ref-notes-function 'orb-org-ref-edit-note )
)
(after! org-ref
:commands
(org-ref-ivy-cite-completion)
:config
(setq
bibtex-completion-notes-path bibliography-notes
bibtex-completion-bibliography bibliography-path
bibtex-completion-pdf-field "file"
)
)
(after! org-roam
(org-roam-bibtex-mode))
(use-package! org-roam-bibtex
:after org-roam
:config
(require 'org-ref)
(require 'ivy-bibtex)
(setq orb-insert-interface 'ivy-bibtex)
(setq orb-note-actions-interface 'ivy)
(setq orb-preformat-keywords '("citekey" "author" "title" "url" "year"))
(setq org-roam-capture-templates
'(("r" "bibliography reference" plain
"%?"
:if-new
(file+head "~/org/literature/${citekey}.org" "#+TITLE: ${title}\n")
:unnarrowed t)))
)
Further more, if I use orb-insert-link
then C-o
, select "insert citation", or directly use org-ref-insert-cite-link
, I can get a link. Click on the link and select the open notes
, I successfully get the note capture interface with correct template. So I guess this error is from some function of orb-insert-link
.
me too.
user-error: Invalid capture template format: (r bibliography reference plain %? :if-new (file+head references/yuki2020covid.org #+TITLE: Covid-19 pathophysiology: a review) :unnarrowed t)
Hi! I'm having the same issue
I have the citation cite:MinisteriodeSaludLSSS0122021
. If I press enter I get this error
Debugger entered--Lisp error: (wrong-type-argument stringp nil)
insert-file-contents(nil)
(progn (insert-file-contents bibfile) (bibtex-set-dialect (parsebib-find-bibtex-dialect) t) (bibtex-search-entry key) (bibtex-autokey-get-field "url"))
(unwind-protect (progn (insert-file-contents bibfile) (bibtex-set-dialect (parsebib-find-bibtex-dialect) t) (bibtex-search-entry key) (bibtex-autokey-get-field "url")) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))
(save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (insert-file-contents bibfile) (bibtex-set-dialect (parsebib-find-bibtex-dialect) t) (bibtex-search-entry key) (bibtex-autokey-get-field "url")) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))
(let ((temp-buffer (generate-new-buffer " *temp*" t))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (insert-file-contents bibfile) (bibtex-set-dialect (parsebib-find-bibtex-dialect) t) (bibtex-search-entry key) (bibtex-autokey-get-field "url")) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))))
(save-excursion (let ((temp-buffer (generate-new-buffer " *temp*" t))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (insert-file-contents bibfile) (bibtex-set-dialect (parsebib-find-bibtex-dialect) t) (bibtex-search-entry key) (bibtex-autokey-get-field "url")) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))))
(let* ((results (org-ref-get-bibtex-key-and-file)) (key (car results)) (bibfile (or (cdr results) (car bibtex-completion-bibliography))) (bibtex-completion-bibliography (list bibfile)) (entry (bibtex-completion-get-entry key)) (pdf-file (funcall org-ref-get-pdf-filename-function key)) (pdf-bibtex-completion (car (bibtex-completion-find-pdf key))) (notes-p (cdr (assoc "=has-note=" entry))) (url (save-excursion (let (...) (save-current-buffer ... ...)))) (doi (save-excursion (let (...) (save-current-buffer ... ...)))) (candidates '(("Quit" . org-ref-citation-at-point) ("Open bibtex entry" . org-ref-open-citation-at-point)))) (if (string= doi "") (progn (setq doi nil))) (if (string= url "") (progn (setq url nil))) (cond ((file-exists-p pdf-file) (if (memql '... candidates) (with-no-warnings candidates) (setq candidates (cons ... candidates)))) (pdf-bibtex-completion (if (memql '... candidates) (with-no-warnings candidates) (setq candidates (cons ... candidates)))) (t (if (memql '... candidates) (with-no-warnings candidates) (setq candidates (cons ... candidates))))) (if notes-p (if (memql '("Open notes" . org-ref-open-notes-at-point) candidates) (with-no-warnings candidates) (setq candidates (cons '... candidates))) (if (memql '("Add notes" . org-ref-open-notes-at-point) candidates) (with-no-warnings candidates) (setq candidates (cons '... candidates)))) (if (or url doi) (progn (if (memql '... candidates) (with-no-warnings candidates) (setq candidates (cons ... candidates))))) (if doi (progn (mapc #'(lambda ... ...) '(... ... ... ... ... ...)))) (if (memql '("Insert new citation" lambda nil (org-ref-helm-insert-cite-link nil)) candidates) (with-no-warnings candidates) (setq candidates (cons '("Insert new citation" lambda nil ...) candidates))) (if (memql '("Delete key at point" . org-ref-delete-key-at-point) candidates) (with-no-warnings candidates) (setq candidates (cons '("Delete key at point" . org-ref-delete-key-at-point) candidates))) (if (memql '("Replace key at point" . org-ref-replace-key-at-point) candidates) (with-no-warnings candidates) (setq candidates (cons '("Replace key at point" . org-ref-replace-key-at-point) candidates))) (if (memql '("Delete citation at point" . org-ref-delete-cite-at-point) candidates) (with-no-warnings candidates) (setq candidates (cons '("Delete citation at point" . org-ref-delete-cite-at-point) candidates))) (if bibtex-completion-cite-prompt-for-optional-arguments (progn (if (memql '... candidates) (with-no-warnings candidates) (setq candidates (cons ... candidates))))) (if (memql '("Sort keys by year" . org-ref-sort-citation-link) candidates) (with-no-warnings candidates) (setq candidates (cons '("Sort keys by year" . org-ref-sort-citation-link) candidates))) (if (memql '("Copy formatted citation to clipboard" . org-ref-copy-cite-as-summary) candidates) (with-no-warnings candidates) (setq candidates (cons '("Copy formatted citation to clipboard" . org-ref-copy-cite-as-summary) candidates))) (if (memql '("Copy key to clipboard" lambda nil (kill-new ...)) candidates) (with-no-warnings candidates) (setq candidates (cons '("Copy key to clipboard" lambda nil ...) candidates))) (if (memql '("Copy bibtex entry to file" . org-ref-copy-entry-at-point-to-file) candidates) (with-no-warnings candidates) (setq candidates (cons '("Copy bibtex entry to file" . org-ref-copy-entry-at-point-to-file) candidates))) (if (memql '("Email bibtex entry and pdf" lambda nil (save-excursion ... ...)) candidates) (with-no-warnings candidates) (setq candidates (cons '("Email bibtex entry and pdf" lambda nil ...) candidates))) (if (and (boundp '*scopus-api-key*) *scopus-api-key*) (progn (if (memql '... candidates) (with-no-warnings candidates) (setq candidates (cons ... candidates))) (if (memql '... candidates) (with-no-warnings candidates) (setq candidates (cons ... candidates))) (if (memql '... candidates) (with-no-warnings candidates) (setq candidates (cons ... candidates))) (if (memql '... candidates) (with-no-warnings candidates) (setq candidates (cons ... candidates))) (if (memql '... candidates) (with-no-warnings candidates) (setq candidates (cons ... candidates))))) (let* ((i 0) (--cl-var-- (reverse candidates)) (cell nil) (--cl-var-- nil)) (while (consp --cl-var--) (setq cell (car --cl-var--)) (setq --cl-var-- (cons (cons ... ...) --cl-var--)) (setq i (+ i 1)) (setq --cl-var-- (cdr --cl-var--))) (nreverse --cl-var--)))
org-ref-cite-candidates()
(let ((name (org-ref-format-entry (org-ref-get-bibtex-key-under-cursor))) (candidates (org-ref-cite-candidates)) (cb (current-buffer))) (helm :sources (list (list (cons 'name name) (cons 'candidates candidates) (cons 'action (cons 'lambda (cons '... (cons ... ...))))) (list '(name . "User functions") (cons 'candidates org-ref-helm-user-candidates) (cons 'action (cons 'lambda (cons '... (cons ... ...))))))))
org-ref-cite-click-helm(nil)
funcall(org-ref-cite-click-helm nil)
(lambda (_) (funcall org-ref-cite-onclick-function nil))("MinisteriodeSaludLSSS0122021")
org-link-open((link (:type "cite" :path "MinisteriodeSaludLSSS0122021" :format plain :raw-link "cite:MinisteriodeSaludLSSS0122021" :application nil :search-option nil :begin 8221 :end 8254 :contents-begin nil :contents-end nil :post-blank 0 :parent (paragraph (:begin 7336 :end 8515 :contents-begin 7336 :contents-end 8512 :post-blank 3 :post-affiliated 7336 :parent nil)))) nil)
org-open-at-point(nil)
(if (or (equal (org-element-property :type lineage) "img") (and path (image-type-from-file-name path))) (+org--toggle-inline-images-in-subtree (org-element-property :begin lineage) (org-element-property :end lineage)) (org-open-at-point arg))
(let* ((lineage (org-element-lineage context '(link) t)) (path (org-element-property :path lineage))) (if (or (equal (org-element-property :type lineage) "img") (and path (image-type-from-file-name path))) (+org--toggle-inline-images-in-subtree (org-element-property :begin lineage) (org-element-property :end lineage)) (org-open-at-point arg)))
(let nil (let* ((lineage (org-element-lineage context '(link) t)) (path (org-element-property :path lineage))) (if (or (equal (org-element-property :type lineage) "img") (and path (image-type-from-file-name path))) (+org--toggle-inline-images-in-subtree (org-element-property :begin lineage) (org-element-property :end lineage)) (org-open-at-point arg))))
(cond ((eq type 'headline) (let nil (cond ((memq (and (boundp ...) org-goto-map) (current-active-maps)) (org-goto-ret)) ((and (fboundp 'toc-org-insert-toc) (member "TOC" (org-get-tags))) (toc-org-insert-toc) (message "Updating table of contents")) ((string= "ARCHIVE" (car-safe (org-get-tags))) (org-force-cycle-archived)) ((or (org-element-property :todo-type context) (org-element-property :scheduled context)) (org-todo (if (eq ... ...) (or ... ...) 'done)))) (org-update-checkbox-count) (org-update-parent-todo-statistics) (if (and (fboundp 'toc-org-insert-toc) (member "TOC" (org-get-tags))) (progn (toc-org-insert-toc) (message "Updating table of contents"))) (let* ((beg (if (org-before-first-heading-p) (line-beginning-position) (save-excursion ... ...))) (end (if (org-before-first-heading-p) (line-end-position) (save-excursion ... ...))) (overlays (condition-case nil (progn ...) (error nil))) (latex-overlays (cl-find-if #'... overlays)) (image-overlays (cl-find-if #'... overlays))) (+org--toggle-inline-images-in-subtree beg end) (if (or image-overlays latex-overlays) (org-clear-latex-preview beg end) (org--latex-preview-region beg end))))) ((eq type 'clock) (let nil (org-clock-update-time-maybe))) ((eq type 'footnote-reference) (let nil (org-footnote-goto-definition (org-element-property :label context)))) ((eq type 'footnote-definition) (let nil (org-footnote-goto-previous-reference (org-element-property :label context)))) ((memq type '(timestamp planning)) (let nil (org-follow-timestamp-link))) ((memq type '(table-row table)) (let nil (if (org-at-TBLFM-p) (org-table-calc-current-TBLFM) (condition-case nil (progn (save-excursion (goto-char ...) (org-call-with-arg ... ...))) (error nil))))) ((eq type 'table-cell) (let nil (org-table-blank-field) (org-table-recalculate arg) (if (and (string-empty-p (string-trim (org-table-get-field))) (and (boundp 'evil-local-mode) evil-local-mode)) (progn (evil-change-state 'insert))))) ((eq type 'babel-call) (let nil (org-babel-lob-execute-maybe))) ((eq type 'statistics-cookie) (let nil (save-excursion (org-update-statistics-cookies arg)))) ((memq type '(inline-src-block src-block)) (let nil (org-babel-execute-src-block arg))) ((memq type '(latex-environment latex-fragment)) (let nil (org-latex-preview arg))) ((eq type 'link) (let nil (let* ((lineage (org-element-lineage context '... t)) (path (org-element-property :path lineage))) (if (or (equal (org-element-property :type lineage) "img") (and path (image-type-from-file-name path))) (+org--toggle-inline-images-in-subtree (org-element-property :begin lineage) (org-element-property :end lineage)) (org-open-at-point arg))))) ((org-element-property :checkbox (org-element-lineage context '(item) t)) (let nil (let ((match (and (org-at-item-checkbox-p) (match-string 1)))) (org-toggle-checkbox (if (equal match "[ ]") '(16)))))) (t (let nil (if (or (org-in-regexp org-ts-regexp-both nil t) (org-in-regexp org-tsr-regexp-both nil t) (org-in-regexp org-link-any-re nil t)) (call-interactively #'org-open-at-point) (+org--toggle-inline-images-in-subtree (org-element-property :begin context) (org-element-property :end context))))))
(let* ((context (org-element-context)) (type (org-element-type context))) (while (and context (memq type '(verbatim code bold italic underline strike-through subscript superscript))) (setq context (org-element-property :parent context) type (org-element-type context))) (cond ((eq type 'headline) (let nil (cond ((memq (and ... org-goto-map) (current-active-maps)) (org-goto-ret)) ((and (fboundp ...) (member "TOC" ...)) (toc-org-insert-toc) (message "Updating table of contents")) ((string= "ARCHIVE" (car-safe ...)) (org-force-cycle-archived)) ((or (org-element-property :todo-type context) (org-element-property :scheduled context)) (org-todo (if ... ... ...)))) (org-update-checkbox-count) (org-update-parent-todo-statistics) (if (and (fboundp 'toc-org-insert-toc) (member "TOC" (org-get-tags))) (progn (toc-org-insert-toc) (message "Updating table of contents"))) (let* ((beg (if ... ... ...)) (end (if ... ... ...)) (overlays (condition-case nil ... ...)) (latex-overlays (cl-find-if ... overlays)) (image-overlays (cl-find-if ... overlays))) (+org--toggle-inline-images-in-subtree beg end) (if (or image-overlays latex-overlays) (org-clear-latex-preview beg end) (org--latex-preview-region beg end))))) ((eq type 'clock) (let nil (org-clock-update-time-maybe))) ((eq type 'footnote-reference) (let nil (org-footnote-goto-definition (org-element-property :label context)))) ((eq type 'footnote-definition) (let nil (org-footnote-goto-previous-reference (org-element-property :label context)))) ((memq type '(timestamp planning)) (let nil (org-follow-timestamp-link))) ((memq type '(table-row table)) (let nil (if (org-at-TBLFM-p) (org-table-calc-current-TBLFM) (condition-case nil (progn (save-excursion ... ...)) (error nil))))) ((eq type 'table-cell) (let nil (org-table-blank-field) (org-table-recalculate arg) (if (and (string-empty-p (string-trim ...)) (and (boundp ...) evil-local-mode)) (progn (evil-change-state 'insert))))) ((eq type 'babel-call) (let nil (org-babel-lob-execute-maybe))) ((eq type 'statistics-cookie) (let nil (save-excursion (org-update-statistics-cookies arg)))) ((memq type '(inline-src-block src-block)) (let nil (org-babel-execute-src-block arg))) ((memq type '(latex-environment latex-fragment)) (let nil (org-latex-preview arg))) ((eq type 'link) (let nil (let* ((lineage (org-element-lineage context ... t)) (path (org-element-property :path lineage))) (if (or (equal ... "img") (and path ...)) (+org--toggle-inline-images-in-subtree (org-element-property :begin lineage) (org-element-property :end lineage)) (org-open-at-point arg))))) ((org-element-property :checkbox (org-element-lineage context '(item) t)) (let nil (let ((match (and ... ...))) (org-toggle-checkbox (if (equal match "[ ]") '...))))) (t (let nil (if (or (org-in-regexp org-ts-regexp-both nil t) (org-in-regexp org-tsr-regexp-both nil t) (org-in-regexp org-link-any-re nil t)) (call-interactively #'org-open-at-point) (+org--toggle-inline-images-in-subtree (org-element-property :begin context) (org-element-property :end context)))))))
(if (button-at (point)) (call-interactively #'push-button) (let* ((context (org-element-context)) (type (org-element-type context))) (while (and context (memq type '(verbatim code bold italic underline strike-through subscript superscript))) (setq context (org-element-property :parent context) type (org-element-type context))) (cond ((eq type 'headline) (let nil (cond ((memq ... ...) (org-goto-ret)) ((and ... ...) (toc-org-insert-toc) (message "Updating table of contents")) ((string= "ARCHIVE" ...) (org-force-cycle-archived)) ((or ... ...) (org-todo ...))) (org-update-checkbox-count) (org-update-parent-todo-statistics) (if (and (fboundp ...) (member "TOC" ...)) (progn (toc-org-insert-toc) (message "Updating table of contents"))) (let* ((beg ...) (end ...) (overlays ...) (latex-overlays ...) (image-overlays ...)) (+org--toggle-inline-images-in-subtree beg end) (if (or image-overlays latex-overlays) (org-clear-latex-preview beg end) (org--latex-preview-region beg end))))) ((eq type 'clock) (let nil (org-clock-update-time-maybe))) ((eq type 'footnote-reference) (let nil (org-footnote-goto-definition (org-element-property :label context)))) ((eq type 'footnote-definition) (let nil (org-footnote-goto-previous-reference (org-element-property :label context)))) ((memq type '(timestamp planning)) (let nil (org-follow-timestamp-link))) ((memq type '(table-row table)) (let nil (if (org-at-TBLFM-p) (org-table-calc-current-TBLFM) (condition-case nil (progn ...) (error nil))))) ((eq type 'table-cell) (let nil (org-table-blank-field) (org-table-recalculate arg) (if (and (string-empty-p ...) (and ... evil-local-mode)) (progn (evil-change-state ...))))) ((eq type 'babel-call) (let nil (org-babel-lob-execute-maybe))) ((eq type 'statistics-cookie) (let nil (save-excursion (org-update-statistics-cookies arg)))) ((memq type '(inline-src-block src-block)) (let nil (org-babel-execute-src-block arg))) ((memq type '(latex-environment latex-fragment)) (let nil (org-latex-preview arg))) ((eq type 'link) (let nil (let* ((lineage ...) (path ...)) (if (or ... ...) (+org--toggle-inline-images-in-subtree ... ...) (org-open-at-point arg))))) ((org-element-property :checkbox (org-element-lineage context '(item) t)) (let nil (let ((match ...)) (org-toggle-checkbox (if ... ...))))) (t (let nil (if (or (org-in-regexp org-ts-regexp-both nil t) (org-in-regexp org-tsr-regexp-both nil t) (org-in-regexp org-link-any-re nil t)) (call-interactively #'org-open-at-point) (+org--toggle-inline-images-in-subtree (org-element-property :begin context) (org-element-property :end context))))))))
+org/dwim-at-point(nil)
funcall-interactively(+org/dwim-at-point nil)
command-execute(+org/dwim-at-point)
Hi! I believe you must set org-ref-default-bibliography
in order to be able to activate Org-ref cite:links
. It must be a list of file names as strings. It's not related to ORB, it's an Org-ref thing. ORB uses bibtex-completion-bibliography
, but Org-ref has its own variable.
Thanks @myshevchuk. I will try it as you says.
Describe the bug I update my orb package to the branch 0.6.0 which supports org-roam-v2 in doom emacs. I found the original function
orb-insert
disappears. I useorb-insert-link
, then select an entry whose citekey is "Quiros:1999jp". Then I get error:concat: Wrong type argument: stringp, ("Quiros:1999jp")
I can still insert a citation link via
org-ref-insert-cite-link
. However, when I click on the link and try to open notes, another error appears:user-error: Could not retrieve the citekey. Check ROAM_REFS property of current node
To Reproduce Steps to reproduce the behavior: I'm using doom emacs. Installation and comfiguration code are in the following section. Run 'doom sync', restart emacs, then try the functions.
Expected behavior Of course, I hope this version of orb can behave like what we expected before.
ORB configuration
orb-templates
)"