10

I have the GNU Emacs version 23.2.1, installed on Windows Server 2003

When I run Emacs I have this message: Warning (initialization): An error occurred while loading `c:/.emacs':

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

As suggested in a thread, I added this line in my .emacs:

(and (= emacs-major-version 23) (defun server-ensure-safe-dir (dir) "Noop" t))

I thought that this problem was solved in the 23.2 version ?

Bleeding Fingers
  • 6,993
  • 7
  • 46
  • 74
Bertaud
  • 2,888
  • 5
  • 35
  • 48

2 Answers2

24

Ok, I am running Emacs24 (Emacs 24.0. ...) on Windows 7 x64. I had the same problem until I found this post on the Email list.

walkthrough:

  1. Close Emacs
  2. Navigate in Windows Explorer to USERNAME/AppData/Roaming/ (if you can't find the folder you have to activate "show hidden files", you do that clicking in the menu on "Organise" -> "Folder and File Options" -> "View" (or similar) -> here uncheck the box that says not to show hidden files)
  3. If there is NO folder ".emacs.d", created one inside /Roaming/. (possily you need to activate the show-hidden-files mode here too.)
  4. Right-Click the folder -> Preferences;
  5. there navigate to the "Security" tab -> click the "Advanced" button
  6. in the new Window navigate to the "owner" tab and click the button "Edit" (or "Change")
  7. Click on your username and click on OK. A warning appears, click ok, you can close all those windows
  8. Go inside the ".emacs.d" folder and if there is NO folder "server" create one.
  9. When you created it, or if there is a folder "server" follow steps 4-7 for that one too.
  10. Run Emacs happily ever after.

For me that fixed all problems. This fix was written a few times around the web but no one seemed to have mentioned to apply this to both folders. Hope it helps!

kdas
  • 341
  • 2
  • 4
  • 2
    You should be able to check "Replace owner on subcontainers and objects" in step 6, and possibly avoid steps 8,9 – Michael Paulukonis Jul 10 '12 at 14:17
  • 2
    My .emacs.d is in my home directory, and so had to run the steps there instead of in AppData to get the above to work. – mrmagooey Oct 23 '13 at 22:25
  • Odd that having the owner be a group that you're a member of doesn't work, you've actually got to be the owner yourself. – davidbak Jun 15 '15 at 19:59
  • dude, thanks much. I was tearing my hair because none of the other google pages matching this problem were able to solve. It was frustrating to be forced to use other editors when your editor of choice is emacs. This solution fixed me. Also, it will be nice if there is a small utility written to automatically do this. A todo for myself! – anjanb Oct 09 '15 at 10:51
0

Check if you are the owner of "C:/.emacs.d/server" and see if running emacs as the owner of "c:/.emacs.d/server/" solves it.

Read here, and from emacswiki, not sure about which version has the issue fixed.

vpit3833
  • 7,817
  • 2
  • 25
  • 25