Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

migrated from programmers.stackexchange.com Apr 9 '12 at 22:34

This question came from our site for professional programmers interested in conceptual questions about software development.

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.

share|improve this answer

You probably have an error in your .emacs file in your home directory. Try opening your .emacs file and then M-x eval-buffer RET to check if you see if you get any errors you might have missed. Emacs will run the .emacs file in any case.

share|improve this answer

If you put something illegal at the start of the .emacs file and emacs really is reading it, I would expect it to fail on startup. For example if I put a line containing

Hello William

at the first line of my .emacs the program gives me the warning

Symbol's value as variable is void: Hello

and fails to load the remainder of the file.

You could use strace (or the Fedora equivalent, perhaps truss, dtruss etc) to trace the system calls and look for where emacs tries to open .emacs in the output. For example under the bash shell:

strace emacs 2> strace-ouput.txt 
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.