help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Org-mode blocks multiline fontification performance


From: Sébastien Miquel
Subject: Org-mode blocks multiline fontification performance
Date: Wed, 23 Jun 2021 18:41:44 +0000

Hi,

Org allows the use of special blocks such as

#+begin_proof
Some LaTeX fragments in here: $a^2 + b^2 = c^2$.
#+end_proof

that may be exported to matching LaTeX environments.

We want some light fontification of such blocks:
 1. *Matching* #+begin and #+end lines should be fontified
 2. Some background color face should be applied to the inside of the block.     (This isn't actually currently the case for such special blocks, but applies
    for other blocks)

It is currently implemented by adding the `font-lock-multiline' property to the
block.

When the inside of the block is modified, the region to refontify is extended to
the whole block (the multiline region), and the whole block is refontified.

The issue is that
 + the block may be quite large
 + the LaTeX fragment fontification can be quite expensive.

For very large blocks, this makes emacs unusable, and for smaller blocks, it can
still incur some noticeable delay.

Is there a better way to achieve 1. and 2. ?
If not, how about 2. only ?

Regards,

--
Sébastien Miquel




reply via email to

[Prev in Thread] Current Thread [Next in Thread]