I have installed emacs, specifically GNU Emacs for Windows x86. After installation, I can't find .emacs file. I have the .eamcs.d folder which contains other customization files that will be loaded by .emacs file.

Can you please give me a hint where it could be present. It is not in ~/ location.

I believe it is possible for the .emacs file to not exist. In such a case, where can I create this file on my own if I finally have to?

(I am an emacs newbie.)


My answer to a similar question about the same issue:

emacs will not create the config file for you. If you wish to make configurations you can create the file manually and start your configuration. You should place it in your home directory.

You could also use M-x customize to use emacs's inbuilt customization tool. Any changes saved in customize will be saved in your .emacs file (a new one will be created if one does't already exist).

Specifically, in your case you could find the file in emacs C-xC-f and enter ~/.emacs Enter.

You could then run the print working directory command: M-x pwd Enter this will tell you where the file is on disk.

If you were perverse you could then run the explorer shell command to open that location: M-! explorer . Enter

Note: M-! is Shift+Alt+1 (on a standard english keyboard).


Try C-x C-f and enter ~/.emacs. This file normally lives under C:\Documents and Settings\Application Data\<your_username>. (Edit: fixed the directory based on comments by kjfletch.)

Actually in your scratch buffer, type (expand-file-name "~/.emacs") and move your cursor right behind the closing parenthesis, press C-j or C-x C-e to evaluate it. The result is the full path for your .emacs.

  • C:\Documents and Settings\<your_username>\Application Data\ on the XP system I use. – kjfletch Jan 27 '12 at 10:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.