reddit / emacs
How do I configure emacs to read custom-set-variables after startup
funk443 · 2022-06-07 07:06
I found that emacs startup faster after I commented out the custom-set-variables section in init.el. I wonder if there is a proper way to tell emacs not to load it until emacs fully startup.
Currently I add it to emacs startup hook, but I don't think it's the right way to do it, because every time I changed a setting through customize, emacs creates a new block of custom-set-variables instead of changing the one in the add-hook funtion.
​
Edit: add this line to your emacs config file.
(setq custom-file (locate-user-emacs-file "custom_var.el"))
​
BlaFasl_sagIchdoch · 2022-06-07 07:36
Read NEWS-28 on early-init
:
funk443 · 2022-06-07 09:21
I am not sure what exactly I have to look for in news 28, can you be more specific? thanks
BlaFasl_sagIchdoch · 2022-06-07 09:34
Read on early-init
http://www. gnu.org/software/emacs/manual/html_node/emacs/Early-Init-File.html
:
_
funk443 · 2022-06-07 09:37
Oh, thank you sir, it's working as intended. Much appreciated!!
BlaFasl_sagIchdoch · 2022-06-07 10:12
If your OS is Linux, you may run systemd with Emacs.
[https://emacsredux.com/blog/2020/07/16/running-emacs-with-systemd/](https://emacsredux.com/blog/2020/07/16/running-emacs-with-systemd/)
:
funk443 · 2022-06-07 10:14
Thanks for the information!
7890yuiop · 2022-06-07 10:29
Set `C-h v custom-file` and then you can load it whenever you want to.
I can't say that I understand how it's supposed to assist with your actual problem, but it achieves what you've actually asked for.
funk443 · 2022-06-07 10:37
Thanks! This did the trick
1nc0ns1st3nt · 2022-06-13 14:11
To load `custom-file` until emacs fully startup, you may want to consider `emacs-startup-hook`, that would be (altogether):
```
(add-hook 'emacs-startup-hook (lambda () (load custom-file)))
```
funk443 · 2022-06-13 14:17
Ya, I know this method. But there is a downside that emacs will look ugly while it's loading packages and other stuff
1nc0ns1st3nt · 2022-06-13 14:26
I see. I had all my ui stuff in `lisp/init-ui.el` instead of putting all my configs in `custom.el` (assuming that might be what you have done, if I had guessed correcly)
Since some point, I have fully moved from using `custom.el` at all, but of course emacs still put custom-set-variables here anyways.