helm-bibtex icon indicating copy to clipboard operation
helm-bibtex copied to clipboard

Make sure bibtex-completion-apa-get-value returns "" when a field is not defined.

Open tmalsburg opened this issue 4 years ago • 0 comments

I'd like to refresh this discussion. I have the problem that I cannot add notes to reference entries which are not books, because they lack author and editor, yet these fields are mandatory for the creation of the title string of the note. Thus I get an error. If I try to create a note, Emacs complains about a nil value where a string was expected; the problem is that nil is passed as a value to split-string in bibtex-completion-apa-get-value.

Quick fix would be to simply allow empty author AND editor fields in the pcase of bibtex-completion-apa-get-value, a better solution would be to allow handling of non book cases by a generic mechanism, not unlike citation.

Thinking about it, another good idea would be to wrap the format string for the notes in a condition-case, so that the workflow is not inhibited in case there is some problem with the field definitoins...

Originally posted by @publicimageltd in https://github.com/tmalsburg/helm-bibtex/issues/235#issuecomment-629162314

tmalsburg avatar May 18 '20 10:05 tmalsburg