unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* %AppData% on Windows instead of %UserProfile% by default?
@ 2014-11-10 16:26 Alexander Shukaev
  2014-11-10 16:48 ` Óscar Fuentes
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Alexander Shukaev @ 2014-11-10 16:26 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 405 bytes --]

Hey guys,

Could you give some motivation behind using %AppData% on Windows instead of
%UserProfile% by default for "emacs.d" location? Also, why is the location
of "emacs.d" on Windows is primarily controlled by %HOME%, rather than
%UserProfile% once again? %HOME% is not a native environment variable on
Windows, while %UserProfile% is. Please, let's be consistent across
platforms.

Regards,
Alexander

[-- Attachment #2: Type: text/html, Size: 512 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: %AppData% on Windows instead of %UserProfile% by default?
  2014-11-10 16:26 %AppData% on Windows instead of %UserProfile% by default? Alexander Shukaev
@ 2014-11-10 16:48 ` Óscar Fuentes
  2014-11-10 16:54   ` Eli Zaretskii
  2014-11-10 17:04 ` Eli Zaretskii
  2014-11-12 15:14 ` Matthias Meulien
  2 siblings, 1 reply; 10+ messages in thread
From: Óscar Fuentes @ 2014-11-10 16:48 UTC (permalink / raw)
  To: emacs-devel

Alexander Shukaev <haroogan@gmail.com> writes:

> Could you give some motivation behind using %AppData% on Windows instead of
> %UserProfile% by default for "emacs.d" location? Also, why is the location
> of "emacs.d" on Windows is primarily controlled by %HOME%, rather than
> %UserProfile% once again? %HOME% is not a native environment variable on
> Windows, while %UserProfile% is. Please, let's be consistent across
> platforms.

If I define %HOME%, I expect from Emacs to use it as in the other
platforms. %HOME% must take precedence over platform-specific
environment variables, precisely because it is not defined by default.




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: %AppData% on Windows instead of %UserProfile% by default?
  2014-11-10 16:48 ` Óscar Fuentes
@ 2014-11-10 16:54   ` Eli Zaretskii
  2014-11-10 18:26     ` Óscar Fuentes
  0 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2014-11-10 16:54 UTC (permalink / raw)
  To: Óscar Fuentes; +Cc: emacs-devel

> From: Óscar Fuentes <ofv@wanadoo.es>
> Date: Mon, 10 Nov 2014 17:48:18 +0100
> 
> If I define %HOME%, I expect from Emacs to use it as in the other
> platforms.

It does.  I've been doing that on Windows for many years.




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: %AppData% on Windows instead of %UserProfile% by default?
  2014-11-10 16:26 %AppData% on Windows instead of %UserProfile% by default? Alexander Shukaev
  2014-11-10 16:48 ` Óscar Fuentes
@ 2014-11-10 17:04 ` Eli Zaretskii
  2014-11-10 17:49   ` Alexander Shukaev
  2014-11-11 21:46   ` Fabrice Popineau
  2014-11-12 15:14 ` Matthias Meulien
  2 siblings, 2 replies; 10+ messages in thread
From: Eli Zaretskii @ 2014-11-10 17:04 UTC (permalink / raw)
  To: Alexander Shukaev; +Cc: emacs-devel

> Date: Mon, 10 Nov 2014 17:26:12 +0100
> From: Alexander Shukaev <haroogan@gmail.com>
> 
> Could you give some motivation behind using %AppData% on Windows instead of
> %UserProfile% by default for "emacs.d" location?

First, %AppData% is a subdirectory of %UserProfile%, so it's not like
this is a totally different place.

More importantly, we are following the platform guidelines, which
say:

CSIDL_PROFILE          Version 5.0. The user's profile folder.  A typical
FOLDERID_Profile       path is C:\Users\username.
                       Applications should not create files or folders
		       at this level; they should put their data under
		       the locations referred to by CSIDL_APPDATA or
		       CSIDL_LOCAL_APPDATA. 

(You can see this at
http://msdn.microsoft.com/en-us/library/windows/desktop/bb762494%28v=vs.85%29.aspx.)

> Also, why is the location of "emacs.d" on Windows is primarily
> controlled by %HOME%, rather than %UserProfile% once again? %HOME%
> is not a native environment variable on Windows, while %UserProfile%
> is.

When Emacs on Windows starts up, if %HOME% is not defined in the
environment already, Emacs defines it to refer to %AppData%.  See
w32.c:init_environment for more details.

> Please, let's be consistent across platforms.

I think we are, as much as practically possible.



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: %AppData% on Windows instead of %UserProfile% by default?
  2014-11-10 17:04 ` Eli Zaretskii
@ 2014-11-10 17:49   ` Alexander Shukaev
  2014-11-10 18:08     ` Eli Zaretskii
  2014-11-11 21:46   ` Fabrice Popineau
  1 sibling, 1 reply; 10+ messages in thread
From: Alexander Shukaev @ 2014-11-10 17:49 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: ofv, emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1425 bytes --]

>
> First, %AppData% is a subdirectory of %UserProfile%, so it's not like
> this is a totally different place.
>
> More importantly, we are following the platform guidelines, which
> say:
>
> CSIDL_PROFILE          Version 5.0. The user's profile folder.  A typical
> FOLDERID_Profile       path is C:\Users\username.
>                        Applications should not create files or folders
>                        at this level; they should put their data under
>                        the locations referred to by CSIDL_APPDATA or
>                        CSIDL_LOCAL_APPDATA.
>
> When Emacs on Windows starts up, if %HOME% is not defined in the
> environment already, Emacs defines it to refer to %AppData%.  See
> w32.c:init_environment for more details.
>
> I think we are, as much as practically possible.
>

True, but probably a decent fraction of users still tend to keep "emacs.d"
in %UserProfile% similarly to how they keep "emacs.d" in $HOME on Unix.
Yes, defining %HOME% is a possibility, but once again requires manual
intervention and reading a manual after being surprised with something like
"why the hell my configuration isn't loaded?" So I have the following
proposal:

   1. If %HOME% is defined, use it (current);
   2. If "emacs.d" is present in %UserProfile%, use it (new);
   3. Fallback to %AppData% (current).

In other words, I propose to introduce #2 without ruining the already
existing logic.

[-- Attachment #2: Type: text/html, Size: 1921 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: %AppData% on Windows instead of %UserProfile% by default?
  2014-11-10 17:49   ` Alexander Shukaev
@ 2014-11-10 18:08     ` Eli Zaretskii
  0 siblings, 0 replies; 10+ messages in thread
From: Eli Zaretskii @ 2014-11-10 18:08 UTC (permalink / raw)
  To: Alexander Shukaev; +Cc: ofv, emacs-devel

> Date: Mon, 10 Nov 2014 18:49:27 +0100
> From: Alexander Shukaev <haroogan@gmail.com>
> Cc: emacs-devel <emacs-devel@gnu.org>, ofv@wanadoo.es
> 
> True, but probably a decent fraction of users still tend to keep "emacs.d" in
> %UserProfile% similarly to how they keep "emacs.d" in $HOME on Unix.

I'd like to hear from some of the users in that fraction.  (I
understand that you are one of them, but I never heard about such a
place for .emacs.d, so it would be good to hear from others.)

> 1 If %HOME% is defined, use it (current);
> 2 If "emacs.d" is present in %UserProfile%, use it (new);
> 3 Fallback to %AppData% (current).

If indeed this is a popular choice, I see no reason not to support
it.  But please note that we have more fallbacks than just the 2 you
mention, mostly for historical reasons.



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: %AppData% on Windows instead of %UserProfile% by default?
  2014-11-10 16:54   ` Eli Zaretskii
@ 2014-11-10 18:26     ` Óscar Fuentes
  0 siblings, 0 replies; 10+ messages in thread
From: Óscar Fuentes @ 2014-11-10 18:26 UTC (permalink / raw)
  To: emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

>> If I define %HOME%, I expect from Emacs to use it as in the other
>> platforms.
>
> It does.  I've been doing that on Windows for many years.

So I do. I was reading the OP's msg as a proposal for overriding %HOME%
with some other Windows-specific variable when deciding where to put
.emacs.d, but that was later clarified.




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: %AppData% on Windows instead of %UserProfile% by default?
  2014-11-10 17:04 ` Eli Zaretskii
  2014-11-10 17:49   ` Alexander Shukaev
@ 2014-11-11 21:46   ` Fabrice Popineau
  2014-11-12  3:52     ` Eli Zaretskii
  1 sibling, 1 reply; 10+ messages in thread
From: Fabrice Popineau @ 2014-11-11 21:46 UTC (permalink / raw)
  To: emacs-devel

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

> More importantly, we are following the platform guidelines, which
> say:
> 
> CSIDL_PROFILE          Version 5.0. The user's profile folder.  A typical
> FOLDERID_Profile       path is C:\Users\username.
>                        Applications should not create files or folders
> 		       at this level; they should put their data under
> 		       the locations referred to by CSIDL_APPDATA or
> 		       CSIDL_LOCAL_APPDATA. 

I think that it depends on how you interpret "their data".
Applications store data in %APPDATA%, but data which are invisible to the user
(browser web cache, history, etc.)
It is hardly the case for .emacs.d, it is not a byproduct of running Emacs,
or at least not everything in there.
And from this point of view, %UserProfile% is closer to what $HOME is under Unix.

Actually, to make Emacs more "Windows" friendly would probably require 
to setup a configuration quite different from the GNU/Unix one.

My $0.02,

Fabrice




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: %AppData% on Windows instead of %UserProfile% by default?
  2014-11-11 21:46   ` Fabrice Popineau
@ 2014-11-12  3:52     ` Eli Zaretskii
  0 siblings, 0 replies; 10+ messages in thread
From: Eli Zaretskii @ 2014-11-12  3:52 UTC (permalink / raw)
  To: Fabrice Popineau; +Cc: emacs-devel

> From: Fabrice Popineau <fabrice.popineau@gmail.com>
> Date: Tue, 11 Nov 2014 21:46:19 +0000 (UTC)
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> > More importantly, we are following the platform guidelines, which
> > say:
> > 
> > CSIDL_PROFILE          Version 5.0. The user's profile folder.  A typical
> > FOLDERID_Profile       path is C:\Users\username.
> >                        Applications should not create files or folders
> > 		       at this level; they should put their data under
> > 		       the locations referred to by CSIDL_APPDATA or
> > 		       CSIDL_LOCAL_APPDATA. 
> 
> I think that it depends on how you interpret "their data".
> Applications store data in %APPDATA%, but data which are invisible to the user
> (browser web cache, history, etc.)
> It is hardly the case for .emacs.d, it is not a byproduct of running Emacs,
> or at least not everything in there.

That is true, which is why I said we try to be compatible "as is
practically possible".  Emacs does writes into files we put there.

> And from this point of view, %UserProfile% is closer to what $HOME is under Unix.

No, it is farther: it sufers from the same problems as %AppData%, and
on top of that, platform guidelines request that no files are put
there, only directories.

> Actually, to make Emacs more "Windows" friendly would probably require 
> to setup a configuration quite different from the GNU/Unix one.

But that's not what we are trying to do.  We are trying to pick up a
reasonable default for HOME when HOME is not set in the environment.



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: %AppData% on Windows instead of %UserProfile% by default?
  2014-11-10 16:26 %AppData% on Windows instead of %UserProfile% by default? Alexander Shukaev
  2014-11-10 16:48 ` Óscar Fuentes
  2014-11-10 17:04 ` Eli Zaretskii
@ 2014-11-12 15:14 ` Matthias Meulien
  2 siblings, 0 replies; 10+ messages in thread
From: Matthias Meulien @ 2014-11-12 15:14 UTC (permalink / raw)
  To: Alexander Shukaev; +Cc: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 284 bytes --]

> Please, let's be consistent across platforms.

Being in %AppData% on Windows platform the emacs.d directory looks somewhat
hidden to the user which is the same as the .emacs.d directory on Unix
Platform.

From this point of view, Emacs is consistent accross platforms!
-- 
Matthias

[-- Attachment #2: Type: text/html, Size: 421 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-11-12 15:14 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-10 16:26 %AppData% on Windows instead of %UserProfile% by default? Alexander Shukaev
2014-11-10 16:48 ` Óscar Fuentes
2014-11-10 16:54   ` Eli Zaretskii
2014-11-10 18:26     ` Óscar Fuentes
2014-11-10 17:04 ` Eli Zaretskii
2014-11-10 17:49   ` Alexander Shukaev
2014-11-10 18:08     ` Eli Zaretskii
2014-11-11 21:46   ` Fabrice Popineau
2014-11-12  3:52     ` Eli Zaretskii
2014-11-12 15:14 ` Matthias Meulien

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).