Multiple custom-set-faces and custom-set-variables in .emacs?

落花浮王杯 提交于 2019-12-08 02:27:16

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!