I have a timer which call a function itself calling start-process. Whenever the current buffer's directory changed (deleted/moved), I have the error

start-process: Setting current directory: No such file or directory

The command ran by start-process is not directory specific, it can be run anywhere. So my workaround is setting default-directory to a directory which probably exists:

(let ((default-directory user-emacs-directory))
  (start-process ...))

Question. Is that a common workaround to prevent start-process fail ?

1 Answer 1


Yes, that's the established technique. In my code I use temporary-file-directory instead, but this is just a detail.

  • Thank you, it's good to know! Mar 4, 2021 at 8:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.