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

Goto new entry when importing by doi #232

Open
Hugo-Heagren opened this issue Dec 11, 2021 · 3 comments
Open

Goto new entry when importing by doi #232

Hugo-Heagren opened this issue Dec 11, 2021 · 3 comments

Comments

@Hugo-Heagren
Copy link
Contributor

When I import by doi, the selected entry remains the same. For me its pretty intuitive that I would always want to select the new entry (and indeed, always do immediatley jump to it). Could this be part of the default behaviour of ebib-biblio-import-doi? This seems simple, so I would have just submitted a PR, but I've just tried knocking up a simple way of making it happen and found it really hard!

@joostkremers
Copy link
Owner

You can simply use ebib--goto-entry-in-index followed by ebib--update-entry-buffer. See, e.g., ebib-jump-to-entry, where this is done. (In the DOI case, you won't need to account for the possibility that you need to switch to another database, as ebib-jump-to-entry does.)

BTW, I just rewrote ebib--goto-entry-in-index using text-property-search-forward, because I suspect it's more efficient than what I did before. (Though I haven't timed it and thinking about it a bit more, it may not actually be... But it may not really matter, because even on my lowly quad-core Pentium, jumping is still instantaneous.)

Anyway, using ebib--goto-entry-in-index is the way to go.

@gkowzan
Copy link

gkowzan commented Jan 21, 2022

I also didn't see a way to do that by making changes localized to ebib-biblio-import-doi, so I also modified ebib-import-entries and ebib--bib-find-bibtex-entries to return the list of added entry keys. #241

@gkowzan
Copy link

gkowzan commented Jan 21, 2022

I rewrote the previous pull request to use biblio-doi-forward-bibtex with a callback function. The previous version sometimes failed to work with asynchronous url retrieval.

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

3 participants