emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Fontification for inline src blocks


From: Tim Cross
Subject: Re: [PATCH] Fontification for inline src blocks
Date: Thu, 13 May 2021 12:38:42 +1000
User-agent: mu4e 1.5.13; emacs 27.2.50

Timothy <tecosaur@gmail.com> writes:

> Thank you for the detailed feedback :)
>
> Ihor Radchenko <yantar92@gmail.com> writes:
>
>> Timothy <tecosaur@gmail.com> writes:
>>
>>>> I do not like abusing prettify-symbols-mode. What if it is not enabled?
>
> If you know of another way of accomplishing text-replacement which
> changes back when the cursor enters the region, please let me know.
>
>>> 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).
>
> Isn't the same effect achieved by the remove-list-of-text-properties call?
>
>> 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.
>
> I just tried "setting org-inline-src-prettify-results to nil in already
> fontified buffer." and the region just decomposed and stayed that way.
>
>> 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
>
> Hmmm, from a look I can't tell exactly how these are "managed". Are they
> just removed when a region is processed?
>
>> why are you even removing 'face? It should be already done by font-lock).
>
> I tried removing such calls, and everything still worked, so this is no
> longer done.
>
>>>> 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?
>
> Well, I guess this is a by-product of using prettify-symbols-start/end,
> see my note at the start of this email about not being aware of anything else.
>
>> 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.
>
> I'm guessing for this to work I'd need to return the final char
> fortified? Or is the moving of point enough?
>
> Maybe related - I've noticed this doesn't seem to work with multiple
> src_ blocks per line, might you have any insight here?
>
>
This may or may not be something to consider but ...

What is the impact of using this technique for accessibility and users
of assistive technology like text-to-speech or braille displays?

I'm currently not in the position to test this patch, but once I get
some environments for testing sorted out, I should be able to try it
out.

>From an accessibility perspective, behaviour which changes what is
'displayed' based on cursor position is often confusing for things like
text-to-speech. In the past, I have run into issues with prettify
symbols because it results in either less meaningful content (e.g.
unicode numbers rather than defined character names) or additional
spoken text which makes it difficult to understand. Things like
overlays, tooltips or features which make display different from
underlying character content can often be problematic with assistive
technology. 



-- 
Tim Cross



reply via email to

[Prev in Thread] Current Thread [Next in Thread]