1

Following Installing Emacs, I set HOME environment variable to a directory (c:), and make a _emacs file in the directory. It has this one line of code (server-start).

When I execute emacs (GNU Emacs 23.3.1 (i386-mingw-nt6.1.7601)), I get this error message.

Warning (initialization): An error occurred while loading `c:/_emacs':

error: The directory `~/.emacs.d/server' is unsafe

What's wrong with this?

prosseek
  • 182,215
  • 215
  • 566
  • 871
  • At a guess Emacs is complaining because other users have access to the folder. Try removing Users from the permissions on .emacs.d. – Harry Johnston Nov 03 '11 at 00:38

3 Answers3

4

Emacs - Error when calling (server-start) has the answer.

"The problem is the ownership of the directory ~/.emacs.d/server when you also have “Administrators” rights on your account. Create the directory ~/.emacs.d/server and set the owner of this directory to your login name and the problem is gone.

Community
  • 1
  • 1
prosseek
  • 182,215
  • 215
  • 566
  • 871
  • 1
    Also consider moving `c:/_emacs` to `~/.emacs.d/init.el` and adding `(setq custom-file "~/.emacs.d/custom-variables.el")` to keep emacs related configurations in one place. – klang Nov 03 '11 at 07:25
1

Are you running on Windows 7 (or perhaps Vista)? At some point after XP, Windows decided that putting things in c:\ is a no-no. I guess for security reasons. If you don't set a home environment variable, then emacs will look for your .emacs in c:\users\yourname\appdata\roaming (or something like that - Win 7 machine w/emacs is at work, can't check exactly). You can also create your .emacs.d directory there too if you want.

BillRobertson42
  • 12,602
  • 4
  • 40
  • 57
0

At the very least, the message is not clear enough. Probably, Emacs should not simply barf this way. In any case, my advice would be to use M-x report-emacs-bug to let the Emacs developers know about this. Hopefully they will address the problem one way or another -- at least provide a more helpful message to users.

Drew
  • 29,895
  • 7
  • 74
  • 104