I downloaded Emacs 23.1 from GNU's FTP site. I untarred it and built it after configuring.

I do not find the .emacs file in my home directory or anywhere in my system! Am I missing something?

8 Answers 8


Or, as a much simpler way (as pointed out in the comment), Ctrl+H, v (describe-variable) will bring up nice output describing the variable and its value, like so:

    user-init-file is a variable defined in ‘C source code’.
    Its value is

File name, including directory, of user's initialization file. If the file loaded had extension ‘.elc’, and the corresponding source file exists, this variable contains the name of source file, suitable for use by functions like ‘custom-save-all’ which edit the init file. While Emacs loads and evaluates the init file, value is the real name of the file, regardless of whether or not it has the &lsquo'.elc’ extension.

This way is quite verbose. A more concise answer is to start up emacs and, in your Lisp evaluation buffer, type user-init-file and press Ctrl+J to evaluate. This will print out where your init file is, like so:


You have to create the file if you want to configure Emacs. You can just create it and start hacking the file manually or use M-x customize and save the customization.


See InitFile chapter in EmacsWiki.

Your init file contains personal EmacsLisp code that you want to execute when you start Emacs.

  • For GnuEmacs, it is ~/.emacs or .emacs.el or ~/.emacs.d/init.el.
  • For XEmacs, it is ~/.xemacs or ~/.xemacs/init.el.
  • For AquamacsEmacs, it is ~/.emacs or ~/Library/Preferences/Aquamacs Emacs/Preferences.el
  • 1
    Gabor, what is the difference between file types here? I have .emacs.d/. Should I make a init.el file here in this directory? Does the directory matter as a placement?
    – Vass
    Sep 11, 2016 at 22:14
  • @Vass These days it's more common to use .emacs.d/init.el because than you can store other elisp customizations in that directory too. However you can have only a single .emacs file, it works as well.
    – viam0Zah
    May 17 at 20:25

Did you check that neither .emacs nor .emacs.d/init.el exists? Because the latter seems to become more and more the standard (one file less in ~).

  • 1
    What happens if you put it in the wrong place? is the directory arbitrary?
    – Vass
    Sep 11, 2016 at 22:16

On Windows, the .emacs file may be called _emacs for backward compatibility with DOS and FAT filesystems where filenames could not start with a dot. Some users prefer to continue using such a name, because Explorer cannot create a file with a name starting with a dot, even though the filesystem and most other programs can handle it. In Emacs 22 and later, the init file may also be called .emacs.d/init.el. Many of the other files that are created by lisp packages are now stored in the .emacs.d directory too, so this keeps all your Emacs related files in one place.

source: http://www.gnu.org/software/emacs/manual/html_mono/efaq-w32.html#Init-file

  • so the directory of the init file is just a convention? Simply a standard which emacs automatically looks up and you put your personal choices in a file of lisp commands to tailor emacs?
    – Vass
    Sep 11, 2016 at 22:18
  • On Windows 10, I have found it to be in two different directories on two different computers: "C:\Users\username\" on one, and in "C:\Users\username\AppData\Roaming\" on the other. Oct 2, 2017 at 12:54

You should try ls -a.


  • 1
    Also: Have you tried running Emacs once before expecting a configuration file in your home?
    – Joey
    Nov 20, 2009 at 11:05
  • In what context? On the command line (which working directory)? From within Emacs? Apr 16, 2017 at 21:44

Simple answer. You have to start writing some code in Emacs before the .emacs file appears in your home directory. Write some quick Hello, World!s and simple math code, compile and run.

Then look again in home, and type ls -a and you will see it. Then to edit it and type gedit .emacs. I use gedit because I feel weird editing Emacs, with Emacs.

  • Why would you use anything other than Emacs to edit a file of elisp code? You can always start a new instance (with emacs -q if your init file is broken, and you need to bypass it). Also, there's no requirement for Emacs to generate your init file for you. You can go ahead and create it manually; Emacs will still use it.
    – phils
    Mar 7, 2013 at 6:02

Like other programmes, you can copy /etc/[what file do you want] to your home directory that your system uses for its settings.

Your Answer

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