emacs file or . emacs. d folder is in the c:/Users/username/AppData/Roaming . Or some sources will write it as %HOMEPATH%\AppData\Roaming\.
el , Emacs finds this file via the standard search path for Lisp libraries.
User's Initialization File or dotemacs or init file is a file to store your configurations/customizations for Emacs written in Emacs Lisp, located at either ${HOME}/. emacs. d/init. el or (archaically) at ${HOME}/.
Copy and pasted from the Emacs FAQ, http://www.gnu.org/software/emacs/windows/:
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 Windows 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.
All the files mentioned above should go in your HOME directory. The HOME directory is determined by following the steps below:
C:\.emacs
exists, then use C:/
. This is for backward compatibility, as previous versions defaulted to C:/
if HOME was not set.Within Emacs, ~
at the beginning of a file name is expanded to your HOME directory, so you can always find your .emacs file with C-x C-f ~/.emacs
.
There's further information at HOME and Startup Directories on MS-Windows.
It should be stored in the variable user-init-file. Use C-H v user-init-file RET
to check. You can also open it directly by using M-x eval-expression RET (find-file user-init-file) RET
Open the file like this in Emacs for Windows:
C-x C-f ~/.emacs
More information in the Emacs Wiki
On my Vista box it's in C:\Users\<USER>\AppData\Roaming\
Note that it may NOT be enough to just type Ctrl-x Ctrl-f ~/.emacs
and create the file.
It may be that your Emacs application uses a different place to store your init file, and if so, then creating the file ~/.emacs simply creates a useless file which your Emacs application ignores.
Also, you may want to do more than just access the .emacs init file, but you may want to know where it is, i.e., its pathname.
To get at this there are two methods:
Easy way: type Ctrl + H V user-init-file Return
Slightly trickier way: You can find out where your system is storing its own .emacs file by:
In Windows 7 put your init.el
file in C:\Users\user-name\AppData\Roaming\.emacs.d\
, where user-name is your user/login folder.
Take care so your init.el
file won't be named init.el.txt
. This is something Windows does if you create your file with some editor like Notepad.
On versions of Emacs on Windows above 22, it seems to have moved to
~/.emacs.d/init.el
, ~
being the value of your environment variable HOME (see Control Panel → System → Advanced → Environment variables).
The file itself might not exist. In that case just create it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With