简体   繁体   English

Emacs - Ubuntu初始化

[英]Emacs - Ubuntu initialization

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". 在ubuntu上加载emacs的奇怪行为,似乎有一些初始化不在.emacs中,也不在emacs报告通过“emacs --debug-init”加载的任何文件中。 I've found some references to font-related resizing but this behavior doesn't seem to be limited to that (eg reappearing menus and toolbars). 我发现了一些与字体相关的大小调整的引用,但这种行为似乎并不局限于此(例如重新出现的菜单和工具栏)。

Does anyone have any additional information about the emacs initialization process? 有没有人有关于emacs初始化过程的任何其他信息? Does it load /etc/emacs/site-start.d files before or after the .emacs, and are there any other locations it loads by default? 它是否在.emacs之前或之后加载/etc/emacs/site-start.d文件,是否有默认加载的其他位置?

The sequence of the Emacs initialization is the following (at least, for Emacs 22): Emacs初始化的顺序如下(至少对于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. 加载在load-path中找到的文件debian-startup (.el或.elc)(通常是/usr/share/emacs/site-lisp/debian-startup.el/ usr / share / emacs22 / site-lisp / debian -startup.elc )并调用此文件中定义的debian-startup函数。 This function loads all files in /etc/emacs/site-start.d/ and /etc/emacs22/site-start.d/ . 此函数加载/etc/emacs/site-start.d//etc/emacs22/site-start.d/中的所有文件。
  2. Load site-start (.el or .elc) found in load-path . 加载在load-path中找到的site-start (.el或.elc)。
  3. Load your init file .emacs , .emacs.el or ~/.emacs.d/init.el . 加载init文件.emacs.emacs.el〜/ .emacs.d / init.el。
  4. Load a default init file default.el or default.elc . 加载默认初始化文件default.eldefault.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. 我还建议你阅读/usr/share/doc/emacsen-common/debian-emacs-policy.gz中的Emacs启动策略 ”部分,了解更多Ubuntu / Debian的具体信息。 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. 要查找奇怪行为的原因,您可以使用参数--no-site-file启动emacs并逐个加载这些初始化文件,直到找到导致此行为的文件。

I've found this official document that introduces the emacs init steps: http://www.gnu.org/software/emacs/manual/html_node/emacs/Init-File.html 我发现这个官方文档介绍了emacs init步骤: http//www.gnu.org/software/emacs/manual/html_node/emacs/Init-File.html

When Emacs is started, it normally tries to load a Lisp program from an initialization file, or init file for short. 当Emacs启动时,它通常会尝试从初始化文件或init文件加载一个Lisp程序。 This file, if it exists, specifies how to initialize Emacs for you. 此文件(如果存在)指定如何为您初始化Emacs。 Emacs looks for your init file using the filenames ~/.emacs, ~/.emacs.el, or ~/.emacs.d/init.el; Emacs使用文件名〜/ .emacs,〜/ .emacs.el或〜/ .emacs.d / init.el查找您的init文件; you can choose to use any one of these three names (see Find Init ). 您可以选择使用这三个名称中的任何一个(请参阅查找初始化 )。 Here, ~/ stands for your home directory. 这里,〜/代表你的主目录。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM