what is custom-set-variables and faces in my .emacs?

rabidmachine9 picture rabidmachine9 · Feb 19, 2011 · Viewed 23.5k times · Source

this is in my .emacs can I mess with it or not?

(custom-set-variables
  ;; custom-set-variables was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 )
(custom-set-faces
  ;; custom-set-faces was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 '(better-fringes-bitmap ((t (:foreground "#00dd44"))))
 '(font-lock-string-face ((((class color) (min-colors 88) (background light)) (:foreground "#113355")))))

so far I am adding everything I want above these lines...

Answer

sanityinc picture sanityinc · Feb 20, 2011

These blocks are added by the customize interface, as Noufal pointed out. You can move them to a separate file, though, if you like.

Just add this to your ~/.emacs.d/init.el:

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

or, if you're still using an old-fashioned ~/.emacs file:

(setq custom-file "~/.custom.el")
(load custom-file)

A slightly more complex snippet that will work in either case is:

(setq custom-file (expand-file-name "custom.el" user-emacs-directory))
(load custom-file)