Search code examples
emacsdirectoryinitializationhome-directory

change .emacs file's location


I am working on windows xp

I stored emacs in usb

I want to carry the .emacs file as well as binary files

what I tried are

(setenv “HOME” (format "%s" (getenv "emacspath")))

(setenv “HOME” (format "%s/" (getenv "emacspath")))

It seems works if I eval-expression in emacs

After setenv, I could notice setting env is works well by (getenv "home")

but I put the (setenv "home" (format "%s/" (getenv "emacspath"))) in "site-start.el" file in "site-lisp" folder, starting emacs says "Symbol's value as variable is void: "HOME"

Any ideas?


Solution

  • An easier way - just create a batch file on your USB drive where you can set all env variables you need. Then start emacs.exe from the batch.

    For example if you want to run SBCL add the following lines to your batch

    rem SBCL_HOME is required for SBCL
    set SBCL_HOME=%utils%\Lisp\sbcl\1.0.29
    set SBCL_RUN=%SBCL_HOME%\sbcl.exe
    set SBCL_OPTIONS=--noinform