Closed rejeep closed 11 years ago
Can you wrap the async
call with a let
binding of default-directory
?
Nope, for example:
(let ((default-directory "/Users/user/foo"))
(async-start-process
"process"
"pwd"
(lambda (process)
(with-current-buffer (process-buffer process)
(print (buffer-string))))))
But how could the default-directory
matter since a new Emacs process is started? The default-directory
would have to be passed along to the new process.
Hi Johan,
Johan Andersson notifications@github.com writes:
Nope, for example:
(let ((default-directory "/Users/user/foo")) (async-start-process "process" "pwd" (lambda (process) (with-current-buffer (process-buffer process) (print (buffer-string))))))
But how could the
default-directory
matter since a new Emacs process is started? Thedefault-directory
would have to be passed along to the new process.
Don't forget to add "/" at end of default-directory.
Thierry Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997
Ahh... that might be the problem, let me get back to you with the results.
That worked fine, thanks!
Is there any way to specify the directory to execute the command in? I realize it would be tricky, but most valuable.