jwiegley / emacs-async

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

emacs-async can not work in termux's emacs. #90

Open tumashu opened 6 years ago

tumashu commented 6 years ago

I have tested the following example, and can not get the desire output:

(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)))

Anyone know how to debug the problem?

jwiegley commented 6 years ago

It works here; what do you see?

tumashu commented 6 years ago

qq 20171122080959

I only can see "process emacs" and no desire output

jwiegley commented 6 years ago

I might take a little while to appear. Is there any way to observe the processes on the system, to see if the child Emacs is being created and executed?

tumashu commented 6 years ago

I can see the emacs process with the help of list-process, and it run about 5 minute, but there are no output showed in main emacs. Is any way to debug this ?

tumashu commented 6 years ago

qq 20171122090531

tumashu commented 6 years ago
Using username "feng".
Authenticating with public key "imported-openssh-key"
Passphrase for key "imported-openssh-key":
Remove dead screens with 'screen -wipe'.
Loading newcomment...
Loading replace...
Loading emacs-lisp/tabulated-list...
Loading buff-menu...
Loading emacs-lisp/float-sup...
Loading vc/vc-hooks...
Loading vc/ediff-hook...
Loading uniquify...
Loading electric...
Loading emacs-lisp/eldoc...
Loading cus-start...
Loading tooltip...
Loading /data/data/com.termux/files/usr/share/emacs/25.3/lisp/leim/leim-list.el\
 (source)...
Finding pointers to doc strings...
Finding pointers to doc strings...done
Loading /data/data/com.termux/files/usr/share/emacs/25.3/lisp/emacs-lisp/site-i\
nit.el (source)...

the emacs subprocess's bufffer content.

jwiegley commented 6 years ago

Interesting, it seems to be waiting for you to input a password in order to complete the startup process. I think you need to stop your subordinate Emacs from loading your site file or init.el file, which it shouldn't be doing by default.

tumashu commented 6 years ago
Using username "feng".
Authenticating with public key "imported-openssh-key"
Passphrase for key "imported-openssh-key":
Remove dead screens with 'screen -wipe'.

This is the infomation when I ssh with putty, I don't know why it will showed in emacs process's buffer. when I try it again, it show now:

Loading loadup.el (source)...
Using load-path (/data/data/com.termux/files/usr/share/emacs/25.3/lisp /data/data/com.termux/fi\
les/usr/share/emacs/25.3/lisp/emacs-lisp /data/data/com.termux/files/usr/share/emacs/25.3/lisp/\
language /data/data/com.termux/files/usr/share/emacs/25.3/lisp/international /data/data/com.ter\
mux/files/usr/share/emacs/25.3/lisp/textmodes /data/data/com.termux/files/usr/share/emacs/25.3/\
lisp/vc)
Loading emacs-lisp/byte-run...
Loading emacs-lisp/backquote...
Loading subr...
Loading version...
Loading widget...
Loading custom...
Loading emacs-lisp/map-ynp...
Loading international/mule...
Loading international/mule-conf...
Loading env...
Loading format...
Loading bindings...
Loading window...
Loading files...
Loading emacs-lisp/macroexp...
Loading cus-face...
Loading faces...
Loading button...
Loading /data/data/com.termux/files/usr/share/emacs/25.3/lisp/loaddefs.el (source)...
Loading emacs-lisp/nadvice...
Loading emacs-lisp/cl-preloaded...
Loading minibuffer...
Loading abbrev...
Loading simple...
Loading help...
Loading jka-cmpr-hook...
Loading epa-hook...
Loading international/mule-cmds...
Loading case-table...
Loading /data/data/com.termux/files/usr/share/emacs/25.3/lisp/international/charprop.el (sourc

...

Loading textmodes/fill...
Loading newcomment...
Loading replace...
Loading emacs-lisp/tabulated-list...
Loading buff-menu...
Loading emacs-lisp/float-sup...
Loading vc/vc-hooks...
Loading vc/ediff-hook...
Loading uniquify...
Loading electric...
Loading emacs-lisp/eldoc...
Loading cus-start...
Loading tooltip...
Loading /data/data/com.termux/files/usr/share/emacs/25.3/lisp/leim/leim-list.el (source)...
Finding pointers to doc strings...
Finding pointers to doc strings...done
Loading /data/data/com.termux/files/usr/share/emacs/25.3/lisp/emacs-lisp/site-init.el (source).\
..
I think you need to stop your subordinate Emacs from loading your site file or init.el file

This is the default behavior of termux's emacs. may be it's a bug? by the way, when I remove this file. aync can not work well still.

jwiegley commented 6 years ago

I don't know why it's trying to use ssh during an Emacs startup. What is the value of async-quiet-switch on your system?

tumashu commented 6 years ago
I don't know why it's trying to use ssh during an Emacs startup. 

Sorry, it's just my paste problem, emacs subprocess buffer's content is normal, just like:

Loading loadup.el (source)...
Using load-path (/data/data/com.termux/files/usr/share/emacs/25.3/lisp /data/data/com.termux/fi\
les/usr/share/emacs/25.3/lisp/emacs-lisp /data/data/com.termux/files/usr/share/emacs/25.3/lisp/\
language /data/data/com.termux/files/usr/share/emacs/25.3/lisp/international /data/data/com.ter\
mux/files/usr/share/emacs/25.3/lisp/textmodes /data/data/com.termux/files/usr/share/emacs/25.3/\
lisp/vc)
Loading emacs-lisp/byte-run...

...

Loading tooltip...
Loading /data/data/com.termux/files/usr/share/emacs/25.3/lisp/leim/leim-list.el (source)...
Finding pointers to doc strings...
Finding pointers to doc strings...done
Loading /data/data/com.termux/files/usr/share/emacs/25.3/lisp/emacs-lisp/site-init.el (source).\

What is the value of async-quiet-switch on your system?

"-Q"

tumashu commented 6 years ago

when i change to use

 "--eval" "'(async-batch-invoke)'"

it can work, what the two approach different?

jwiegley commented 6 years ago

t> when i change to use t> "--eval" "'(async-batch-invoke)'"

What exactly did you change?

tumashu commented 6 years ago
What exactly did you change?

Sorry, I have tested again, but it can not fix the problem, it just show: "Async process done, result should be 222:(sourse)", which indicated that the value is not fetched properly.