Emacs的启动顺序是什么?

时间:2010-07-28 00:59:59

标签: emacs

我找到.emacs和〜/ .emacs.d / init.el。

这些文件/目录的用途是什么? emacs的启动顺序是什么?有没有办法让emacs不读〜/ .emacs.d?

4 个答案:

答案 0 :(得分:16)

emacs -qemacs --no-init-file会导致emacs无法读取〜/ .emacs文件。如果有〜/ .emacs文件,则不应尝试读取〜/ .emacs.d。如果没有〜/ .emacs文件,它将读取〜/ .emacs.d / init.el。有关详细信息,请参阅emacs wiki

有关启动的信息,请参阅elisp manual

答案 1 :(得分:4)

详细解释了Emacs的启动程序here。 emacs lisp手册随附emacs,因此您应该参考网站上的链接手册而不是网页上的链接手册,因为前者将与您的emacs版本完全匹配。要访问它,请在emacs中输入C-h i m elisp RET m Starting Up RET

答案 2 :(得分:3)

基于sanityinc's answer,我在〜/ .emacs.d / init.el末尾添加了(消息“ * MESSAGE * ”)做了一些实验,我个人的el file(smcho.el)和.emacs.el,我打开了 Messages 缓冲区。

这是Aquamacs的结果。

Loading prestart plugin files ...
... done.
Shell: /bin/bash
Loading `emulate-mac-keyboard-mode': old-style backquotes detected!
Loading /Users/smcho/Library/Preferences/Aquamacs Emacs/Recent Files.el (source)...done
Cleaning up the recentf list...done (0 removed)
27 environment variables imported from login shell (/bin/bash).
Loading /Applications/Aquamacs.app/Contents/Resources/lisp/aquamacs/edit-modes/auctex.el (source)...done
Loading /Applications/Aquamacs.app/Contents/Resources/lisp/aquamacs/edit-modes/haskell-mode/haskell-site-file.el (source)...done
Loading plugins ...
Loading /Library/Application Support/Aquamacs Emacs/SLIME/site-start.el (source)...done
Loading /Applications/Aquamacs.app/Contents/Resources/lisp/aquamacs/site-start.el (source)...done
... done.
***** Hello from .emacs, and I'm with Aquamacs 
***** hello from smcho.el 
Loading /Users/smcho/Library/Preferences/Aquamacs Emacs/customizations.el (source)...done
Loading /Users/smcho/Library/Preferences/Aquamacs Emacs/Preferences.el (source)...done
Mark set
one-buffer-one-frame-mode disabled.
Loading /Users/smcho/Library/Preferences/Aquamacs Emacs/frame-positions.el (source)...done

它从.emacs和smcho.el读取,但不是从〜/ .emacs.d / init.el读取。 这是来自Aqua emacs。

Loading /Users/smcho/.emacs.d/package.el (source)...done
***** Hello from .emacs, and I'm with Aqua emacs
***** hello from smcho.el
For information about GNU Emacs and the GNU system, type C-h C-a.

它再次从〜/ .emacs.d / init.el读取,但是起点是〜/ .emacs.d / package.el。

答案 3 :(得分:1)

如果有.emacs文件,那么emacs不会加载〜/ .emacs.d / init.el文件,如果你想使用.emacs.d / init.el文件,你应该删除〜/ .emacs文件