Previous tests were failed because undo was not reset after the
execution callbacks modified the buffer. This is fixed by calling
ein:notebook-empty-undo-maybe via event in all the callbacks.
Strongly typed `:input-prompt-number' becomes a problem when reading a
notebook that saved "*". As treating it using `:running' makes no
sense (nothing is running on kernel when the notebook is opened),
using flexible type for the slot is the right choice.
This reverts commit 5402274c71.
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.
* In the previous version which uses text property, syntax
highlighting in mumamo was not working. This change fix
this problem.
* If I am going to use pygmentize + ansi-color, which use
face text property, implementation using text property
won't work. So, using overlay is better choice.
* Code is clearer than the previous version.
Now ein:cell-output-stderr face is visible in mumamo.
However, to make it visible mumamo-background-chunk-major face must
have no background property. Otherwise background color is overridden
by mumamo-background-chunk-major.
This is similar code I need to add to ein:cell-insert-output in the
previous commit. Note that I need to invalidate footer ewoc node in
ein:cell-append-output.
ein:cell-insert-output handles flushed stream better.
But this change is kind of contaminating other output type because now
ein:cell-insert-output inserts newline in the region of other output
type node if the previous output is stream type. Maybe I need something
more like DOM.