[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Fontification for inline src blocks
From: |
Timothy |
Subject: |
Re: [PATCH] Fontification for inline src blocks |
Date: |
Mon, 22 Nov 2021 22:37:23 +0800 |
User-agent: |
mu4e 1.6.9; emacs 28.0.50 |
Hi Ihor,
>>>> org-inline-src-fontify-max-length
>> The description may need updating, as that’s a tad inaccurate. That value
>> actually limits how far forwards a paired paren is searched for. There’s no
>> spurious fontification.
>
> I can see the purpose. However, it still looks like overcomplication.
> org-element-context takes care about this issue simply by narrowing to
> current element (inline src block is an object and hence must end within
> current element).
Well, one simple change we could do is just replace
org-inline-src-fontify-max-length with the addition of `(save-excursion
(search-forward "\n" limit nil) (point))' to the restriction.
>>> It looks like you are repeating the job of org-element-context here. Why
>>> don’t you just get the proper object?
>>
>> IIRC `org-element-context’ doesn’t separate out the `src_’, `lang’,
>> `[options]’, and
>> `{content}’ of an inline source code block (which we want).
>
> Sounds like an omission in org-element-context. At least, the parser
> could return :contents-begin and :contents-end. Then, you would also not
> need to re-implement the parser.
Perhaps. However frankly I don’t think it would do that much to reduce the
complexity, and what’s in this patch seems to work fairly nicely.
All the best,
Timothy
- Re: [PATCH] Fontification for inline src blocks, Timothy, 2021/11/21
- Re: [PATCH] Fontification for inline src blocks, Timothy, 2021/11/22
- Re: [PATCH] Fontification for inline src blocks, Ihor Radchenko, 2021/11/22
- Re: [PATCH] Fontification for inline src blocks, Timothy, 2021/11/22
- Re: [PATCH] Fontification for inline src blocks, Ihor Radchenko, 2021/11/22
- Re: [PATCH] Fontification for inline src blocks,
Timothy <=
- Re: [PATCH] Fontification for inline src blocks, Ihor Radchenko, 2021/11/23
- Re: [PATCH] Fontification for inline src blocks, Timothy, 2021/11/29
- Re: [PATCH] Fontification for inline src blocks, Timothy, 2021/11/30
- Re: [PATCH] Fontification for inline src blocks, Sébastien Miquel, 2021/11/30
- Re: [PATCH] Fontification for inline src blocks, Timothy, 2021/11/30
- Re: [PATCH] Fontification for inline src blocks, Ihor Radchenko, 2021/11/30
Re: [PATCH] Fontification for inline src blocks, Vitaly Ankh, 2021/11/23