首页 > 解决方案 > emacs 如何选择使用哪个脚本进行初始化?

问题描述

在 Ubuntu 18.10 上的 emacs 25.2.2 和 arch 上的 26.2 中,我们都遇到了以下奇怪的行为:

Ubuntu 18:我的主目录中有一个 .emacs 文件。如果我运行 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.
 '(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 bold :height 180 :width normal :foundry "urw" :family "Nimbus Mono L")))))
(set-background-color "black")
(set-foreground-color "green")  

当 gnome-settings 运行 emacs 时,它不会正确设置字体,但会设置缩进和颜色。因此,我得出结论,首次设置 gnome 时字体设置不起作用。

在 arch 上,运行 emacs 看起来不错。但是,如果我们加载文件并 Mx eval-buffer 字体会发生变化。评估两次会再次更改字体。eval 第三次什么也没做。

谁能解释发生了什么,以及无论何时运行命令,我们如何可靠地选择字体?

标签: emacs

解决方案


推荐阅读