From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Barnier Subject: [PATCH] Fix regexp error for protecting final } when exporting emphasis elements to latex Date: Wed, 09 Dec 2009 15:35:20 +0100 Message-ID: <87ocm843mf.fsf@z.nozav.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NINe1-0001hR-0t for emacs-orgmode@gnu.org; Wed, 09 Dec 2009 09:35:57 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NINdw-0001d6-8I for emacs-orgmode@gnu.org; Wed, 09 Dec 2009 09:35:56 -0500 Received: from [199.232.76.173] (port=42567 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NINdw-0001cz-3Z for emacs-orgmode@gnu.org; Wed, 09 Dec 2009 09:35:52 -0500 Received: from lo.gmane.org ([80.91.229.12]:45090) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NINdv-0008FC-Op for emacs-orgmode@gnu.org; Wed, 09 Dec 2009 09:35:51 -0500 Received: from list by lo.gmane.org with local (Exim 4.50) id 1NINdq-0003gB-Vu for emacs-orgmode@gnu.org; Wed, 09 Dec 2009 15:35:47 +0100 Received: from z.nozav.org ([91.121.121.141]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 09 Dec 2009 15:35:46 +0100 Received: from julien by z.nozav.org with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 09 Dec 2009 15:35:46 +0100 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: emacs-orgmode@gnu.org 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 : /éaa/ Is exported to : \emph{éaa\} 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/ /ééé/ 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-BEFORE and STRING-AFTER." (if (caddr emph) (setq rpl (org-export-latex-protect-string rpl)) (save-match-data - (if (string-match "\\`.\\(\\\\[a-z]+{\\)\\(.*\\)\\(}\\).?\\'" rpl) + (if (string-match "\\`.?\\(\\\\[a-z]+{\\)\\(.*\\)\\(}\\).?\\'" rpl) (progn (add-text-properties (match-beginning 1) (match-end 1) '(org-protected t) rpl) -- 1.6.5.3