Super User is a question and answer site for computer enthusiasts and power users. 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 downloaded emacs 23.1 from gnu's ftp. untarred it and built it after configuring. I do not find .emacs file in my home directory or anywhere in my system ! Am i missing something ?

share|improve this question

migrated from Nov 21 '09 at 12:04

This question came from our site for professional and enthusiast programmers.

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:

share|improve this answer
Ctrl-H v (describe-variable) to look at a variable. – starblue Nov 20 '09 at 11:27
Thanks, I hadn't seen that before! – Jeff Foster Nov 20 '09 at 11:55

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.

share|improve this answer
Exactly, just "C-x f ~/.emacs" and then go ahead and add your stuff. No .emacs will be generated automatically. – danielpoe Nov 20 '09 at 11:57
C-x C-f ~/.emacs . C-x f is set-fill-column. – Alan Shutko May 9 '14 at 22:12

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 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
share|improve this answer

have you tried ls -a ?

share|improve this answer
Also: Have you tried running Emacs once before expecting a configuration file in your home? – Joey Nov 20 '09 at 11:05

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 ~).

share|improve this answer

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

share|improve this answer

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.


share|improve this answer

Simple answer. You have to start writing some code in emacs before the .emacs file appears in your home directory. Write some quick hello worlds 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 type gedit .emacs, I use gedit because I feel weird editing emacs, with emacs. good luck!

share|improve this answer
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 '13 at 6:02

You must log in to answer this question.