From: Pavel Panchekha <me@pavpanchekha.com>
To: emacs-orgmode@gnu.org
Subject: Entities Parsing Code
Date: Mon, 19 Sep 2011 17:39:27 -0400 [thread overview]
Message-ID: <CAE4=OQ-j50gA+WwwoRO0X6GjK504XyS0H3Ry3u7MBgqV8sp5yA@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 921 bytes --]
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
[-- Attachment #2: Type: text/html, Size: 2402 bytes --]
next reply other threads:[~2011-09-19 21:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-19 21:39 Pavel Panchekha [this message]
2011-10-08 16:06 ` Entities Parsing Code Carsten Dominik
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='CAE4=OQ-j50gA+WwwoRO0X6GjK504XyS0H3Ry3u7MBgqV8sp5yA@mail.gmail.com' \
--to=me@pavpanchekha.com \
--cc=emacs-orgmode@gnu.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).