"Christopher M. Miles" <numbch...@gmail.com> writes:

> I'm the developer of Org mode package "org-link-beautify"
> https://repo.or.cz/org-link-beautify.git . The package main theory
> is to use org-link-parameters `:activate-func` to do link file preview
> with generating thumbnail images or file content etc.
>
> But I found it's slow one some big Org file and slow on small Org file
> when previewing has a lot.
> ...
> I can see the `org-mode` invoked `org-set-font-lock-defaults` soon when
> `org-mode` enabled. I hope the link `:activate-func` function can be
> called only on link elements which is VISIBLE (means unfolded subtrees
> or similar). So org-mode don't need to render all buffer links at
> beginning soon. Instead render them as needed as unfolded. (Maybe I read
> source code without fully understand the code. If so, correct me,
> thanks.)

Emacs fontification, by default, only requests fontification of the text
visible on screen. That's what LIMIT argument to `font-lock-keywords'
MATCHER function is for. Org mode obeys LIMIT.

If you are seeing fontification being requested for invisible part of
buffer or parts of buffer outside screen, it is likely caused by some
third-party package forcing the fontification.

As usual, try emacs -Q + minimal set of loaded packages and see if you
can reproduce the problem.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
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>

Reply via email to