95

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

bfavaretto
  • 71,580
  • 16
  • 111
  • 150
memius
  • 4,045
  • 5
  • 26
  • 25

9 Answers9

136

M-x eval-buffer

Martin Cote
  • 28,864
  • 15
  • 75
  • 99
26

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.

KeithB
  • 16,577
  • 3
  • 41
  • 45
10

In the *scratch* buffer, type:

(load-file user-init-file)

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

Michael
  • 776
  • 1
  • 11
  • 20
tkf
  • 997
  • 1
  • 7
  • 16
6

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

WisdomFusion
  • 440
  • 6
  • 12
6

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

Mario F
  • 45,569
  • 6
  • 37
  • 38
5
M-x load-file ENTER
~/.emacs
ENTER

(source)

Geremia
  • 4,745
  • 37
  • 43
4

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

Mark Roddy
  • 27,122
  • 19
  • 67
  • 71
1

I use and recommend restart-emacs package on melpa

Joe
  • 965
  • 11
  • 16
1

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.

Martin Josefsson
  • 953
  • 12
  • 24
Shantanu
  • 504
  • 5
  • 15