Emacs - Ubuntu initialization

前端 未结 2 1464
予麋鹿
予麋鹿 2021-02-04 16:50

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

相关标签:
2条回答
  • 2021-02-04 17:08

    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.

    0 讨论(0)
  • 2021-02-04 17:30

    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

    When Emacs is started, it normally tries to load a Lisp program from an initialization file, or init file for short. This file, if it exists, specifies how to initialize Emacs for you. Emacs looks for your init file using the filenames ~/.emacs, ~/.emacs.el, or ~/.emacs.d/init.el; you can choose to use any one of these three names (see Find Init). Here, ~/ stands for your home directory.

    0 讨论(0)
提交回复
热议问题