From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Loris Bennett" Subject: Re: Stackoverflow in regexp matcher Date: Thu, 04 Feb 2016 08:30:01 +0100 Message-ID: <87r3gtue4m.fsf@hornfels.zedat.fu-berlin.de> References: <87oabzb4h8.fsf@hornfels.zedat.fu-berlin.de> <878u33dsh0.fsf@alphaville.usersys.redhat.com> <87y4b2qm7h.fsf@hornfels.zedat.fu-berlin.de> <87si1a9h2o.fsf@nicolasgoaziou.fr> <87y4b2owmm.fsf@hornfels.zedat.fu-berlin.de> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43466) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aREMn-000707-B7 for emacs-orgmode@gnu.org; Thu, 04 Feb 2016 02:30:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aREMk-0008G2-06 for emacs-orgmode@gnu.org; Thu, 04 Feb 2016 02:30:13 -0500 Received: from plane.gmane.org ([80.91.229.3]:33090) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aREMj-0008FY-QV for emacs-orgmode@gnu.org; Thu, 04 Feb 2016 02:30:09 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1aREMi-0004ta-6l for emacs-orgmode@gnu.org; Thu, 04 Feb 2016 08:30:08 +0100 Received: from zab1d.pia.fu-berlin.de ([87.77.171.29]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 04 Feb 2016 08:30:08 +0100 Received: from loris.bennett by zab1d.pia.fu-berlin.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 04 Feb 2016 08:30:08 +0100 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Alan Schmitt writes: > On 2016-02-03 12:34, "Loris Bennett" writes: > >> Nicolas Goaziou writes: >> >>> Hello, >>> >>> "Loris Bennett" writes: >>> >>>> re-search-forward("^[^%]*\\\\usepackage.*{biblatex}" nil t) >>> >>> This is a pathological regexp. [^%] is anything but a percent sign, so >>> it can contain newline characters. Basically [^%]* can match an entire >>> buffer if it doesn't contain any %. >>> >>> I think the regexp used in `reftex-using-biblatex-p' should be >>> >>> "^[^%\n]*\\\\usepackage.*{biblatex}" >>> >>> >>> Regards, >> >> So should this be filed as a bug against Emacs? >> >> In the meantime, aside from patching my own Emacs, would there be any >> other workaround, particularly considering that I don't currently need >> any biblatex functionality. > > This is a known bug: > http://comments.gmane.org/gmane.emacs.auctex.devel/3692 > > This thread also suggests a fix: > > #+begin_src emacs-lisp > (with-eval-after-load 'reftex-parse > (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))))) > #+end_src > > Best, > > Alan Thanks for the fix. Cheers, Loris -- This signature is currently under construction.