From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [bug?, org-element] latex-environment delimiters must be at BOL Date: Tue, 22 Jul 2014 12:03:45 +0200 Message-ID: <87d2cxg16m.fsf@nicolasgoaziou.fr> References: <877g3ltomt.fsf@gmx.us> <87iomxjvyv.fsf@nicolasgoaziou.fr> <87vbqu1xb6.fsf@gmx.us> <87mwc3gbtj.fsf@nicolasgoaziou.fr> <87egxf12n7.fsf@gmx.us> <87ha29g76m.fsf@nicolasgoaziou.fr> <87fvhtlq0p.fsf@gmx.us> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37714) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X9Wug-0001NJ-SY for emacs-orgmode@gnu.org; Tue, 22 Jul 2014 06:03:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X9WuY-0006FJ-LH for emacs-orgmode@gnu.org; Tue, 22 Jul 2014 06:03:14 -0400 Received: from relay6-d.mail.gandi.net ([2001:4b98:c:538::198]:57932) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X9WuY-0006ET-Ff for emacs-orgmode@gnu.org; Tue, 22 Jul 2014 06:03:06 -0400 In-Reply-To: <87fvhtlq0p.fsf@gmx.us> (rasmus@gmx.us's message of "Tue, 22 Jul 2014 11:08:22 +0200") 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: Rasmus Cc: emacs-orgmode@gnu.org Rasmus writes: > The attached patch hopefully addresses all of the issues you pointed > out. Sorry about those typos before! Thanks for the update. Some more comments below. > +(defconst org-element--latex-begin-environment > + "^[ \t]*\\\\begin{\\([A-Za-z0-9*]+\\)}" I overlooked this in the previous patch. This regexp is not correct, as it matches, e.g. \begin{ab*cd} A more accurate regexp is "^[ \t]*\\\\begin{\\([A-Za-z0-9]+\\*?\\)}" I realize that `org-element--current-element' is wrong here. I fixed it in maint, which probably means that you will need to deal with a merge conflict. > + ;; The following format string also matches optional arguments: > + ;; "^[ \t]*\\\\begin{\\([A-Za-z0-9*]+\\)}\\(\\[.*?\\]\\|{.*?}\\)*[ \t]*?" I think this comment is not necessary. > + "Format string matching the beginning of a LaTeX environment. > + > +Usage example: > + (format org-element--latex-begin-environment ENV) > +where ENV is a LaTeX environment. `org-element--latex-begin-environment' is not a format string. `org-element--latex-end-environment' is. You can remove this part. Add that the environment is put in group 1, though. Otherwise, the patch looks good. Feel free to apply it with suggested changes. Regards, -- Nicolas Goaziou