org.el (org-fontify-entities): Hide {} when prettifying entities.

* org.el (org-fontify-entities): Hide {} when prettifying
entities.

TINYCHANGE
This commit is contained in:
Mark E. Shoulson 2012-05-05 08:07:26 +02:00 committed by Bastien Guerry
parent 587b534544
commit f6745ff2d0

View file

@ -5917,16 +5917,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))))