[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [h-e-w] HOME value for Portable Emacs
From: |
Jason Rumney |
Subject: |
Re: [h-e-w] HOME value for Portable Emacs |
Date: |
Tue, 06 Jan 2009 21:17:07 +0800 |
User-agent: |
Thunderbird 2.0.0.19 (Windows/20081209) |
Henri Fischer wrote:
My portable Emacs has "C:/Documents and
Settings/Administrator/Application Data/" as HOME. Since my USB is
used on different clients, I would like my portable Emacs to get
.emacs from one of its own folders. Is this possible? And if so, how?
Create a directory called site-lisp alongside your emacs directory. The
hierarchy should look like this:
...../emacs/bin
...../emacs/lisp
..... etc .....
...../site-lisp
It can also go inside the emacs directory, but it will make upgrading
Emacs easier if you keep them separate.
In that directory create a file called site-start.el with the following
contents:
;; Only if it looks like we're running on Windows
(if (and invocation-directory
(eq (string-match "[a-zA-Z]:" invocation-directory) 0))
(let ((drive (substring invocation-directory 0 1)))
(setenv "HOME" (concat drive ":/home"))))
If that doesn't work, you may need to set user-init-file back to
"~/.emacs.d/init.el" or "~/.emacs" (either will work in current
versions), as Emacs may have already worked out where the init file
should be by this point.