GNU bug report logs -
#33810
26.1.50; bibtex initializes some global vars after opening a file
Previous Next
Reported by: Konstantin Reich <reich-cv <at> yandex.ru>
Date: Thu, 20 Dec 2018 09:02:02 UTC
Severity: normal
Tags: notabug
Found in version 26.1.50
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
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()
bibtex-text-in-field("title" t)
bibtex-autokey-get-field("title")
(progn (insert "@article{aaaa,\n author = {AAA},\n title = {BBBB}\n }") (bibtex-mode) (bibtex-autokey-get-field "title"))
(unwind-protect (progn (insert "@article{aaaa,\n author = {AAA},\n title = {BBBB}\n }") (bibtex-mode) (bibtex-autokey-get-field "title")) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))
(save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (insert "@article{aaaa,\n author = {AAA},\n title = {BBBB}\n }") (bibtex-mode) (bibtex-autokey-get-field "title")) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))
(let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (insert "@article{aaaa,\n author = {AAA},\n title = {BBBB}\n }") (bibtex-mode) (bibtex-autokey-get-field "title")) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))))
eval((let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (insert "@article{aaaa,\n author = {AAA},\n title = {BBBB}\n }") (bibtex-mode) (bibtex-autokey-get-field "title")) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))) nil)
elisp--eval-last-sexp(t)
eval-last-sexp(t)
eval-print-last-sexp(nil)
funcall-interactively(eval-print-last-sexp nil)
call-interactively(eval-print-last-sexp nil nil)
command-execute(eval-print-last-sexp)
After i open any bibtex file the above code works as expected. (I get "BBBB")
Also everything works if I add (bibtex-set-dialect) after (bibtex-mode). In (https://emacs.stackexchange.com/questions/46691/package-initialization/46693#46693) I was told that it is some kind of bug due to bibtex initializes some global vars only after opening a file.
This bug report was last modified 5 years and 338 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.