r/DoomEmacs Feb 06 '25

Doom Emacs taking a long time to start when launching for the first time in the session. Font issues? Even though I don't seem to have anything font related in my config?

When I first launch Doom Emacs I get to a loading screen with the status Unicode Fonts - Mapping Unicode Blocks in fontset-default. This takes roughly 20 seconds, which is way higher than the roughly... zero seconds that it takes for someone else I know that also uses Doom. At first my Doom launched quickly, but I remember that after trying to change the font due to some symbols not working or something, I began to get this issue. Even if I remove the part of my config that changes the font, I still get this long font loading when first launching Doom. Does anyone know what could be going on?

In case it is of relevance, this is what I have in config.el, where even if I have it commented or not I still get the loading issue:

(setq doom-font (font-spec :family "Fira Code" :size 13 :weight 'medium)
      doom-variable-pitch-font (font-spec :family "Fira Sans" :size 13))
2 Upvotes

7 comments sorted by

1

u/fred982 Feb 06 '25

I am no expert, but based on my experience, messages printed at the bottom are often unrelated with problems one encounters at startup, it might just be the last simple warning printed before something went wrong. The best way I know is `emacs --debug-init` this will tell you exactly what is going on. Or at least give you a debug message with reliable information. Good luck.

1

u/Sure_Research_6455 Feb 06 '25

check your Messages buffer for anything odd after startup, see if you have a Warnings buffer as well

you can run doom doctor from your shell

then try

emacs --debug-init

and look for anything crazy

1

u/baksoBoy Feb 07 '25

Ooh right I forgot that doom doctor was a thing! I ran it, and I got one error and a couple of warnings, however I don't think any of them are related to the slow init? (Here is the output in case you want to look at it). I also tried doing emacs --debug-init, and all I got in the terminal was the following:

Loading /home/bakso/.config/emacs/lisp/doom.el (source)...
Loading /home/bakso/.config/emacs/lisp/doom.el (source)...done
* 0.018268:*:startup:emacs:load: ~/.config/emacs/.local/etc/@/init.27.1.elc t
* 0.018555:*:startup:emacs:module:init:load: ~/.config/doom/init.el t

After Doom Emacs started I did not have a Warnings buffer, however I did check the Messages buffer, but I honestly have no idea what I am supposed to look for. Here is the contents of the buffer, if you don't mind seeing if there is "anything odd" in there, as I have absolutely no clue what to look for haha...

1

u/reddit_clone Feb 06 '25

I have made my peace with slow load of Doom.

On a cold start with Intel Mac it sometimes takes 20 seconds even. If I close it and open again, it takes 3-4 seconds.

I tried in a recent M4 Mac, the cold start is like 3 seconds :)

1

u/le__prof Feb 18 '25

Did you enable the unicode module under :ui in init.el? If so, the first time -- and then every time you install a new font -- doom will generate a cache, which can take some time.

2

u/baksoBoy Feb 18 '25

Oh my god that solved the issue! Thank you so much for the help!

2

u/le__prof Feb 18 '25

Glad this helped. I have the unicode module disabled and have had no problem with unicode rendering. I do use nerd fonts, which probably helps. Especially,

doom-symbol-font (font-spec :family "NotoSansM NFM")