On 23/08/2021 14:45, Timothy wrote:
Thanks for your efforts. I have prepared a patch accordingly that wraps
org-src-font-lock-fontify-block’s body with save-match-data (attached).
If I don’t hear anything bad about it in the next few days, I’ll push it :)
Please let me know if my commit message agrees with your understanding of the
issue.
Timothy, are you able to reproduce the issue with performance? Due to
the thread
https://orgmode.org/list/cafhswegab_im1wpxp3xsffxcoahkyycm4gaqrin0suxxd0g...@mail.gmail.com/
"Large source block causes org-mode to be unusable" I assume that it
could be quite severe. On the other hand I tried to insert an .el file
into org-guide.org and I have not noticed slow down. Actually my
curiosity is caused by other performance issues, so I am interested if
the effect may be broader.
The following question may be dumb since I am not familiar how font lock
works in Emacs. Is it necessary to wrap whole function? I do not see
explicit operation with regexps. The only suspecting line is
(org-font-lock-ensure)
I am not sure whether the body of `org-src-font-lock-fontify-block'
should be wrapped or its call site.
Feel free to disregard my questions since fontification is far aside
from my experience.