reddit / emacs

Emacs Doom: Why is the buffer drawn twice?

TiMueller · 2022-08-28 05:25
When I open a header or quickly scroll through a newly opened org-file, I can see how the buffer is drawn in a different font-size and color and with all the leading stars shown, and then it is quickly repaired. Why is that? Did I set some hook wrong? I managed to capture it in the moment being drawn (see picture). A fracture of a second later, all the headings will look like "Szenen allgemein". But this is redundant, I would prefer Emacs not to have to draw everything twice. I have custom-set the faces of the headings a little bit bigger and set them to Source Sans Pro font. The colors come from the theme doom-solarized-light. I use org-superstars to change the looking of the stars, but even if I didn't, why are there two stars drawn at first, with org-hide-leading-stars set to t? If I add +pretty to the doom module list, this behaviour is gone (although it should only load org-appear and org-fancy-priorities), but then there is some bug, everything gets extremely slow, taking five seconds to load a 1.3M-file and 1-2 seconds to open a header. I don't need org-appear and org-fancy-priorities, so I prefer the setting without the +pretty module. Any ideas why the buffer is drawn twice and how I can omit that? https://preview.redd.it/izkow5sm1ek91.jpg?width=1137&format=pjpg&auto=webp&s=ea408f5b52194c8e23d70db50fb5eff91f2cb012
BobKoss · 2022-08-28 17:46
If you start emacs without your config (emacs -Q), does it still do this? I use doom and never noticed the behavior you see.
TiMueller · 2022-08-30 09:06
Thank you very much! After I read your reply, I tried everything with emacs -Q I could, loading and activating mixed-pitch, org-superstar, org-indent-mode, visual-line-mode and even changing the faces, and still the twice-drawing-behaviour did not happen. Then I took a closer look at my config.el and switched off as many parts as I could. And I have found the reason. I had set `jit-lock-defer-time` to `0.05` and `jit-lock-stealth-time` to `1` when an org-file had reached a certain size. While this makes opening headers more responsive, it is annoying they are drawn twice. Now I can change that.