3

When I customize a face through the M-x customize-face menu and save the changes to disk, Emacs adds automatically generated code to my .emacs file that looks like this:

(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.
; 
;; SOME CODE
; 
)

where SOME CODE is something like:

 '(diredp-dir-priv ((t (:foreground "cyan"))))

Now, say that I want to manually make changes to SOME CODE, and perhaps add more code to modify other faces. Would it be smart to keep those changes under the custom-set-faces block? Or should I move that to a different block (to avoid Emacs from getting confused)

Also, would Emacs get confused I have multiple (custom-set-faces ... ) blocks? (same question for (custom-set-variables ...)

Drew
  • 29,895
  • 7
  • 74
  • 104
Amelio Vazquez-Reina
  • 91,494
  • 132
  • 359
  • 564

1 Answers1

4

If you are manually adding custom faces, keep it in custom-set-faces.

As for having multiple (custom-set-faces ... ) or (custom-set-variables ... ) lists, I have just tested this (in Emacs 23.1). They do work - Emacs will process all lists - however, if you then use M-x customize-face to add a new custom face (similarly for a variable) and save it for future sessions, Emacs will combine all the lists into one. So, you should probably only keep the one.

Yossarian
  • 5,226
  • 1
  • 37
  • 59