[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] Entities Parsing Code

From: Pavel Panchekha
Subject: [O] Entities Parsing Code
Date: Mon, 19 Sep 2011 17:39:27 -0400

I've been noticing that the org-pretty-entities code incorrectly lexes numbers as part of TeX command names; for example, if I type $\sim2n^2$, the \sim will not be replaced with a ~ because the 2 is lexed as part of the command name.  This is incorrect; in TeX, numbers are not legal parts of a command name.

Here's a patch that fixes the issue:

diff --git a/lisp/org.el b/lisp/org.el
index 73b1073..0db5a0b 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -5735,7 +5735,7 @@ needs to be inserted at a specific position in the font-
     (when org-pretty-entities
       (catch 'match
        (while (re-search-forward
-               "\\\\\\([a-zA-Z][a-zA-Z0-9]*\\)\\($\\|[^[:alnum:]\n]\\)"
+               "\\\\\\([a-zA-Z]+\\)\\($\\|[^[:alpha:]\n]\\)"
                limit t)
          (if (and (not (org-in-indented-comment-line))
                   (setq ee (org-entity-get (match-string 1)))

- Pavel Panchekha

reply via email to

[Prev in Thread] Current Thread [Next in Thread]