问题
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 ...)
回答1:
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.
来源:https://stackoverflow.com/questions/15867556/multiple-custom-set-faces-and-custom-set-variables-in-emacs