Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Emacs and the server unsafe error [duplicate]

Tags:

emacs

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 ?

like image 604
Bertaud Avatar asked Mar 08 '11 13:03

Bertaud


1 Answers

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!

like image 71
kdas Avatar answered Oct 01 '22 11:10

kdas