Subject: bug#33810: 26.1.50; bibtex initializes some global vars after opening a file

From: Lars Ingebrigtsen <[email-masked]>
Date: Wed, 10 Jul 2019 01:29:13 +0200

Konstantin Reich <[email-masked]> writes:

> Hey, i am using emacs 26.1.50
>
> When i ran the following code in just started emacs -Q
> (with-temp-buffer
>   (insert "@article{aaaa,
>     author =     {AAA},
>     title =  {BBBB}
>     }")
>   (bibtex-mode)
>   (bibtex-autokey-get-field "title"))
>
> I get the following error:
>
>   Debugger entered--Lisp error: (wrong-type-argument stringp nil)
>     looking-at(nil)
>     bibtex-valid-entry(t)
>     bibtex-end-of-entry()

After poking around in the bibtex code, I think this just isn't
supported.  All the variables are like this:

(defvar bibtex-entry-maybe-empty-head nil
  "Regexp matching the header line of a BibTeX entry (possibly without key).
Initialized by `bibtex-set-dialect'.")

And the dialect won't be set until you load a file, so I don't think
this is a bug.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no