Need help about emacs-async
From @tumashu on November 22, 2017 8:12
Hello
I have faced a problem that "emacs-async package can not work well in termux's emacs.", https://github.com/jwiegley/emacs-async/issues/90#issuecomment-346260368 , and I can not verify this is a emacs-async's bug or termux-emacs's bug, so I wish the friends who have installed the emacs in termux to test the below code, and feed back its work status, thanks:
(require 'async)
(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)))
Copied from original issue: termux/termux-app#488
@tumashu Is this something you still need help with or is it solved?
It is not solve at the moment, I have debug two days, but can not find the reason.
Is it possible to remove some of the startup scripts emacs uses when starting default startup in Termux? Emacs is a tremendous tool, and it appears that emacs takes excessively long to startup. This inhibits its' use. Compare with vim on device, which is tremendous too.
@tumashu could you provide some more info on how to reproduce the error (what is the actual error?).
I guess the emacs-async needs to be downloaded/cloned from github.com/jwiegley/emacs-async? Are you running the code with eval-buffer or in some other way?
@sdrausty that's a bit off-topic here. Might be better to ask in irc, or G+.
@Grimler91 Please see: https://github.com/jwiegley/emacs-async/issues/90
- Run emacs
- install emacs-async with: "package-install emacs-async"
- Run emacs with: "emacs -q"
- (package-initialize)
- (require 'emacs-async)
- do test
This issue/PR has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Same issue here, maybe not the same problem. Strange error for me, I have this message :
error in process sentinel: async-handle-result: End of file during parsing
The error is always after a certain time : for me the subprocess isn't even started (I think).
Until termux properly handles emacs-async, I just disabled asyncronous API. In my case, I'm using spacemacs and it checks the git hash asynchronously, which I don't think it's that critical. (git is fast for me.) So I put the following code under dotspacemacs/user-init function.
(defun my/termux-p ()
(not (null (getenv "TERMUX_VERSION"))))
(defvar my/termux-p (my/termux-p))
;; Bug patch for Termux. `async-start' does not work properly in Termux. Let's
;; make the function synchronous.
(if my/termux-p
(with-eval-after-load 'async
(defun async-start (start-func &optional finish-func)
"Different from the original function, this function is synchronous."
(let ((result (funcall start-func)))
(when finish-func
(funcall finish-func result))
result))))
Seems like it's working for me. I can see a proper value in spacemacs-revision--last.