Home directory and .emacs file in Windows 7

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

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

And I did c: /users/USER/.emacs (as I did on unix / mac) to write the code for using slime, but it does not seem to run the slime correctly.

Is this the right way to install emacs on Windows 7? Where can I put the .emacs file?

+10
windows-7 installation emacs
Apr 11 '12 at 19:32
source share
7 answers

You need to set HOME in the environment variables in the computer settings (if I remember correctly), or put the initialization file in the default directory (just start Emacs and press Cx Cf ~/ to find out what the actual directory is). And, as I recall, in Windows init the file could be called _emacs ...

+18
Apr 11 '12 at 20:00
source share

I am running emacs as a portable application and it 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 in it:

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

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

% * allows you to pass arguments to a .bat file and forward them to runemacs.exe

+11
Aug 30 '13 at 21:01
source share

Inside the home directory, .emacs.d is created automatically, and you can make init.el as a boot file. Also refer to question .

+1
Apr 11 '12 at 23:24
source share

To configure the Emacs home folder in the Windows user folder (C: \ Users \ User \ .emacs.d), simply add this code to the current initialization file and restart Emacs.

 (when (eq system-type 'windows-nt) (unless (getenv "Home") (shell-command (format "setx \"%s\" \"%s\"" 'Home (getenv "UserProfile"))))) 
+1
Nov 29 '15 at 16:17
source share

you can run emacs, type Mx pwd and it will show you where you are in the windows file tree. You can place .emacs there.

0
Apr 11 '12 at 23:26
source share

On Windows, Emacs starts with specific properties found when you right-click on an executable file on your Windows system. There you can define

  • executable directory, for example. "C: \ Users \ loggedin_user \" (in brackets)

  • where emacs does

  • and searches for the .xemacs directory (.emacs), where it finds its init.el.

  • And where you can define startup instructions (for example (setenv "HOME" "c: / Users / Username /")), etc.

If you configure this, next time emacs will start from the directory you specified with the initialization file

0
Jan 29 '16 at 8:26
source share

If you want to use c: /users/USER/.emacs, you should set your HOME variable to c: / users / USER, not c: / users / USER / emacs.

0
May 16 '16 at
source share



All Articles