From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alan Schmitt Subject: Re: Stackoverflow in regexp matcher Date: Wed, 03 Feb 2016 18:50:12 +0100 Message-ID: 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: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45827) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aR1ZP-0001mF-Ac for emacs-orgmode@gnu.org; Wed, 03 Feb 2016 12:50:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aR1ZL-0001Ik-Vn for emacs-orgmode@gnu.org; Wed, 03 Feb 2016 12:50:23 -0500 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:8067) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aR1ZL-0001Ht-Nm for emacs-orgmode@gnu.org; Wed, 03 Feb 2016 12:50:19 -0500 In-Reply-To: <87y4b2owmm.fsf@hornfels.zedat.fu-berlin.de> (Loris Bennett's message of "Wed, 03 Feb 2016 12:34:41 +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: Loris Bennett Cc: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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 =2D-=20 OpenPGP Key ID : 040D0A3B4ED2E5C7 Athmospheric CO=E2=82=82 (Updated February 1, 2016, Mauna Loa Obs.): 402.43= ppm --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBCgAGBQJWsj3UAAoJEAQNCjtO0uXHrGIH/iu3BpRqqntybEi9AHYa5vn1 hsuEtp0+ZDQhT0XTwqESVpfrRCKi0rbqfNnUBEVbHjQWS5sysO7lRp6YXdjfFvZU xz4m829/4oJnIad1bw/Op8NPSjKhIa3wyxdmanCe8g3NZmQCYpTp3R5uUK/FZMT/ BTs/09TKTX7yiR1CpzhCa0Bxg4l/d+ZiwXKld+5VqLShC7NBAhc1Oe0AttvvF2J4 Kky3cRPniGLKhF6OVTgd1gwNWWCkK4DvkhNqT0ggHSDGTZzPSyU9+VEMVM9tAbbR KNq5Q8c7TqQ/oaH6RfMHwyh/r+Nqwkbed9Z/yxkmaw2uVNffJFzApSWNKeqGTc8= =KZEw -----END PGP SIGNATURE----- --=-=-=--