bibtex-find-key-from-file function #382
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The initial idea is from #381. Their docstrings are quite extensive.
I've written four functions and one variable,
the function
find-key-from-file
delegates finding key to every function in the new variablefind-key-functions
each takes one argument called FILENAME.The
find-key-functions
includesfind-key-from-note
, a function that returns a list of key associated with FILENAME andbibtex-completion-notes-path
depending on its value.find-key-from-pdf
, thats use another new functionget-entry-with-string
(See description in [Feature request/Question] A reverse bibtex-completion-find-pdf function? #381. TLDR; list every entry with STRING in its fields.) to return a list of entries with FILENAME in its fields then extract the"=key="
field from each entry in the list or just return the BibTex part of FILENAME in a list.