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

enable evaluation of date field if year is not defined #442

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dominikpegler
Copy link

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").

@tmalsburg
Copy link
Owner

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.

@tmalsburg
Copy link
Owner

Note that this is not the repository of org-roam. Perhaps you're running into a bug there.

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

Successfully merging this pull request may close these issues.

2 participants