I am new to emacs and I am playing around with the .emacs file. How can I get it to reload all my definitions that I have updated in.emacs without restarting emacs?
+5
A:
you can use the command load-file (M-x load-file, then press return twice to accept the default filename, which is the current file being edited).
You can also just move the point to the end of any sexp and press c-x c-e to execute just that sexp. Usually it's not necessary to reload the whole file if you're just changing a line or two.
Bryan Oakley
2010-04-05 19:47:13
this worked the best, thanks
Zubair
2010-04-05 19:50:54
Keep in mind that this may not always do exactly what you think it does. If you have variables whose contents are flopped( ie setting a boolean to it's opposite) then the behavior won't be the same as loading the file.
chollida
2010-04-05 19:54:14
+1
A:
You can usually just re-evaluate the changed region. Mark the region of ~/.emacs that you've changed, and then use M-x eval-region RET
. This is often safer than re-evaluating the entire file since it's easy to write a .emacs file that doesn't work quite right after being loaded twice.
Dale Hagglund
2010-04-05 19:53:24