SaltyCrane Blog — Notes on JavaScript and web development

How to reload your .emacs file while emacs is running

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


#1 Rusmor commented on :

This does not reset any indentations, specified in the .emacs file, so it is not the full equivalent of a start up.

For example: ;; --- Automatic indentation must use only 1 unit (tab) (add-hook 'c-special-indent-hook '( lambda() (set-variable 'c-basic-offset '2)))

#2 Eliot commented on :

Rusmor: yes, I often have to completely restart emacs instead of using this.

#3 Robbie commented on :

The suggested strategy is not guaranteed to give you a totally revised configuration. It will parse your new configuration file and it will reload modified variable and function definitions. But it will not remove previously loaded definitions. For that to happen, you need to restart Emacs afresh.

#4 plgx commented on :

It may not work for all your needs, but it's quite useful all the same.

I'll use it with M-x reload-dotemacs-file by adding to my .emacs file:

(defun reload-dotemacs-file ()

"reload your .emacs file without restarting Emacs"


(load-file "~/.emacs") )