GNU bug report logs - #8221
24.0.50; Allowed names for the init file. Windows/POSIX inconsistence.

Previous Next

Packages: emacs, w32;

Reported by: Dani Moncayo <dmoncayo <at> gmail.com>

Date: Thu, 10 Mar 2011 21:37:02 UTC

Severity: wishlist

Found in version 24.0.50

Fixed in version 23.4

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 8221 in the body.
You can then email your comments to 8221 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8221; Package emacs. (Thu, 10 Mar 2011 21:37:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Dani Moncayo <dmoncayo <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 10 Mar 2011 21:37:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Dani Moncayo <dmoncayo <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.0.50; Allowed names for the init file. Windows/POSIX inconsistence.
Date: Thu, 10 Mar 2011 22:36:41 +0100
Severity: wishlist

Hello,

I've been reading the documented behavior of Emacs with respect to the
way it looks for the init file during startup.  This is explained in
the nodes "Init File" (for POSIX systems, I guess) and "Windows HOME" (for
MS Windows platforms).

According to the documentation (and the quick test I've done), we have this:
- On Windows systems, Emacs tries to find the init file by cheking (in
  several paths) for the existence of a file named `.emacs'.
- On POSIX systems, Emacs accepts the following alternatives as init
  file: `~/.emacs', `~/.emacs.el', or `~/.emacs.d/init.el'

So, the question is, why this inconsistence? i.e., why not accept on
Windows the same alternatives for the name of the init file as on
POSIX systems?

For example: Why not accept "<path>\.emacs.d\.init.el" as a valid init
file on Windows? (<path> being _any_ of the directories that Emacs
currently checks for the `.emacs' file)


-- 
Dani Moncayo




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8221; Package emacs. (Thu, 10 Mar 2011 22:19:02 GMT) Full text and rfc822 format available.

Message #8 received at 8221 <at> debbugs.gnu.org (full text, mbox):

From: Dani Moncayo <dmoncayo <at> gmail.com>
To: 8221 <at> debbugs.gnu.org
Subject: Re: bug#8221: 24.0.50;
	Allowed names for the init file. Windows/POSIX inconsistency
Date: Thu, 10 Mar 2011 23:17:58 +0100
On Thu, Mar 10, 2011 at 22:36, Dani Moncayo <dmoncayo <at> gmail.com> wrote:
> So, the question is, why this inconsistence?
                                ^^^^^^^^^^^^^

By "inconsistence" I meant "inconsistency". Forgive my imperfect English...

-- 
Dani Moncayo




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8221; Package emacs,w32. (Thu, 10 Mar 2011 23:00:02 GMT) Full text and rfc822 format available.

Message #11 received at 8221 <at> debbugs.gnu.org (full text, mbox):

From: Jason Rumney <jasonr <at> gnu.org>
To: Dani Moncayo <dmoncayo <at> gmail.com>
Cc: 8221 <at> debbugs.gnu.org
Subject: Re: bug#8221: 24.0.50;
	Allowed names for the init file. Windows/POSIX inconsistence.
Date: Fri, 11 Mar 2011 06:59:18 +0800
Dani Moncayo <dmoncayo <at> gmail.com> writes:

> So, the question is, why this inconsistence? i.e., why not accept on
> Windows the same alternatives for the name of the init file as on
> POSIX systems?

We do.




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8221; Package emacs,w32. (Thu, 10 Mar 2011 23:37:02 GMT) Full text and rfc822 format available.

Message #14 received at 8221 <at> debbugs.gnu.org (full text, mbox):

From: Dani Moncayo <dmoncayo <at> gmail.com>
To: Jason Rumney <jasonr <at> gnu.org>
Cc: 8221 <at> debbugs.gnu.org
Subject: Re: bug#8221: 24.0.50;
	Allowed names for the init file. Windows/POSIX inconsistency
Date: Fri, 11 Mar 2011 00:35:54 +0100
On Thu, Mar 10, 2011 at 23:59, Jason Rumney <jasonr <at> gnu.org> wrote:
> Dani Moncayo <dmoncayo <at> gmail.com> writes:
>
>> So, the question is, why this inconsistence? i.e., why not accept on
>> Windows the same alternatives for the name of the init file as on
>> POSIX systems?
>
> We do.
>

On one hand, it doesn't seem to be the documented behavior in the node
"Windows HOME" of the manual. It refers to the init file as `.emacs',
and says nothing about possible alternatives.

On the other hand, and according to the same info node, C:\ is checked
as one possible "home" directory. Thus, init files such as
"C:\.emacs.el" or "C:\.emacs.d\init.el" should be valid ones. But I've
just tested those two and Emacs don't find them.

-- 
Dani Moncayo




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8221; Package emacs,w32. (Fri, 11 Mar 2011 02:42:02 GMT) Full text and rfc822 format available.

Message #17 received at 8221 <at> debbugs.gnu.org (full text, mbox):

From: Juanma Barranquero <lekktu <at> gmail.com>
To: Dani Moncayo <dmoncayo <at> gmail.com>
Cc: 8221 <at> debbugs.gnu.org
Subject: Re: bug#8221: 24.0.50;
	Allowed names for the init file. Windows/POSIX inconsistence.
Date: Fri, 11 Mar 2011 03:40:15 +0100
On Thu, Mar 10, 2011 at 22:36, Dani Moncayo <dmoncayo <at> gmail.com> wrote:

> For example: Why not accept "<path>\.emacs.d\.init.el" as a valid init
> file on Windows? (<path> being _any_ of the directories that Emacs
> currently checks for the `.emacs' file)

Emacs on Windows currently *does* support %HOME%/.emacs.d/init.el and
%APPDATA%/.emacs.d/init.el.

It does not support C:\.emacs.d\init.el (unless you set HOME=C:\) and
that's a feature IMHO.

    Juanma




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8221; Package emacs,w32. (Fri, 11 Mar 2011 02:51:02 GMT) Full text and rfc822 format available.

Message #20 received at 8221 <at> debbugs.gnu.org (full text, mbox):

From: Juanma Barranquero <lekktu <at> gmail.com>
To: Dani Moncayo <dmoncayo <at> gmail.com>
Cc: 8221 <at> debbugs.gnu.org, Jason Rumney <jasonr <at> gnu.org>
Subject: Re: bug#8221: 24.0.50;
	Allowed names for the init file. Windows/POSIX inconsistency
Date: Fri, 11 Mar 2011 03:49:58 +0100
On Fri, Mar 11, 2011 at 00:35, Dani Moncayo <dmoncayo <at> gmail.com> wrote:

> On one hand, it doesn't seem to be the documented behavior in the node
> "Windows HOME" of the manual. It refers to the init file as `.emacs',
> and says nothing about possible alternatives.

The alternatives are documented on "53.6 The Init File, `~/.emacs'";
there's no need to duplicate it on "G.5 HOME and Startup Directories
on MS-Windows".

> 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.

> Thus, init files such as
> "C:\.emacs.el" or "C:\.emacs.d\init.el" should be valid ones. But I've
> just tested those two and Emacs don't find them.

If you ask me, not even C:\.emacs should be valid; "set HOME=C:\"
should be required for that.

    Juanma




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8221; Package emacs,w32. (Fri, 11 Mar 2011 08:27:02 GMT) Full text and rfc822 format available.

Message #23 received at 8221 <at> debbugs.gnu.org (full text, mbox):

From: Dani Moncayo <dmoncayo <at> gmail.com>
To: Juanma Barranquero <lekktu <at> gmail.com>
Cc: 8221 <at> debbugs.gnu.org, Jason Rumney <jasonr <at> gnu.org>
Subject: Re: bug#8221: 24.0.50;
	Allowed names for the init file. Windows/POSIX inconsistency
Date: Fri, 11 Mar 2011 09:26:20 +0100
Hi Juanma,

On Fri, Mar 11, 2011 at 03:49, Juanma Barranquero <lekktu <at> gmail.com> wrote:
> On Fri, Mar 11, 2011 at 00:35, Dani Moncayo <dmoncayo <at> gmail.com> wrote:
>
>> On one hand, it doesn't seem to be the documented behavior in the node
>> "Windows HOME" of the manual. It refers to the init file as `.emacs',
>> and says nothing about possible alternatives.
>
> The alternatives are documented on "53.6 The Init File, `~/.emacs'";
> there's no need to duplicate it on "G.5 HOME and Startup Directories
> on MS-Windows".
>

Indeed, that is the node which explains the alternatives, and of
course I agree that such info shouldn't be duplicated in any other
node of the Manual. Instead of duplicating, the others nodes (IMO)
should refer to the init file as `init file' (maybe giving a link to
the suitable node), but not as `.emacs', as we currently have in node
"Windows HOME".


>> 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.

>> Thus, init files such as
>> "C:\.emacs.el" or "C:\.emacs.d\init.el" should be valid ones. But I've
>> just tested those two and Emacs don't find them.
>
> If you ask me, not even C:\.emacs should be valid; "set HOME=C:\"
> should be required for that.
>
I agree, because IMO the init file should always be user-specific, and
C:\ isn't a user-specific directory.


-- 
Dani Moncayo




Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Fri, 11 Mar 2011 11:23:02 GMT) Full text and rfc822 format available.

Notification sent to Dani Moncayo <dmoncayo <at> gmail.com>:
bug acknowledged by developer. (Fri, 11 Mar 2011 11:23:02 GMT) Full text and rfc822 format available.

Message #28 received at 8221-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Dani Moncayo <dmoncayo <at> gmail.com>
Cc: lekktu <at> gmail.com, 8221-done <at> debbugs.gnu.org
Subject: Re: bug#8221: 24.0.50;
	Allowed names for the init file. Windows/POSIX inconsistency
Date: Fri, 11 Mar 2011 13:22:18 +0200
Version: 23.4

> Date: Fri, 11 Mar 2011 09:26:20 +0100
> From: Dani Moncayo <dmoncayo <at> gmail.com>
> Cc: 8221 <at> 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 <at> 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.





Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8221; Package emacs,w32. (Fri, 11 Mar 2011 11:27:02 GMT) Full text and rfc822 format available.

Message #31 received at 8221 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Juanma Barranquero <lekktu <at> gmail.com>
Cc: 8221 <at> debbugs.gnu.org, dmoncayo <at> gmail.com
Subject: Re: bug#8221: 24.0.50;
	Allowed names for the init file. Windows/POSIX inconsistency
Date: Fri, 11 Mar 2011 13:26:09 +0200
> From: Juanma Barranquero <lekktu <at> gmail.com>
> Date: Fri, 11 Mar 2011 03:49:58 +0100
> Cc: 8221 <at> debbugs.gnu.org
> 
> On Fri, Mar 11, 2011 at 00:35, Dani Moncayo <dmoncayo <at> gmail.com> wrote:
> 
> > On one hand, it doesn't seem to be the documented behavior in the node
> > "Windows HOME" of the manual. It refers to the init file as `.emacs',
> > and says nothing about possible alternatives.
> 
> The alternatives are documented on "53.6 The Init File, `~/.emacs'";
> there's no need to duplicate it on "G.5 HOME and Startup Directories
> on MS-Windows".

Right.  So I added a cross-reference there in the G.5 section.




Message #32 received at 8221-done <at> debbugs.gnu.org (full text, mbox):

From: Dani Moncayo <dmoncayo <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: lekktu <at> gmail.com, 8221-done <at> debbugs.gnu.org
Subject: Re: bug#8221: 24.0.50;
	Allowed names for the init file. Windows/POSIX inconsistency
Date: Fri, 11 Mar 2011 12:36:23 +0100
On Fri, Mar 11, 2011 at 12:22, Eli Zaretskii <eliz <at> gnu.org> wrote:
>
> I modified the wording of that section, hopefully it's more clear
> now.  The full text is below.
>

Thanks a lot. I think it far clearer now.

-- 
Dani Moncayo




Message #33 received at 8221-done <at> debbugs.gnu.org (full text, mbox):

From: Juanma Barranquero <lekktu <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 8221-done <at> debbugs.gnu.org, Dani Moncayo <dmoncayo <at> gmail.com>
Subject: Re: bug#8221: 24.0.50;
	Allowed names for the init file. Windows/POSIX inconsistency
Date: Fri, 11 Mar 2011 13:51:38 +0100
On Fri, Mar 11, 2011 at 12:22, Eli Zaretskii <eliz <at> gnu.org> wrote:

> I modified the wording of that section, hopefully it's more clear now.

*Much* clearer. Thanks.

    Juanma




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 09 Apr 2011 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 14 years and 133 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.