]> git.eshelyaron.com Git - emacs.git/commitdiff
Make bibtex-mode not signal errors when used programmatically
authorLars Ingebrigtsen <larsi@gnus.org>
Wed, 13 Jul 2022 11:24:00 +0000 (13:24 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Wed, 13 Jul 2022 11:25:36 +0000 (13:25 +0200)
* lisp/textmodes/bibtex.el (bibtex-mode): Ensure that the font
lock machinery is set up (bug#48447).

lisp/textmodes/bibtex.el

index 6763da046ffcc2b1ef1b51510a21e728490df55e..333cfa51695307aa541f079a7c70b2bfd8a2c7aa 100644 (file)
@@ -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."