13

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?

1
  • 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, 2016 at 16:01

2 Answers 2

11

Set the custom-file variable in your init file.

C-hv custom-file RET

1
  • 1
    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, 2016 at 16:00
9

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

(setq custom-file (concat user-emacs-directory "custom.el"))
(load custom-file 'noerror)
1
  • 2
    I think this is the better answer here.
    – vise
    May 31, 2020 at 23:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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