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