How to set up a .emacs initialization file

emacs

I am using Linux Fedora 13 (Constantine) and emacs 23.1.1. I am trying to set up a .emacs file for initialization, by using emacs itself to edit and save a file .emacs in my home directory. However, although the file is there, emacs does not seem to recognize it. What might I be doing wrong, and is there a simple text for .emacs that will show me if it is being used, one that will display a message on emacs start up?

Best Answer

The init file is traditionally ~/.emacs, but modern versions also look at other names. There may be confusion about what your home directory is (there shouldn't be on unix platforms, though; this is mostly a problem under Windows); opening ~/.emacs inside Emacs is always right. After Emacs has started, check for messages in the *Messages* buffer. Make sure you're not running Emacs with options like -q that would tell it to bypass your init file.

Related Question