emacs-from-scratch
emacs-from-scratch copied to clipboard
Calling function within :config does not affect the font setup at startup
When calling the function https://github.com/daviwil/emacs-from-scratch/blob/1a13fcf0dd6afb41fce71bf93c5571931999fed8/init.el#L213 within the :config-realm https://github.com/daviwil/emacs-from-scratch/blob/1a13fcf0dd6afb41fce71bf93c5571931999fed8/init.el#L243 it didn't affect the fonts when opening a (new) org-file. When evaluating https://github.com/daviwil/emacs-from-scratch/blob/1a13fcf0dd6afb41fce71bf93c5571931999fed8/init.el#L239 after startup, font behaviour changed as intended.
Adding it as a hook works:
(use-package org
:hook (org-mode .efs/org-mode-setup)
:config
(setq org-ellipsis " ▾")
(add-hook 'org-mode-hook (lambda () ( efs/org-mode-setup))))
It could be that the org-faces
"feature" isn't loaded yet so the faces aren't applied correctly. You could try this inside of :config
:
(with-eval-after-load 'org-faces
(efs/org-font-setup))
This will ensure that the function is called after org-faces
is loaded.
First of all, thanks for having a look into this! And it almost gets the job done. Almost! Works for pretty much every font setting but the monospaced font for code blocks. Kind of mysterious. Below are two screenshots to illustrate the mystery.
Your suggested with-eval-after-load
approach:
The add-hook
approach: