aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ingebrigtsen2019-11-17 09:15:20 +0100
committerLars Ingebrigtsen2019-11-17 09:15:20 +0100
commit9ac8901b0ae5a6bb75c790832caf4ea9be8df16f (patch)
treeda099836ae08e7a2a7b3ea4da10d50c4791ae069
parent32d1c1fc1f8d33df80c99cd147160b85583271f6 (diff)
downloademacs-9ac8901b0ae5a6bb75c790832caf4ea9be8df16f.tar.gz
emacs-9ac8901b0ae5a6bb75c790832caf4ea9be8df16f.zip
Make bibtex-parse-keys more robust
* lisp/textmodes/bibtex.el (bibtex-parse-keys): Protect against bugging out just when starting almost-empty bibtex files (bug#30112).
-rw-r--r--lisp/textmodes/bibtex.el3
1 files changed, 3 insertions, 0 deletions
diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el
index c29e9631801..2d24178f1a7 100644
--- a/lisp/textmodes/bibtex.el
+++ b/lisp/textmodes/bibtex.el
@@ -2915,6 +2915,9 @@ for parsing BibTeX keys. If parsing fails, try to set this variable to nil."
2915 (1+ (match-beginning 3)) (1- (match-end 3))))) 2915 (1+ (match-beginning 3)) (1- (match-end 3)))))
2916 (unless (assoc key crossref-keys) 2916 (unless (assoc key crossref-keys)
2917 (push (list key) crossref-keys)))) 2917 (push (list key) crossref-keys))))
2918 ;; We have probably have a non-bibtex file.
2919 ((not (match-beginning bibtex-type-in-head))
2920 (throw 'userkey nil))
2918 ;; only keys of known entries 2921 ;; only keys of known entries
2919 ((assoc-string (bibtex-type-in-head) 2922 ((assoc-string (bibtex-type-in-head)
2920 bibtex-entry-alist t) 2923 bibtex-entry-alist t)