From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Mark E. Shoulson" Subject: Entities Date: Tue, 08 May 2012 22:52:42 -0400 Message-ID: <4FA9DBFA.8080405@kli.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------060109040206040909080907" Return-path: Received: from eggs.gnu.org ([208.118.235.92]:39455) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SRx1M-000700-WF for emacs-orgmode@gnu.org; Tue, 08 May 2012 22:52:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SRx1I-0002dG-TS for emacs-orgmode@gnu.org; Tue, 08 May 2012 22:52:56 -0400 Received: from pi.meson.org ([96.56.207.26]:52702) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1SRx1I-0002c6-O4 for emacs-orgmode@gnu.org; Tue, 08 May 2012 22:52:52 -0400 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: org-mode mailing list This is a multi-part message in MIME format. --------------060109040206040909080907 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit

There's a small bug in rendering the entities when org-pretty-entities is on (I get the feeling that org-pretty-entities is not a very commonly-used feature).  The entities \sup1 \sup2 \sup3 and \there4 are not rendered properly.  The regex detecting entities apparently doesn't catch numbers at the end, except for the special case of fractions.  I've added the others to the special-casing and attach a patch for it; I hope I managed to include the changelog properly (is git format-patch --attach the way to go?).


Also attached is another patch that might or might not be useful.  Sometimes it can be a problem when you can't type, say, asterisks around a word when you NEED asterisks around the word, not a boldface word (I'd been getting around it by using Unicode characters that look like asterisks, like ∗).  The way to do it right is to use the \ast entity, which expands to the right thing but doesn't affect formatting.  There's also already a \tilde entity, to allow putting in tildes without accidentally setting something verbatim.  I added entities for the remaining markup characters: \plus, \under, \equal, and \slash.  \under might be particularly handy when avoiding subscripting (which raises the question of if there should be an \asciicirc (or something) entity for ^ also).


~mark

--------------060109040206040909080907 Content-Type: text/x-patch; name="0001-Fix-for-displaying-certain-pretty-entities.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0001-Fix-for-displaying-certain-pretty-entities.patch" >From 5070e37aaae6f952bab022c71212fabb7549105e Mon Sep 17 00:00:00 2001 From: Mark Shoulson Date: Tue, 8 May 2012 15:15:10 -0400 Subject: [PATCH] Fix for displaying certain "pretty" entities MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------1.7.7.6" This is a multi-part message in MIME format. --------------1.7.7.6 Content-Type: text/plain; charset=UTF-8; format=fixed Content-Transfer-Encoding: 8bit * org.el (org-fontify-entities): fix bug: The entities \sup[123] and \there4 were not "prettified" when org-pretty-entities was enabled. TINYCHANGE --- lisp/org.el | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) --------------1.7.7.6 Content-Type: text/x-patch; name="0001-Fix-for-displaying-certain-pretty-entities.patch" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="0001-Fix-for-displaying-certain-pretty-entities.patch" diff --git a/lisp/org.el b/lisp/org.el index 66f9c3e..1d2955f 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -5954,7 +5954,7 @@ needs to be inserted at a specific position in the font-lock sequence.") (when org-pretty-entities (catch 'match (while (re-search-forward - "\\\\\\(frac[13][24]\\|[a-zA-Z]+\\)\\($\\|{}\\|[^[:alpha:]\n]\\)" + "\\\\\\(there4\\|sup[123]\\|frac[13][24]\\|[a-zA-Z]+\\)\\($\\|{}\\|[^[:alpha:]\n]\\)" limit t) (if (and (not (org-in-indented-comment-line)) (setq ee (org-entity-get (match-string 1))) --------------1.7.7.6-- --------------060109040206040909080907 Content-Type: text/x-patch; name="0002-Add-entities-for-_.patch" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="0002-Add-entities-for-_.patch" >From 58d18562f39ed64a547fa2d60510cae5983bcbef Mon Sep 17 00:00:00 2001 From: Mark Shoulson Date: Tue, 8 May 2012 15:22:48 -0400 Subject: [PATCH] Add entities for /, +, _, = MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------1.7.7.6" This is a multi-part message in MIME format. --------------1.7.7.6 Content-Type: text/plain; charset=UTF-8; format=fixed Content-Transfer-Encoding: 8bit * org-entities.el (org-entities): add new entities for characters which could cause formatting changes if typed directly. --- lisp/org-entities.el | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) --------------1.7.7.6 Content-Type: text/x-patch; name="0001-Add-entities-for-_.patch" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="0001-Add-entities-for-_.patch" diff --git a/lisp/org-entities.el b/lisp/org-entities.el index 8b5b3f3..fce3b68 100644 --- a/lisp/org-entities.el +++ b/lisp/org-entities.el @@ -260,6 +260,10 @@ loaded, add these packages to `org-export-latex-packages-alist'." ("lt" "\\textless{}" nil "<" "<" "<" "<") ("gt" "\\textgreater{}" nil ">" ">" ">" ">") ("tilde" "\\~{}" nil "˜" "~" "~" "~") + ("slash" "/" nil "/" "/" "/" "/") + ("plus" "+" nil "+" "+" "+" "+") + ("under" "\\_" nil "_" "_" "_" "_") + ("equal" "=" nil "=" "=" "=" "=") ("dagger" "\\textdagger{}" nil "†" "[dagger]" "[dagger]" "†") ("Dagger" "\\textdaggerdbl{}" nil "‡" "[doubledagger]" "[doubledagger]" "‡") --------------1.7.7.6-- --------------060109040206040909080907--