jwiegley / emacs-async

Simple library for asynchronous processing in Emacs
GNU General Public License v3.0
838 stars 68 forks source link

async-start variant with the load-path set #31

Closed fommil closed 10 years ago

fommil commented 10 years ago

This is a really great project!

I wanted to use it to do a url-file-copy async, because it can cause freezing when behind corporate firewalls and url-retrieve doesn't play well with big or binary files.

However, I was unable to get my load-path set correctly in the spawned process. I was following this wonderful advice on setting local variables, but I got a one line warning that some random melpa library (exuberant ctags, I think) was not a function. I was using (set 'load-path ,load-path).

To dramatically simplify any attempts I've been making, can you please make a version of async-start that uses the current load-path so that require can be used to pull in files containing functions to be executed in the process?

Workarounds - including the right way to set the load-path - also very welcome!

thierryvolpiatto commented 10 years ago

Sam Halliday notifications@github.com writes:

This is a really great project!

I wanted to use it to do a url-file-copy async, because it can cause freezing when behind corporate firewalls and url-retrieve doesn't play well with big or binary files.

However, I was unable to get my load-path set correctly in the spawned process. I was following this wonderful advice on setting local variables, but I got a one line warning that some random melpa library (exuberant ctags, I think) was not a function. I was using (set 'load-path ,load-path).

Use `async-inject-variables' like here:

https://github.com/thierryvolpiatto/emacs-tv-config/blob/master/tv-utils.el#L773

If you want to install programs from Melpa using async use this advice:

https://github.com/thierryvolpiatto/emacs-tv-config/blob/master/tv-utils.el#L815

Thierry Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997

fommil commented 10 years ago

You've given me a catch 22 here : I can't access any elisp libs on my path and in order to do so I need to... access elisp libs on my path?

I seen inject variables, does it work for entire files and packages?

fommil commented 10 years ago

Aah, I see, inject for the path. I don't think the second piece is relevant for me as I already have the libraries I need.

How come inject works but set with a macro doesn't? (caveat, I've not tried this yet)