[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Large source block causes org-mode to be unusable
From: |
Sébastien Miquel |
Subject: |
Re: Large source block causes org-mode to be unusable |
Date: |
Mon, 21 Jun 2021 18:57:27 +0000 |
Hi Léo,
Léo Ackermann writes:
I am working in an org-file of reasonable size (<2000 lines): my first
paper written in org-mode. Everything fine (and fast) until I started
to add `#+BEGIN_proof / #+END_proof` within my .org to make my .pdf
export prettier. This caused the editing of the proofs to be very
slow: navigation within the proof is fast but adding/removing any char
takes around 4s per char.
It seems that the fontify function is responsible for that (see
screenshot). As far as I understand, this function tries to fontify
the whole block as soon as a single char is modified. In my case, it
then tries to fontify a whole proof (~4 pages in my .pdf, with many
LaTeX formulas) several times per second...
You can try setting org-highlight-latex-and-related to '(latex) instead of
'(native).
Even with this setting, latex fontification in special blocks is slow. The
reason being that the whole block has the `font-lock-multiline'
property, hence
every char insertion triggers refontification of the whole block.
In the function `org-do-latex-and-related', I commented out the second
condition
of the `cond' form, which makes calls to `face-at-point'. This yields a
significant speedup, and was enough to make things bearable in my cases.
You can
also try to simplify the latex regexp.
If you try these, I'd be interested to hear how much of an improvement
theymake.
Regards,
--
Sébastien Miquel
- Large source block causes org-mode to be unusable, Léo Ackermann, 2021/06/21
- Re: Large source block causes org-mode to be unusable, John Hendy, 2021/06/21
- Re: Large source block causes org-mode to be unusable,
Sébastien Miquel <=
- Re: Large source block causes org-mode to be unusable, John Kitchin, 2021/06/21
- Re: Large source block causes org-mode to be unusable, John Hendy, 2021/06/21
- Re: Large source block causes org-mode to be unusable, Eric S Fraga, 2021/06/22
- Re: Large source block causes org-mode to be unusable, Léo Ackermann, 2021/06/22
- Re: Large source block causes org-mode to be unusable, Eric S Fraga, 2021/06/22
- Re: Large source block causes org-mode to be unusable, Léo Ackermann, 2021/06/22
- Re: Large source block causes org-mode to be unusable, Eric S Fraga, 2021/06/22
- Re: Large source block causes org-mode to be unusable, Léo Ackermann, 2021/06/22