我正在使用Emacs 23.2。当我使用选项更改默认字体时 - >设置默认字体...它正确切换到我选择的字体。然后我做选项 - >保存选项以使其永久化。
它在我的.emacs末尾写了一个节,但它是空的,不包含任何关于字体的内容。此外,在迷你缓冲器中它说“装电池......完成”这看起来有点奇怪。当我重新启动Emacs时,字体恢复为默认值,即Monaco。同样,更改字体大小不会保留,但其他(非字体相关的)自定义设置仍然存在。
有人见过这个吗?有人知道如何使字体设置永久化吗?
答案 0 :(得分:30)
尝试M-x customize-face RET default
,根据自己的喜好进行调整,然后“保存以备将来使用”。
修改强>
例如,它将以下节添加到.emacs中的(custom-set-faces)
:
(custom-set-faces
'(default ((t (:inherit nil :stipple nil :background "White" :foreground "Black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 130 :width normal :family "Consolas"))))
...
如果只想设置字体大小&家庭(本例中为13pt Consolas),这似乎已足够:
'(default ((t (:height 130 :family "Consolas"))))
答案 1 :(得分:6)
我开始工作的唯一方法就是手动修改.emacs文件:
(custom-set-faces
'(default ((t (:height 150 :family "Menlo"))))
)
PS:我在优胜美地上
答案 2 :(得分:0)
我有同样的问题。我认为这是因为Emacs没有编辑custom.el的权限,因此该文件仅在emacs中是只读的。
因此,我使用sudo vim ~/.emacs.d/custom.el
对其进行了编辑,并且效果很好。