Emacs - Ubuntu初始化 [英] Emacs - Ubuntu initialization

查看:162
本文介绍了Emacs - Ubuntu初始化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在ubuntu上加载emacs的奇怪行为,似乎有一些初始化不在.emacs中,也没有任何emacs文件通过emacs --debug-init报告加载。我已经找到一些关于字体相关大小调整的引用,但是这种行为似乎并不局限于此(例如重现的菜单和工具栏)。有没有人有任何有关emacs初始化过程的其他信息?/ p>


它是否在.emacs之前或之后加载/etc/emacs/site-start.d文件,还有默认加载的其他位置?

解决方案

Emacs初始化的顺序如下(至少对于Emacs 22):


  1. 加载 load-path 中的文件 debian-startup (.el或.elc)(通常是 / usr / share / emacs / site-lisp / debian-startup.el /usr/share/emacs22/site-lisp/debian-startup.elc ),并调用定义的功能 debian-startup 这个文件。此功能将加载/etc/emacs/site-start.d/ 和 /etc/emacs22/site-start.d/ 中的所有文件。

  2. 加载 site-start (.el或.elc)在 load-path 中找到

  3. 加载你的init文件 .emacs .emacs.el 〜/ .emacs.d / init.el

  4. 加载默认的init文件 default.el default.elc

我还建议您阅读更多Ubuntu中的 /usr/share/doc/emacsen-common/debian-emacs-policy.gz 中的 Emacs启动策略部分/ Debian具体信息。要查找奇怪行为的原因,您可以使用参数 - 无站点文件启动emacs,并逐个加载这些init文件,直到找到导致此行为的文件。


Odd behavior loading emacs on ubuntu, there seems to be some initialization that goes on that is not in the .emacs nor in any of the files emacs reports loading through "emacs --debug-init". I've found some references to font-related resizing but this behavior doesn't seem to be limited to that (e.g reappearing menus and toolbars).

Does anyone have any additional information about the emacs initialization process? Does it load /etc/emacs/site-start.d files before or after the .emacs, and are there any other locations it loads by default?

解决方案

The sequence of the Emacs initialization is the following (at least, for Emacs 22):

  1. Load the file debian-startup (.el or .elc) found in load-path (usually, /usr/share/emacs/site-lisp/debian-startup.el or /usr/share/emacs22/site-lisp/debian-startup.elc) and call the function debian-startup defined in this file. This function loads all files in /etc/emacs/site-start.d/ and /etc/emacs22/site-start.d/.
  2. Load site-start (.el or .elc) found in load-path.
  3. Load your init file .emacs, .emacs.el or ~/.emacs.d/init.el.
  4. Load a default init file default.el or default.elc.

I also suggest you reading the section "Emacs startup strategy" in /usr/share/doc/emacsen-common/debian-emacs-policy.gz for more Ubuntu/Debian specific information. To find the reason of odd behavior you can start emacs with the argument --no-site-file and load these init files one by one until you find a file that causes this behavior.

这篇关于Emacs - Ubuntu初始化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆