emacs-async icon indicating copy to clipboard operation
emacs-async copied to clipboard

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

Open tumashu opened this issue 6 years ago • 13 comments

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?

tumashu avatar Nov 18 '17 04:11 tumashu

It works here; what do you see?

jwiegley avatar Nov 21 '17 22:11 jwiegley

qq 20171122080959

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

tumashu avatar Nov 22 '17 00:11 tumashu

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?

jwiegley avatar Nov 22 '17 00:11 jwiegley

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 avatar Nov 22 '17 01:11 tumashu

qq 20171122090531

tumashu avatar Nov 22 '17 01:11 tumashu

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.

tumashu avatar Nov 22 '17 01:11 tumashu

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.

jwiegley avatar Nov 22 '17 01:11 jwiegley

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.

tumashu avatar Nov 22 '17 02:11 tumashu

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?

jwiegley avatar Nov 22 '17 06:11 jwiegley

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 avatar Nov 22 '17 06:11 tumashu

when i change to use

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

it can work, what the two approach different?

tumashu avatar Nov 23 '17 11:11 tumashu

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

What exactly did you change?

jwiegley avatar Nov 23 '17 19:11 jwiegley

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.

tumashu avatar Nov 24 '17 01:11 tumashu