(format "%s/%d" Omake.File.emacs-log-dir (emacs-pid)))
- (make-directory Omake.File.emacs-log-pid-dir t)
+ (progn (make-directory Omake.File.emacs-log-pid-dir t)
+ ;; CR pszilagyi: I think this is wrong. The first "error" is a
+ ;; condition name; I think the intension is that the handler then
+ ;; call the ERROR function, given the arguments. There may be other
+ ;; instances, although Omake.handle-errors looks right.
(error "Couldn't create the Omake emacs-log. Check the permissions on %s"
+(defun Omake.File.check-root-perms ()
+ "Because the /tmp/omake-server directory is shared between
+users, it needs to have appropriate permissions set. In
+particular, call this function at least after potentially
+creating /tmp/omake-server with the default umask."
+ (let ((required #o1777)
+ (present (file-modes Omake.File.root)))
+ (unless (= required (logand required present))
+ ;; Don't try unless we can usefully report errors.
+ (when (called-interactively-p 'any)
+ (condition-case err (set-file-modes Omake.File.root (logor required present))
+ (error (message "Couldn't fix wrong permissions %o on %s: %s"
+ (error-message-string err)))))))))