emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Carsten Dominik <carsten.dominik@gmail.com>
To: Julien Barnier <julien@no-log.org>
Cc: emacs-orgmode@gnu.org
Subject: Re: [PATCH] Fix regexp error for protecting final } when exporting emphasis elements to latex
Date: Wed, 9 Dec 2009 22:35:09 +0100	[thread overview]
Message-ID: <247FEA2C-A612-4843-A410-08EBADAA800E@gmail.com> (raw)
In-Reply-To: <87ocm843mf.fsf@z.nozav.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 :
>
> /é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
>
>
>
> _______________________________________________
> 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

      reply	other threads:[~2009-12-09 21:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-09 14:35 [PATCH] Fix regexp error for protecting final } when exporting emphasis elements to latex Julien Barnier
2009-12-09 21:35 ` Carsten Dominik [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=247FEA2C-A612-4843-A410-08EBADAA800E@gmail.com \
    --to=carsten.dominik@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=julien@no-log.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).