emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Timothy <tec@ucc.asn.au>
To: "Léo Ackermann" <leo.komba@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Large source block causes org-mode to be unusable
Date: Tue, 22 Jun 2021 14:10:37 +0800	[thread overview]
Message-ID: <87lf725spe.fsf@ucc.asn.au> (raw)
In-Reply-To: <CAFhsWEgAb_im1WpXp3xsfFxcoahKyycM4GaqRin0SUXxD0gMzg@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 1196 bytes --]

Hi Léo,

I think I can actually speak a bit on this. As it stands, babel fontification
operates by:
- sending the src block to a dedicated buffer
- turning on the relevant major mode for the language
- forcing font-lock of the entire buffer
- cloning the font-lock information for the entire buffer back to Org

In essence, every keystroke in a babel block causes font-lock lag equal to
opening the file for the first time. As you can imagine, this adds up.

I think ideally Org would monitor which block you're executing keystrokes in,
and if there are a few in a row in the same org-src block keep the font-lock
buffer alive and incrementally update the content and intelligently copy back
font-lock changes. This has the potential to be much lower latency, but is also
going to be hard to get right.

In the meantime, you could try executing something like this in your Org
buffer ([source]):
,----
| (setq-local jit-lock-defer-time 0.05
|             jit-lock-stealth-time 1)
`----

This sacrifices immediate font-lock accuracy for responsiveness.

All the best,
*Timothy*


[source] <https://tecosaur.github.io/emacs-config/config.html#font-display,code--7>

[-- Attachment #1.2: Type: text/html, Size: 6717 bytes --]

      parent reply	other threads:[~2021-06-22  9:34 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-21 18:27 Léo Ackermann
2021-06-21 18:43 ` John Hendy
2021-06-21 18:57 ` Sébastien Miquel
2021-06-21 19:22 ` John Kitchin
2021-06-21 19:36   ` John Hendy
2021-06-21 20:41     ` Tom Gillespie
2021-06-22  4:48       ` Tim Cross
2021-06-22  7:54     ` Eric S Fraga
2021-06-22 11:20       ` Léo Ackermann
2021-06-22 12:13         ` Eric S Fraga
2021-06-22 12:32           ` Léo Ackermann
2021-06-22 13:03             ` Eric S Fraga
2021-06-22 13:32               ` Léo Ackermann
2021-06-23 16:40             ` Maxim Nikulin
2021-06-23 19:42               ` Gennady Uraltsev
2021-06-24  7:54                 ` Eric S Fraga
2021-06-26 14:10                   ` Léo Ackermann
2021-06-28  8:28                     ` Sébastien Miquel
2021-06-28 10:42                       ` Eric S Fraga
2021-06-28 10:40                     ` Eric S Fraga
2021-06-22  6:10 ` Timothy [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87lf725spe.fsf@ucc.asn.au \
    --to=tec@ucc.asn.au \
    --cc=emacs-orgmode@gnu.org \
    --cc=leo.komba@gmail.com \
    --subject='Re: Large source block causes org-mode to be unusable' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Code repositories for project(s) associated with this inbox:

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).