From: Lars Ingebrigtsen Date: Wed, 13 Jul 2022 11:24:00 +0000 (+0200) Subject: Make bibtex-mode not signal errors when used programmatically X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1^2~5^2~16^2~1886^2~966 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=2f7cd9cd732f4e25a06d5e52fde7ff376a1c366e;p=emacs.git Make bibtex-mode not signal errors when used programmatically * lisp/textmodes/bibtex.el (bibtex-mode): Ensure that the font lock machinery is set up (bug#48447). --- diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el index 6763da046ff..333cfa51695 100644 --- a/lisp/textmodes/bibtex.el +++ b/lisp/textmodes/bibtex.el @@ -3659,7 +3659,11 @@ if that value is non-nil. ?\s))))) (if (and buffer-file-name enable-local-variables) (add-hook 'hack-local-variables-hook fun nil t) - (funcall fun)))) + (funcall fun))) + ;; We may be using the mode programmatically to extract data, and we + ;; then need this to be set up first so that sexp-based movement + ;; commands don't bug out. + (font-lock-set-defaults)) (defun bibtex-entry-alist (dialect) "Return entry-alist for DIALECT."