【发布时间】:2016-05-23 11:45:27
【问题描述】:
我想设置我的起始默认字体。 我在选项中选择一种字体-> 设置默认字体。然后我用 Options --> Save Options 保存它。
这写在我的 ~/.emacs.d/init.el 文件的末尾:
(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.
'(default ((t (:inherit nil :stipple nil :background "black" :foreground "white" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant italic :weight bold :height 241 :width normal :foundry "microsoft" :family "Trebuchet MS" "Courier New" :foundry "monotype" :slant normal :weight bold :height 240 :width normal "Courier New"))))
再次启动 emacs 时,不会加载所选字体。正如*Messages* 或 --debug-init 所报告的,init.d 文件没有问题。
似乎“设置默认字体”查找字体和 init.d 查找字体的机制不同...
我做错了什么?
在 Ubuntu 14.04LTS、Emacs 24 上运行
【问题讨论】:
-
我觉得
"Courier New"的出现很奇怪。如果您删除这两个事件,它会起作用吗? -
另外,请确保
(custom-set-faces...)在您的 init 文件中仅出现一次,根据您上面引用中的注释。 -
顺便说一句——我假设
init.d实际上是指.emacs.d/init.el? -
哎呀!绝对!