helm-bibtex
helm-bibtex copied to clipboard
enable evaluation of date field if year is not defined
Without this addition to the if clause, in cases where the year
field is missing, the line where date
substitutes year
will never be evaluated. This means that the year is missing when inserting the reference into an org-file, but also in org-roam-ui, for example (e.g. "Author (). Title").
I don't understand what problem this PR is trying to fix. This function seems to work as intended. If value
is nil
the second pcase
on line 1224 is evaluated. Just tried it with this entry
@Article{test,
author = {Chater, Nick and Oaksford, Mike},
title = {Ten years of the rational analysis of cognition},
journal = {Trends in Cognitive Sciences},
Date = {1998-6-15},
volume = 3,
number = 2,
pages = {57–65},
issn = {1364-6613},
doi = {10.1016/s1364-6613(98)01273-x},
publisher = {Elsevier BV},
}
and this code
(let ((entry (car (bibtex-completion-candidates))))
(bibtex-completion-apa-get-value "year" entry))
This returns 1998, as expected.
Note that this is not the repository of org-roam. Perhaps you're running into a bug there.