bug-auctex
[Top][All Lists]
Advanced

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

[Bug-AUCTeX] Bug with reftex-parse.el (reftex-using-biblatex-p)


From: Leonard Randall
Subject: [Bug-AUCTeX] Bug with reftex-parse.el (reftex-using-biblatex-p)
Date: Sat, 21 Jun 2014 12:14:27 +0100

Hi,
The regexp called in reftex-using-biblatex-p will create a stack overflow in large files with few or no % marks in the file. This is not usually a problem with most tex files but it can be a problem if you use reftex with org-mode or other systems that export latex but do not use %s.  This problem can be solved rather easily by making the search for comment lines non-greedy, or by making it stop at newlines. The fix below uses both approaches, as this seems to speed up the search, and avoid stack overflows in more cases.

Currently the function looks like this
(defun reftex-using-biblatex-p ()
  "Return non-nil if we are using biblatex rather than bibtex."
  (if (boundp 'TeX-active-styles)
      ;; the sophisticated AUCTeX way
      (member "biblatex" TeX-active-styles)
    ;; poor-man's check...
    (save-excursion
      (re-search-forward "^[^%]*\\\\usepackage.*{biblatex}" nil t))))
Proposed fix:
(defun reftex-using-biblatex-p ()
  "Return non-nil if we are using biblatex rather than bibtex."
  (if (boundp 'TeX-active-styles)
      ;; the sophisticated AUCTeX way
      (member "biblatex" TeX-active-styles)
    ;; poor-man's check...
    (save-excursion
      (re-search-forward "^[^%\n]*?\\\\usepackage.*{biblatex}" nil t))))

(By the way, if it matters I have a FSF copyright assignment for emacs, under my full name, Leonard Avery Randall)

All best,
Leonard



reply via email to

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