Timothy <tecos...@gmail.com> writes:

>> I do not like abusing prettify-symbols-mode. What if it is not enabled?
>
> Ah, it does it anyway at the moment.

Hmm. You are right. You are calling compose-region directly. Note, that
you do not add 'decompose-region function for automatic region
destruction (see help:pretty-symbol-pattern-to-keyword). If I
understand correctly (I did not really install your patch), if you have
composed region, disable font-lock, and try to edit the region, edits
will be invisible. Or imagine setting org-inline-src-prettify-results to
nil in already fontified buffer.

Also, you may find help:font-lock-extra-managed-props useful. That way,
you will not have to manually remove composition and other non-standard
properties during fontification (why are you even removing 'face? It
should be already done by font-lock).

>> What will happen if user toggles prettify-symbols-mode in Org buffer?
>
> This seems to be toggled nicely by prettify-symbols-mode too.

I would not expect it to. Why would prettify-symbols-mode interfere with
Org mode native fontification if it is not strictly necessary?

P.S. Nitpick: You do not need to run fontification in while loops. Just
fontifying next match before limit should be enough. Font-lock will call
the function again if needed.

Best,
Ihor

Reply via email to