Timothy <tecos...@gmail.com> writes: >> 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.
That's an option. Though you should also consider a paragraph ending at EOB. Searching for "\n" will fail with error then. >> 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. I am mostly thinking in terms of https://list.orgmode.org/87tug8t8ql....@gmail.com/T/#t Otherwise, your variant is fine for me. Best, Ihor