重新加载配置而不重新启动 Emacs

如何加载编辑的 .emacs文件而不重新启动 Emacs?

27592 次浏览

M-x eval-buffer

Open the .emacs file, select its contents and hit C-x,C-e

M-x load-file and then choose the .emacs file should also work

I usually use M-x load-file. But be aware that some initialization is only done the first time through. Things like libraries that set their defaults when loaded, but don't get reloaded the second time through. Its always a good idea to start up emacs from scratch as a final check that everything works ok.

In the *scratch* buffer, type:

(load-file user-init-file)

Then press C-x C-e to evaluate the expression.

you can use C-x C-e which will evaluate an s-expression. Make sure the cursor is at the last parenthesis of the elisp code.

M-x load-file ~/.emacs

eval-buffer when the .emacs file is opened

eval-region when you want apply selected lines

C-x C-e evaluates the preceding expression

M-x load-file ENTER
~/.emacs
ENTER

(source)

I use and recommend restart-emacs package on melpa