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

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

Re: [h-e-w] c:/.emacs.d/server' is unsafe


From: Ben Key
Subject: Re: [h-e-w] c:/.emacs.d/server' is unsafe
Date: Tue, 15 Mar 2011 21:28:03 -0400

Hello,

Gamoto writes:

> I added this option:
> -f c:\.emacs.d\server\server
> Finally the complete string:
> "c:\program files\emacs-23.2\bin\emacsclientw.exe" -na
> "c:\program files\emacs-23.2\bin\runemacs.exe" -f c:\.emacs.d\server\server "%1"
> That seems ok. I must test again and again.

I would suggest that instead of putting your .emacs file in c:\ you put it in
"C:\Documents and Settings\{UserName}\Application Data."  As I have said at least twice before, this is the current preferred location for HOME on Windows XP and Windows Server 2003 systems.  You can demonstrate this to yourself by temporarily removing your .emacs from c:\ and then starting Emacs.  Then once Emacs is running use C-x d to open ~/ in Dired.  The top line of the Dired buffer shows you the full path to the directory that is currently opened in Dired.  If your user name is Administrator, you will see "C:\Documents and Settings\Administrator\Application Data" in the top line of the Dired buffer.  This proves that without any outside influence such putting your .emacs file in c:\ which effectively forces Emacs to use C:\ as HOME, Emacs "wants" to use "C:\Documents and Settings\{UserName}\Application Data" as your home directory.

If you simply follow this recommendation you will not have to specify the path to the server file on the command line since both Emacs and Emacs Client will then automatically use the same location for the server file.  I just tried it on my Windows Server 2003 system and it worked.  In my setup my user name is bkey.  I placed my .emacs file at "c:/Documents and Settings/bkey/Application Data/.emacs" and made no other changes (no HOME environment variable).  Emacs loads my .emacs file AND Emacs Client works without my specifying the path to the server file on the command line.

Of course you will still need to change the owner of the server directory which will now be at
"C:\Documents and Settings\Administrator\Application Data\.emacs.d\server" as discussed before.

As was recently discussed on the bug-gnu-emacs mailing list, placing your .emacs file in c:\ is supported "for backwards compatibility with older versions" and the current preferred location is in the "user's Application Data directory, obtained through system calls" (http://lists.gnu.org/archive/html/bug-gnu-emacs/2011-03/msg00445.html).

Note that if you want Emacs Client to also work when Emacs is not running, you may want to set the ALTERNATE_EDITOR environment variable to the full path of runemacs.exe but this should be the only environment variable you need to set.

I hope this information helps.



reply via email to

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