The `ready' object was not generated each time
ein:kernel-start-channels is executed.
Rather, it was reused every time.
This change forces it to be created every time by calling list
function explicitly.
ein:aif cannot be used there because `it' is already taken by the
`loop' macro which replaces `it' with some random symbol. In the
`then' clause, `it' indicates the value tested by `if' (just like
aif).
Another possible way to implement this is to use user_expressions.
However, replied message is Python's repr. As there is no reliable
way to convert it except using Python itself, I am using stream to
get CWD.
Test ein:notebook-execute-current-cell is passed.
At this point all unit tests in test/test-ein-*.el are passed.
msg-type was first a string and I changed it to a keyword when I am
writing ein:kernel-execute. But as I need to fix a lot of other
places, I change it back to a string. Note that msg-type can come
from JSON directly when the notebook is first opened, so it must be
consistent with that routines.
Maybe I will change it again, but at that time, symbol is better than
keyword because msg-type is a value rather than a key.
Change is only in ein-kernels.el except the new one function
in ein-utils.el. Note that byte compile and tests are broken
because of the changes.
Changes are mostly following the refactoring in IPython JS client:
https://github.com/ipython/ipython/pull/1711
URL was fixed in the previous version. As Emacs does not know URL of
IPython web server like JS does implicitly by page location, I need to
pass URL around in notebook list/notebook/kernel. I add `url-or-port'
slot to each structs so it is easy to get URL from the struct.