emacs如何选择要初始化的脚本?

emacs如何选择要初始化的脚本?,emacs,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.

在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设置运行emacs时,它不会正确设置字体,但会设置缩进和颜色。因此,我得出结论,当gnome第一次设置时,字体设置不起作用

在arch上,运行emacs看起来不错。但是如果我们加载文件和M-x eval缓冲区,字体就会改变。计算两次会再次更改字体。第三次评估什么也不做


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

我发现您的问题令人困惑。你说emacs是“由gnome设置运行”是什么意思?另外,您在问题的“arch”部分加载了什么文件?您可以检查
user init file
的值以查看使用了什么init脚本。您还可以在.Xresources(或arch的等效字体)中设置emacs字体,这将在emacs启动时额外节省时间。我发现您的问题令人困惑。你说emacs是“由gnome设置运行”是什么意思?另外,您在问题的“arch”部分加载了什么文件?您可以检查
user init file
的值以查看使用了什么init脚本。您还可以在.Xresources(或arch的等效字体)中设置emacs字体,这将额外节省emacs启动时间