Karthik Chikmagalur <[email protected]> writes:
> I'm using the version of the ORG-NEWS file from the olp branch of
>
> https://github.com/karthink/org-mode
>
> but the problem may be visible in the ORG-NEWS file on main as
> well. To reproduce it,
>
> 1. Open ORG-NEWS, all level-1 headings should be folded.
> 2. Press <tab> on the first title, "Version 9.8 (not released yet)"
> 3. Place the cursor on any of the level-2 headings, such as "New
> features" or "New and changed options" and press <tab> again.
> 4. Opening this level-2 heading takes 4-5 seconds on my machine.
I actually cannot reproduce on main. I tried Emacs 31, 30, 29, and 28.
Using make repro REPRO_ARGS="-l /tmp/bug.el etc/ORG-NEWS"
with /tmp/bug.el containing the configuration you provided:
> (setq org-highlight-latex-and-related '(latex))
> (plist-put org-format-latex-options :matchers '("begin" "\\(" "\\["))
But upon further investigation, I have found that
(plist-put org-format-latex-options :matchers '("begin" "\\(" "\\["))
is getting rid of the problem.
Without it, I can reproduce.
So, it looks like $1, $, and $$ entries in matches make a difference.
This is understandable - we happen to have many $ in ORG-NEWS this time.
The reason is also clear - org-latex-regexps has a bunch of expensive
multiline regexps.
So, the problem boils down to regexp-based fontification. In other
words, yet another reason why we eventually need
https://orgmode.org/list/87ee7c9quk.fsf@localhost
--
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>