2

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 ?

4

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

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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