From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: [PATCH] Fix regexp error for protecting final } when exporting emphasis elements to latex Date: Wed, 9 Dec 2009 22:35:09 +0100 Message-ID: <247FEA2C-A612-4843-A410-08EBADAA800E@gmail.com> References: <87ocm843mf.fsf@z.nozav.org> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NIUBr-0006MI-Vu for emacs-orgmode@gnu.org; Wed, 09 Dec 2009 16:35:20 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NIUBm-0006HF-U0 for emacs-orgmode@gnu.org; Wed, 09 Dec 2009 16:35:19 -0500 Received: from [199.232.76.173] (port=40278 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NIUBm-0006HC-RJ for emacs-orgmode@gnu.org; Wed, 09 Dec 2009 16:35:14 -0500 Received: from mail-ew0-f209.google.com ([209.85.219.209]:61708) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NIUBm-0001NM-Gw for emacs-orgmode@gnu.org; Wed, 09 Dec 2009 16:35:14 -0500 Received: by ewy1 with SMTP id 1so707732ewy.8 for ; Wed, 09 Dec 2009 13:35:13 -0800 (PST) In-Reply-To: <87ocm843mf.fsf@z.nozav.org> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Julien Barnier Cc: emacs-orgmode@gnu.org Hi Julien, I have applied you patch, thanks for tracking down a difficult issue. - Carsten On Dec 9, 2009, at 3:35 PM, Julien Barnier wrote: > Hi, > > I recntly noticed that in some specific cases, the final '}' was > esacped when exproting an emphasis element to LaTeX. > > For example, the following element : > > /=E9aa/ > > Is exported to : > > \emph{=E9aa\} > > This does not append if the string begins with a space or if it > is ASCII-only. For example, the followig strings are exported > correctly : > > /aaa/ > /=E9=E9=E9/ > > I don't understand why the problem only occurs with non-ASCII chars, > but I think that the regexp to protect added special chars in the > org-export-latex-fontify function is missing a '?' in the > beginning. Tha attached patch corrects it. > > Thanks for all, > > Julien > > --- > lisp/org-latex.el | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/lisp/org-latex.el b/lisp/org-latex.el > index ce697a3..3d25139 100644 > --- a/lisp/org-latex.el > +++ b/lisp/org-latex.el > @@ -1508,7 +1508,7 @@ The conversion is made depending of STRING-=20 > BEFORE and STRING-AFTER." > (if (caddr emph) > (setq rpl (org-export-latex-protect-string rpl)) > (save-match-data > - (if (string-match "\\`.\\(\\\\[a-z]+{\\)\\(.*\\)\\(}\\).?=20= > \\'" rpl) > + (if (string-match "\\`.?\\(\\\\[a-z]+{\\)\\(.*\\)\\(}\=20 > \).?\\'" rpl) > (progn > (add-text-properties (match-beginning 1) (match-end =20= > 1) > '(org-protected t) rpl) > --=20 > 1.6.5.3 > > > > _______________________________________________ > Emacs-orgmode mailing list > Please use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode - Carsten