bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#37957: BibTeX dialect not set if local variables disabled


From: Richard Copley
Subject: bug#37957: BibTeX dialect not set if local variables disabled
Date: Mon, 28 Oct 2019 09:44:15 +0000

From "emacs -Q",
* Set the variable 'enable-local-variables' to nil.
* Visit a BibTeX (*.bib) file.
* Wait one minute or eval (bibtex-parse-buffers-stealthily).

Lisp error: (wrong-type-argument number-or-marker-p nil)
Backtrace:
  1+(nil)
  (buffer-substring-no-properties (1+ (match-beginning bibtex-type-in-head)) (match-end bibtex-type-in-head))
  bibtex-type-in-head()
  (assoc-string (bibtex-type-in-head) bibtex-entry-alist t)
  [...]
  bibtex-parse-keys(t)
  bibtex-parse-buffers-stealthily()
  [...]

On visiting a BibTeX file, if enable-local-variables is nil, 'bibtex-set-dialect' doesn't get called. This causes errors later on. For example, when 'bibtex-parse-buffers-stealthily' is called, we get the above error, because 'bibtex-entry-head' has not been set. Glancing at the history of  'bibtex-major-mode', this commit seems a likely candidate:

ace88aa20f32b298e7f2e8e6115b5661504f8724
Author: Roland Winkler <winkler@gnu.org>
AuthorDate: Sat Jan 28 12:06:10 2012 -0600

lisp/textmodes/bibtex.el: allow bibtex-dialect as file-local variable (Bug#10254)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]