ErgoEmacs .emacs path

102 views
Skip to first unread message

Vanav

unread,
Feb 2, 2010, 1:33:54 PM2/2/10
to ErgoEmacs
I've found that ErgoEmacs searches .emacs in "C:\Documents and Settings
\User\", while other Emacs builds (and original exe in bin folder of
ErgoEmacs) uses "C:\Documents and Settings\User\Application Data\".

Xah Lee:
> the .emacs is saved in the place where you $HOME environment variable points to. If you don't have $HOME, then it is saved to the AppData dir by default. This applies to any emacs on windows. (i think in the install process ergoemacs added env var for you...)

My answer:
There is code in ErgoEmacs.c:

/* If HOME is not set, set it as "C:\Documents and Settings
\username" */
if (!GetEnvironmentVariable ("HOME", buf, MAX_PATH) || !*buf)
{
HRESULT hr = SHGetFolderPath (NULL, CSIDL_PROFILE, NULL, 0,
buf);
if (SUCCEEDED (hr))
{
SetEnvironmentVariable ("HOME", buf);
}
}

I think, if this code will be removed, then behaviour of Emacs and
ErgoEmacs.exe will be the same: Emacs home will be in AppData.

Strictly, user's home is My Documents, and user application's home is
Application Data. So I think need to fix this code.

Xah Lee

unread,
Feb 2, 2010, 4:31:48 PM2/2/10
to ergo...@googlegroups.com
i'll have to defer this to David to answer or think about this when he has time. I don't know much about Windows's conventions on this.

 Xah


--
You received this message because you are subscribed to the Google Groups "ErgoEmacs" group.
To post to this group, send email to ergo...@googlegroups.com.
To unsubscribe from this group, send email to ergoemacs+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/ergoemacs?hl=en.


David Capello

unread,
Feb 2, 2010, 10:28:48 PM2/2/10
to ergo...@googlegroups.com
Vanav, I put HOME poiting to "C:\Documents and Settings\username"
because it is the default location when you open 'cmd' program.
Also take a look to Windows HOMEPATH environment variable and you
will see it is pointing to "C:\Documents and Settings\username" too.

I would really like to see all data of Emacs saved in something like
User\AppData\Emacs (instead of just User\AppData). Here I don't
know what is the best option. Right now I prefer the HOME=HOMEPATH,
but if other people think that the default Emacs behavior
is better (HOME=User\AppData), we should remove my code.

Vanav

unread,
Feb 3, 2010, 5:21:15 AM2/3/10
to ErgoEmacs
I personally too prefer "C:\Documents and Settings\User\Application
Data\Emacs" (or ...ErgoEmacs). But it is different from default.

BTW, I saw that installator has option to install for all users, or
for current user. It should change path to "C:\Documents and Settings
\All Users\Application Data\Emacs" then. But make installation for
current user by default: no dialog box, but an option checkbox:
[ ] Install for all users

David Capello

unread,
Feb 3, 2010, 6:17:29 AM2/3/10
to ergo...@googlegroups.com
On Wed, Feb 3, 2010 at 7:21 AM, Vanav <va...@vanav.com.ua> wrote:
> I personally too prefer "C:\Documents and Settings\User\Application
> Data\Emacs" (or ...ErgoEmacs). But it is different from default.

Why we should do the same as the default behaviour of Emacs
anyway? Almost everything in Emacs is wrong by default (for a
normal Windows user point of view).

Let me explain you why HOME should point to 'C:\Docs and...\User':
When you start ErgoEmacs, you can type "~/My Documents"
(or ~/Desktop), but if HOME (~) were poiting to AppData,
the ~ location would be completely useless and unknown for
everybody (will be useful to type ~/.emacs, or ~/Firefox for example
to access to internal configuration files of Firefox, very useless).

> BTW, I saw that installator has option to install for all users, or
> for current user. It should change path to "C:\Documents and Settings
> \All Users\Application Data\Emacs" then. But make installation for
> current user by default: no dialog box, but an option checkbox:
> [ ] Install for all users

It makes no sense for me. I think that "Install for all users" option
is useful when you have to copy configuration files or entries in the
registry to be the default ones for every new user which start the
application. But in our case, ErgoEmacs can start with an
empty HOME folder.

Finally, I think it is an issue that should be solved by Xah in
dictatorial ways. So Xah, what do you think? Where would you
like to be HOME by default in ErgoEmacs?

Ivan Vanyushkin

unread,
Feb 3, 2010, 6:45:49 AM2/3/10
to ErgoEmacs
For me, My Documents is located in other place, but it is rare
customization.

Will be good to support custom location of .emacs via registry key
HOME:

REGEDIT4
[HKEY_CURRENT_USER\SOFTWARE\GNU\Emacs]
"HOME"="C:\\Documents and Settings\\Ivan\\Application Data\\Emacs"

This key is used when no env. var HOME is defined (http://www.gnu.org/
software/emacs/windows/faq3.html#index-HOME-directory-48).

So, my suggestion:
1) remove hard coded HOME from launcher,
2) add reg key during install.

Pros: user can customize .emacs location without breaking other
applications.
Cons: user will need to move existing configs to new dir, if any.

P.S. You install doesn't have option for all users? If so, sorry for
previous letter, I confuse with EmacsW32 install.

Xah Lee

unread,
Feb 3, 2010, 4:12:49 PM2/3/10
to ErgoEmacs
> Finally, I think it is an issue that should be solved by Xah in
> dictatorial ways. So Xah, what do you think? Where would you
> like to be HOME by default in ErgoEmacs?

after spending a 40 min reading and trying to write some opinions and
info, ... i think i don't really have anything useful to contribute. I
don't know much about windows.

I opened a issue at: http://code.google.com/p/ergoemacs/issues/detail?id=65
So we have a future reference point on the status or any decision we
made. (i don't know the answer for most of the questions there with
certainty. Anyone please feel free to answer each question, provide
reference if you can so there's the possibility to check and verify
for others who doesn't have expertise on this. Dave, feel free to
close it too if you see fit, of course.)

Thanks a lot.

Xah

nikolay.k...@gmail.com

unread,
Aug 18, 2012, 11:48:28 AM8/18/12
to ergo...@googlegroups.com
Hello.

I'm having a problem with the init file in ErgoEmacs. It just wouldn't read my init file.

When I do F1-v user-init-file, I get nul in ErgoEmacs. I also have vanilla Emacs installed, and it returns the proper value.

Originally I didn't had HOME set on my system. After I've set it, my vanilla version started using the folder I've set, while ErgoEmacs still does nothing.

Tried all the standard names for that file.

Any ideas?
Reply all
Reply to author
Forward
0 new messages