jkitchin / org-ref

org-mode modules for citations, cross-references, bibliographies in org-mode and useful bibtex tools to go with it.
GNU General Public License v3.0
1.36k stars 243 forks source link

error with doi-tils related functions #1119

Open wxding84 opened 2 months ago

wxding84 commented 2 months ago

everytime I run functions like doi-utils-add-bibtex-entry-from-doi , i get the following message "bibtex-clean-entry: Wrong type argument: listp, bibtex-completion-bibliography" I've been on this configuration file for quite a while which works just fine previously. the issue seems to be caused by a recent update? I could not figure out where it stems from. The bibtex-clean-entry function seems ok.

many thanks.

jkitchin commented 2 months ago

bibtex-completion-bibliography can be a string (which I guess your's is set to) or a list. org-ref tries to support both possibilities, but I guess there is a function somewhere that assumes it is a list and yours is not.

I wasn't able to reproduce this error by setting my variable to a string though.

It is a little weird it comes from bibtex-clean-entry. That is a built in function to emacs, and not part of bibtex-completion at all.

one option is to hunt that down so we can fix it. You could edebug doi-utils-add-bibtex-entry-from-doi and step through it to see where that error happens.

Another is to make bibtex-completion-bibliography a list in your init file, even if it only has one file in it.

wxding84 commented 2 months ago

Thanks for looking into it. I thought it was a org-ref issue, but now I see it is a bibtex.el issue. sorry about that. The org-ref doi functions work fine.

The weird thing is that I am setting bibtex-completion-bibliography as a list. This is affecting almost all doi-related bibtex functions. The functions are still usable, but return such strange error in Message. I tried to read the code of bibtex-clean-entry, but could not see anywhere it tries to check bibtex-completion-bibliography.

bibtex-completion-bibliography can be a string (which I guess your's is set to) or a list. org-ref tries to support both possibilities, but I guess there is a function somewhere that assumes it is a list and yours is not.

I wasn't able to reproduce this error by setting my variable to a string though.

It is a little weird it comes from bibtex-clean-entry. That is a built in function to emacs, and not part of bibtex-completion at all.

one option is to hunt that down so we can fix it. You could edebug doi-utils-add-bibtex-entry-from-doi and step through it to see where that error happens.

Another is to make bibtex-completion-bibliography a list in your init file, even if it only has one file in it.

jkitchin commented 2 months ago

It is weird, bibtex-clean-entry does not check bibtex-completion-bibliography.