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 ?

Firmin Martin
  • 1,265
  • 7
  • 23

1 Answers1

4

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

Michael Albinus
  • 6,647
  • 14
  • 20