Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

home directory and .emacs file in Windows 7

I installed emacs 23.3.1 in c:/emacs-23.3. Following the hints in this page, I updated the site-start.el to set HOME environment variable.

(setenv "HOME" "c:/users/USER/emacs")

And I made c:/users/USER/.emacs (like I did in unix/mac) to write the code for using slime, but it doesn't seem to start slime correctly.

Is this a correct way of setting emacs in Windows 7? Where do I put the .emacs file?

like image 811
prosseek Avatar asked Apr 11 '12 19:04

prosseek


People also ask

Where is the .Emacs file in Windows?

For Windows 10, find the place of the init file or GNU Emacs 25' the place of the . emacs file or . emacs. d folder is in the c:/Users/username/AppData/Roaming .

How do I create a .Emacs file?

To create a new file, use Control-X-Control-F, just as if the file already existed. When emacs asks you for the file name, type in the name you want your new file to have, and emacs will create the file, and display an empty buffer for you to type in. Emacs will perform file name completion for you.

Where is Emacs config file?

Emacs can also look in an XDG-compatible location for init. el , the default is the directory ~/. config/emacs .

Where do I find Emacs D?

emacs. d/ is the location for additional per-user Emacs-specific files written in the Emacs Lisp programming language. Since it is located in the home directory (~/), it is unique for each user, just like the ~/. emacs init file.


2 Answers

You need to set HOME in environment variables in Computer settings (if I remember correctly), or put init file to default directory (just start Emacs, and press C-x C-f ~/ to see what is actual directory). And as I remember, on Windows, init file could be called _emacs...

like image 192
Alex Ott Avatar answered Oct 11 '22 19:10

Alex Ott


I am running emacs as a portable app and this works very well for me:

Create a batch file in the root of your emacs directory. For example, I created:

C:\Dropbox\PortableApps\emacs-24.3\run_emacs_portable.bat

Then, edit the file and put this text into it:

set HOME=.\
bin\runemacs.exe %*

Now, I just launch emacs via the run_emacs_portable.bat file and my HOME folder always points to my emacs installation folder.

The %* allows you to pass arguments to the .bat file and have them forwarded to the runemacs.exe

like image 34
Matt Klein Avatar answered Oct 11 '22 19:10

Matt Klein