8

Basically I would like to have (custom-set-variables ...) in a seperate file and for me to load that file.

This is just for the purpose of organisation of my init file.

How can I change the default location of custom-set-variables?

  • 3
    Good question. Not enough users make use of custom-file, IMO. The Emacs doc should make it more prominent, and even provide for it being used by default, rather than letting Customize pollute the init file. – Drew Apr 3 '16 at 16:01
9

Set the custom-file variable in your init file.

C-hv custom-file RET

  • And note that although this is a user option, you probably do not want to count on setting it only using Customize, i.e., setting it in your `custom-file'. ;-) – Drew Apr 3 '16 at 16:00
0

Example of exact text you may want to place in your init.el:

(setq custom-file "~/.emacs.d/custom.el")
(load custom-file 'noerror)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.