help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Can't find .emacs file on Windows (was: Re: On Edit GNU Emacs 22.2.1 Eat


From: Charles Sebold
Subject: Can't find .emacs file on Windows (was: Re: On Edit GNU Emacs 22.2.1 Eats My Blank Characters At The End Of Lines)
Date: Thu, 11 Sep 2008 10:33:32 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (windows-nt)

Changing the subject line when you're changing the subject will help
more people see your question.

On 11 Sep 2008, ChristopherL wrote:

> I'm using Windows XP and can't seem to find my .emacs file!
>
> First, on windows filenames can't begin with a dot.

On modern Windows, they usually can.  I used to use .emacs (and now
~/.emacs.d/init.el) without problems.  You can also use _emacs instead
of .emacs.

>From the Emacs manual (which came with Emacs, hit C-h r to get there):

,----[ <Info:(emacs)Windows HOME> ]
| 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:'(1).  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.
`----

-- 
Charles Sebold                                    11th of September, 2008


reply via email to

[Prev in Thread] Current Thread [Next in Thread]