Reload configurations without restarting Emacs

强颜欢笑 提交于 2019-11-27 09:11:57

问题


How do I load the edited .emacs file without restarting Emacs?


回答1:


M-x eval-buffer




回答2:


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.




回答3:


In the *scratch* buffer, type:

(load-file user-init-file)

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




回答4:


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




回答5:


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




回答6:


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

(source)




回答7:


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




回答8:


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.



来源:https://stackoverflow.com/questions/167705/reload-configurations-without-restarting-emacs

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!