Tell me more ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 stackoverflow.com Nov 21 '09 at 12:04

5 Answers

Or, as a much simpler way (as pointed out in the comment) Ctrl + H v will describe the variable which produces much nicer output.

user-init-file is a variable defined in `C source code'.
Its value is 
"/home/.emacs"

Documentation:
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 .elc' extension.

This way is much more verbose. 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

user-init-file
"/home/.emacs"
share|improve this answer
2  
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
2  
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

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
1  
Also: Have you tried running Emacs once before expecting a configuration file in your home? – Joey Nov 20 '09 at 11:05

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 u will see it. then to edit it type gedit .emacs, i use gedit cuz i feel wierd 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 at 6:02

Your Answer

 
discard

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