emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Mark E. Shoulson" <mark@kli.org>
To: org-mode mailing list <emacs-orgmode@gnu.org>
Subject: Hiding the braces when org-pretty-entities is enabled
Date: Fri, 04 May 2012 18:24:29 -0400	[thread overview]
Message-ID: <4FA4571D.4050402@kli.org> (raw)

[-- Attachment #1: Type: text/html, Size: 1002 bytes --]

[-- Attachment #2: 0001-Entities-when-org-pretty-entities-is-on-the-terminat.patch --]
[-- Type: text/x-patch, Size: 1312 bytes --]

From 819e66254de18ae78e96b52dee1b5098920c3e31 Mon Sep 17 00:00:00 2001
From: Mark Shoulson <mark@kli.org>
Date: Fri, 4 May 2012 18:19:06 -0400
Subject: [PATCH] Entities: when org-pretty-entities is on, the {} terminating
 entities is also hidden

---
 lisp/org.el |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 8776664..65dc1ce 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -5938,16 +5938,19 @@ 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]\\)"
+		"\\\\\\(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)))
 		   (= (length (nth 6 ee)) 1))
-	      (progn
+	      (let*
+		  ((end (if (equal (match-string 2) "{}")
+			    (match-end 2)
+			  (match-end 1))))
 		(add-text-properties
-		 (match-beginning 0) (match-end 1)
+		 (match-beginning 0) end
 		 (list 'font-lock-fontified t))
-		(compose-region (match-beginning 0) (match-end 1)
+		(compose-region (match-beginning 0) end
 				(nth 6 ee) nil)
 		(backward-char 1)
 		(throw 'match t))))
-- 
1.7.7.6


             reply	other threads:[~2012-05-04 22:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-04 22:24 Mark E. Shoulson [this message]
2012-05-05  6:08 ` Hiding the braces when org-pretty-entities is enabled Bastien

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=4FA4571D.4050402@kli.org \
    --to=mark@kli.org \
    --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).