On Friday, August 11, 2023 at 09:34:31 AM PDT, J. G. <jer...@pacbell.net>
wrote:
> Hi, I'm trying to figure out why I'm getting consistent failures using
> org-bibtex-yank. This appears to be identical to the problem posted here:
On further investigation I have pinpointed the precise error as referenced by
the comment in the Stackoverflow thread. One of the nested function calls
stemming from org-bibtex-yank is to bibtex-parse-entry in bibtex.el, and that
in turn attempts to make use of the internal variable
bibtex-entry-maybe-empty-head. That variable, among others, has documentation
that they are nil until initialized by bibtex-set-dialect, which sets a number
of other internal variables along with bibtex-dialect. That default nil value
bubbles up to cause the error I am experiencing. The solution in my original
email of opening a dummy.bib file works because it calls bibtex-mode and that
calls bibtex-set-dialect.
Adding the following two lines to my init fixes the error in my case:
(require 'bibtex)(bibtex-set-dialect 'biblatex nil)
where the first line seems to be necessary in my barebones case because bibtex
isn't yet loaded, and the second line sets my dialect of choice (biblatex) and
sets the internal variables for bibtex globally (nil), not locally (t).
Given the disconnect between the error and the solution (as I understand it at
least), and the absence of this necessity in the documentation (I have read
through at least ol-bibtex.el), perhaps a small mention of this in the
documentation in ol-bibtex.el is in order, and I can submit a patch for review?