Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is the .emacs file in windows GNU emacs

Tags:

path

emacs

winapi

Where is the .emacs file in windows (I'm using Emacs-23-CvsP091103-EmacsW32-1.58 )

When Emacs starts up, it attempts to load and execute the contents of a file commonly called .emacs (though it may have other names, see Where do I put my init file?) which contains any customizations you have made. You can manually add lisp code to your .emacs, or you can use the Customization interface accessible from the Options menu. If the file does not exist, Emacs will start with the default settings.

like image 449
iceman Avatar asked Dec 27 '09 16:12

iceman


2 Answers

In your home directory. You can set this directory by setting the HOME environment variable. If home isn't set, it will look in your Application Data directory. On XP, that's something like C:\Documents and Settings\<username>\Application Data, on Vista and later C:\Users\<username>\AppData.

If you open up emacs, and try editing (with C-x C-f) ~/.emacs, that should generally open up the .emacs that Emacs will be loading.

See the Windows Emacs FAQ for more details.

To set the HOME environment variable, open the System Control Panel, go to the Advanced tab, click Environment Variables, then click the New button in the "User variables" section.

like image 112
Brian Campbell Avatar answered Oct 23 '22 11:10

Brian Campbell


The best way to find out where .emacs resides by default on a particular system is without a doubt C-h v user-emacs-directory. The user-emacs-directory variable is platform dependent and is helpful on each and every OS.

like image 30
Bozhidar Batsov Avatar answered Oct 23 '22 11:10

Bozhidar Batsov