Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using doi-utils-add-bibtex-entry-from-doi via doi-link-menu fails #388

Closed
herbstk opened this issue Feb 22, 2017 · 4 comments
Closed

Using doi-utils-add-bibtex-entry-from-doi via doi-link-menu fails #388

herbstk opened this issue Feb 22, 2017 · 4 comments

Comments

@herbstk
Copy link

herbstk commented Feb 22, 2017

Using doi-utils-add-bibtex-entry-from-doi via doi-link-menu fails with "Wrong number of arguments" as the further expects DOI and BIBFILE if called noninteractively but the latter only supplies the DOI. I think this is also the reason for #358. Maybe one could make BIBFILE optional and in case its nil it should ask the user.

jkitchin added a commit that referenced this issue Feb 22, 2017
doi-utils-add-bibtex-entry-from-doi can be called from a doi link menu, but it
was failing because only the doi was provided, and it required a bibfile.

Fixes issue #388
@jkitchin
Copy link
Owner

Thanks for the suggestion. I pushed the fix you suggested.

@herbstk
Copy link
Author

herbstk commented Feb 22, 2017

Thank you for your quick fix, I tried and it worked for me well. Might be a matter of taste but I found it to be an additional improvement to add the result(s) of org-ref-find-bibliography to the suggesed list:

(unless bibfile
    (setq bibfile (completing-read
                  "Bibfile: "
                  (append (org-ref-find-bibliography)
                                 (f-entries "." (lambda (f)
                                           (and (not (string-match "#" f))
                                                (f-ext? f "bib"))))
                          org-ref-default-bibliography))))

For example in my case I have the bib-file in a subdirectory with respect to an org-file. It is referenced in the org-file using a 'bibliography:'-link. By using the above code it pops up as well.

jkitchin added a commit that referenced this issue Feb 23, 2017
In response to issue #388. The previous version would not list bib-files that
were in sub-directories or other places than the current directory. This change
improves that.
@jkitchin
Copy link
Owner

Thanks for the suggestion. I have added something like this.

@herbstk
Copy link
Author

herbstk commented Feb 23, 2017

Cool, thank you very much.

@herbstk herbstk closed this as completed Feb 23, 2017
herbstk added a commit to herbstk/org-ref that referenced this issue Apr 15, 2017
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

No branches or pull requests

2 participants