Saltycrane logo

SaltyCrane Blog

Notes on Python, Django, and web development on Ubuntu Linux

    

How to reload your .emacs file while emacs is running

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

4 Comments — feed icon Comments feed for this post


#1 Rusmor commented on 2011-02-16:

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 2011-03-28:

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


#3 Robbie commented on 2011-06-30:

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 2011-12-31:

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"

(interactive)

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

Post a comment

Required
Required, but not displayed
Optional

Format using Markdown. (No HTML.)
  • Code blocks: prefix each line by at least 4 spaces or 1 tab (and a blank line before and after)
  • Code span: surround with backticks
  • Blockquotes: prefix lines to be quoted with >
  • Links: <URL>
  • Links w/ description: [description](URL)
Created with Django | Hosted by Linode