From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#8221: 24.0.50; Allowed names for the init file. Windows/POSIX inconsistency Date: Fri, 11 Mar 2011 13:22:18 +0200 Message-ID: <83y64luck5.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1299843438 1401 80.91.229.12 (11 Mar 2011 11:37:18 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 11 Mar 2011 11:37:18 +0000 (UTC) Cc: lekktu@gmail.com, 8221-done@debbugs.gnu.org To: Dani Moncayo Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Mar 11 12:37:13 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Py0ee-0003cy-0M for geb-bug-gnu-emacs@m.gmane.org; Fri, 11 Mar 2011 12:37:12 +0100 Original-Received: from localhost ([127.0.0.1]:33046 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Py0ed-0005HV-6Z for geb-bug-gnu-emacs@m.gmane.org; Fri, 11 Mar 2011 06:37:11 -0500 Original-Received: from [140.186.70.92] (port=36249 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Py0eT-0005FW-BG for bug-gnu-emacs@gnu.org; Fri, 11 Mar 2011 06:37:02 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Py0eQ-00059J-Kf for bug-gnu-emacs@gnu.org; Fri, 11 Mar 2011 06:37:01 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:58498) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Py0eQ-00059F-Hc for bug-gnu-emacs@gnu.org; Fri, 11 Mar 2011 06:36:58 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1Py0Qw-0008BH-9r for bug-gnu-emacs@gnu.org; Fri, 11 Mar 2011 06:23:02 -0500 Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Fri, 11 Mar 2011 11:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 8221 X-GNU-PR-Package: emacs,w32 X-GNU-PR-Keywords: Mail-Followup-To: 8221@debbugs.gnu.org, eliz@gnu.org Original-Received: via spool by 8221-done@debbugs.gnu.org id=D8221.129984255231407 (code D ref 8221); Fri, 11 Mar 2011 11:23:02 +0000 Original-Received: (at 8221-done) by debbugs.gnu.org; 11 Mar 2011 11:22:32 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Py0QR-0008AW-WA for submit@debbugs.gnu.org; Fri, 11 Mar 2011 06:22:32 -0500 Original-Received: from mtaout20.012.net.il ([80.179.55.166]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Py0QP-0008AK-G9 for 8221-done@debbugs.gnu.org; Fri, 11 Mar 2011 06:22:30 -0500 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0LHW00B004INAD00@a-mtaout20.012.net.il> for 8221-done@debbugs.gnu.org; Fri, 11 Mar 2011 13:22:16 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([77.124.58.59]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LHW008DO4X2VMT0@a-mtaout20.012.net.il>; Fri, 11 Mar 2011 13:22:16 +0200 (IST) In-reply-to: X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Fri, 11 Mar 2011 06:23:02 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:44918 Archived-At: Version: 23.4 > Date: Fri, 11 Mar 2011 09:26:20 +0100 > From: Dani Moncayo > Cc: 8221@debbugs.gnu.org > > >> On the other hand, and according to the same info node, C:\ is checked > >> as one possible "home" directory. > > > > I think you're reading more that the info node says. What it says is > > that Emacs is looking for HOME (the environment variable) and if it > > finds it, it looks there for the "init file". If that fails, it looks > > for ".emacs" in C:\; and if that fails, it looks for the AppData dir > > (which is an alternative to HOME, not to C:\). So it is clear (if a > > bit inconsistent) that looking for .emacs (specifically) on C:\ > > (specifically) is something done just because of back compatibility. > > > > Yes, I got a bit confused about the exact procedure. Maybe I was > somewhat biased, but IMO the current wording is a bit confusing: > > 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 system call fails, Emacs falls back to `C:\'. > > That made me think that the principle was (a) Try to find a suitable > init file in several directories, and (b) Once an init file is found, > the "home" directory is thereafter established accordingly. > > Thus, I suggest to revise the wording in that node, to avoid this confusion. I modified the wording of that section, hopefully it's more clear now. The full text is below. I'm closing this bug; feel free to reopen if something is still unclear. @node Windows HOME @section HOME and Startup Directories on MS-Windows @cindex @code{HOME} directory on MS-Windows The Windows equivalent of the @code{HOME} directory is the @dfn{user-specific application data directory}. The actual location depends on your Windows version and system configuration; typical values are @file{C:\Documents and Settings\@var{username}\Application Data} on Windows 2K/XP/2K3, @file{C:\Users\@var{username}\AppData\Roaming} on Windows Vista/7/2K8, and either @file{C:\WINDOWS\Application Data} or @file{C:\WINDOWS\Profiles\@var{username}\Application Data} on the older Windows 9X/ME systems. If this directory does not exist or cannot be accessed, Emacs falls back to @file{C:\} as the default value of @code{HOME}. You can override this default value of @code{HOME} by explicitly setting the environment variable @env{HOME} to point to any directory on your system. @env{HOME} can be set either from the command shell prompt or from the @samp{My Computer}s @samp{Properties} dialog. @code{HOME} can also be set in the system registry, for details see @ref{MS-Windows Registry}. For compatibility with older versions of Emacs@footnote{ Older versions of Emacs didn't check the application data directory. }, if there is a file named @file{.emacs} in @file{C:\}, the root directory of drive @file{C:}, and @env{HOME} is set neither in the environment nor in the Registry, Emacs will treat @file{C:\} as the default @code{HOME} location, and will not look in the application data directory, even if it exists. Note that only @file{.emacs} is looked for in @file{C:\}; the older name @file{_emacs} (see below) is not. This use of @file{C:\.emacs} to define @code{HOME} is deprecated. Whatever the final place is, Emacs sets the internal value of the @env{HOME} environment variable to point to it, and it will use that location for other files and directories it normally looks for or creates in the user's home directory. You can always find out where Emacs thinks is your home directory's location by typing @kbd{C-x d ~/ @key{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 @kbd{C-x C-f ~/.emacs @key{RET}} (assuming the file's name is @file{.emacs}). @cindex init file @file{.emacs} on MS-Windows The home directory is where your init file is stored. It can have any name mentioned in @ref{Init File}. @cindex @file{_emacs} init file, MS-Windows 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 @file{_emacs} as a fallback, if such a file exists in the home directory, whereas @file{.emacs} does not.