emacs - .emacs 中的多个自定义设置面和自定义设置变量?

标签 emacs emacs-faces

当我通过 M-x customize-face 菜单自定义外观并将更改保存到磁盘时,Emacs 将自动生成的代码添加到我的 .emacs 文件中,如下所示:

(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
; 
)

SOME CODE 是这样的:

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

现在,假设我想手动更改SOME CODE,并且可能添加更多代码来修改其他面孔。将这些更改保留在 custom-set-faces block 下是否明智?或者我应该把它移到另一个 block (以避免 Emacs 混淆)

此外,Emacs 是否会对我有多个 (custom-set-faces ... ) block 感到困惑? (同样的问题 (custom-set-variables ...)

最佳答案

如果您手动添加自定义面孔,请将其保存在 custom-set-faces 中。

至于有多个 (custom-set-faces ... )(custom-set-variables ... ) 列表,我刚刚测试了这个 (在 Emacs 23.1 中)。它们确实有效 - Emacs 将处理所有列表 - 但是,如果您随后使用 M-x customize-face 添加新的自定义面孔(对于变量类似)并将其保存以供将来使用,Emacs 将合并所有列表合二为一。所以,您可能应该只保留那个。

关于emacs - .emacs 中的多个自定义设置面和自定义设置变量?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15867556/

相关文章:

emacs - 如何在 Emacs 上自定义一个面孔,但仅当 hl-line 处于事件状态时?

regex - 在 Emacs 的 C/C++ 模式下,将 #if 0...#endif block 中的代码面更改为注释面

python - 多线程 Python 代码中的 Emacs pdb 和断点问题

emacs - 从信息缓冲区发送代码到方案解释器

r - 当 C-c C-c 无响应时如何停止 ESS 中当前的执行进程?

emacs minor mode 临时修改默认面

emacs - 在 Emacs 中获取光标下的字体

emacs - lex/flex/yacc/bison文件是否有良好的Emacs模式或方法?

emacs - SLIME 是否有快捷键可以在 slime 模式下注释 Lisp 代码块?

emacs - 组织模式删除线颜色