jwiegley / emacs-async

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

Doesn't appear to work with Emacs 24.3 #15

Closed ameyp closed 10 years ago

ameyp commented 11 years ago

After loading the library with (load-file "/path/to/async.el") or (load-library "/path/to/async.el") or (require 'async "/path/to/async.el"), the async-start sample gives a "Can't find library async" error. This is on Emacs 24.3.50.1

expez commented 11 years ago

Works fine for me on version 24.3.1. Package installed through melpa.

ameyp commented 11 years ago

That's because melpa handles dependencies and adds all dependencies to the load-path for you. I don't want async on the load-path, I want to load it by specifying a relative path.

DarwinAwardWinner commented 10 years ago

(load-file "/path/to/async.el") and (require 'async "/path/to/async.el") both work just fine for me on 24.3.1 on OS X. load-library will never work because it only looks in load-path.

ameyp commented 10 years ago

@DarwinAwardWinner And you don't have async on the emacs load-path?

Also, did you try the async-start example from the README? Because that's when I get the error, not when I require the module. Here's the async-start example:

(async-start
   ;; What to do in the child process
   (lambda ()
     (message "This is a test")
     (sleep-for 3)
     222)

   ;; What to do when it finishes
   (lambda (result)
     (message "Async process done, result should be 222: %s" result)))
DarwinAwardWinner commented 10 years ago

Ah, I see. Loading async.el is fine, but without async.el in the load-path, (funcall (symbol-function 'find-library-name) "async") fails, so it can't tell the child process where to find async. I'll code up a pull request soon.

ameyp commented 10 years ago

@DarwinAwardWinner Cool, thanks!