[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
G.4 HOME Directory on MS-Windows
The Windows equivalent of the HOME
directory is the
user-specific application data directory. The actual location
depends on your Windows version and system configuration; typical values
are ‘C:\Documents and Settings\username\Application Data’ on
Windows 2K/XP and later, and either ‘C:\WINDOWS\Application Data’
or ‘C:\WINDOWS\Profiles\username\Application Data’ on the
older Windows 9X/ME systems.
The home directory is where your init file ‘.emacs’ is stored.
When Emacs starts, it first checks whether the environment variable
HOME
is set. If it is, it looks for the init file in the
directory pointed by HOME
. If HOME
is not defined, Emacs
checks for an existing ‘.emacs’ file in ‘C:\’, the root
directory of drive ‘C:’(23). If there's no such file in ‘C:\’, Emacs next uses the Windows
system calls to find out the exact location of your application data
directory. If that fails as well, Emacs falls back to ‘C:\’.
Whatever the final place is, Emacs sets the value of the HOME
environment variable to point to it, and it will use that location for
other files and directories it normally creates in the user's home
directory.
You can always find out where Emacs thinks is your home directory's location by typing C-x d ~/ <RET>. This should present the list of files in the home directory, and show its full name on the first line. Likewise, to visit your init file, type C-x C-f ~/.emacs <RET>.
Because MS-DOS does not allow file names with leading dots, and because older Windows systems made it hard to create files with such names, the Windows port of Emacs supports an alternative name ‘_emacs’ as a fallback, if such a file exists in the home directory, whereas ‘.emacs’ does not.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |