Commit graph

524 commits

Author SHA1 Message Date
Takafumi Arakaki
160f15becd Fix: copied cell can't be executed 2012-05-23 18:46:09 +02:00
Takafumi Arakaki
294eded27e Add tests for the previous fix 2012-05-23 15:53:10 +02:00
Takafumi Arakaki
905aee9133 Quick fix for ein:notebook-cell-from-type 2012-05-23 15:46:51 +02:00
Takafumi Arakaki
45206014ff Merge branch 'refactor-kernel'
Kernel module is decoupled from cell and notebook module.  This
enables interaction to the kernels from non-notebook buffers.  To
demonstrate this ability, ein-connect.el is added.  This module
connect any buffer to existing notebook, enables tool-tip, help
browser and completion functionality to be used in the buffer.

Changes are mostly following the refactoring in IPython JS client:
https://github.com/ipython/ipython/pull/1711

This merge fixes #1.
2012-05-23 14:14:12 +02:00
Takafumi Arakaki
5e80b885b5 Use ac-source-ein-cached in connected buffer 2012-05-23 13:42:54 +02:00
Takafumi Arakaki
bb091e0406 Trim indent when eval-ing buffer with ein:connect 2012-05-23 13:30:34 +02:00
Takafumi Arakaki
1113b4eeb2 Add ein:trim-indent and its tests 2012-05-23 13:24:21 +02:00
Takafumi Arakaki
2f8676ee4c Rename to ein:notebook-complete-command 2012-05-23 11:27:52 +02:00
Takafumi Arakaki
e0b99eb069 Add ein:connect-complete-command 2012-05-23 11:26:51 +02:00
Takafumi Arakaki
99cfe8e8c4 Autoload ein:connect-to-notebook 2012-05-23 11:09:54 +02:00
Takafumi Arakaki
41baba4410 Add ein:connect-request-tool-tip-or-help-command 2012-05-23 11:06:54 +02:00
Takafumi Arakaki
7a2f998195 Add a FIXME comment on ein-connect.el 2012-05-23 11:04:22 +02:00
Takafumi Arakaki
260b2d8e7d Add ein:notebook-opened-buffers
Put shared logic together.
2012-05-23 10:48:43 +02:00
Takafumi Arakaki
7a331b6895 Remove unnecessary line from ein:notebook-open
Don't need to remove key from the map here, since it will be
added (overwritten) later by ein:notebook-url-retrieve-callback.
2012-05-23 10:47:43 +02:00
Takafumi Arakaki
e1822283ac Add ein-connect.el 2012-05-23 04:23:17 +02:00
Takafumi Arakaki
146aac147f Better emacs-lisp type output handling 2012-05-23 03:19:22 +02:00
Takafumi Arakaki
806d10ae06 Pass the test ein:notebook-request-help 2012-05-23 02:43:44 +02:00
Takafumi Arakaki
c42b756065 Fix ein:pager--open-with-text
Arguments for plist-get were flipped.

The previously added and failed test
ein:notebook-execute-current-cell-question is passed now.
2012-05-23 02:31:01 +02:00
Takafumi Arakaki
7ca440ab75 Merge branch 'master' into refactor-kernel 2012-05-23 02:26:05 +02:00
Takafumi Arakaki
d2801ebcfc Add test: ein:notebook-execute-current-cell-question 2012-05-23 02:21:45 +02:00
Takafumi Arakaki
4cbd11ebaa Merge branch 'master' into refactor-kernel 2012-05-23 02:10:14 +02:00
Takafumi Arakaki
d538d7673e Add new test: ein:notebook-request-help 2012-05-23 02:03:23 +02:00
Takafumi Arakaki
3985f97eb8 Change the spec of callbacks: msg-type is str now
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.
2012-05-23 01:40:00 +02:00
Takafumi Arakaki
676e4ff523 Fix test ein:notebook-execute-current-cell
Many old functions are updated.
2012-05-23 01:15:42 +02:00
Takafumi Arakaki
7e7d81c638 Fix ein:kernel-get-callbacks-for-msg
The order of arguments was wrong.
2012-05-23 01:13:10 +02:00
Takafumi Arakaki
2847424fcc Fix ein:notebook-cell-from-type
TYPE is a symbol, not a string.
2012-05-23 01:12:12 +02:00
Takafumi Arakaki
46af87db27 Setup dummy kernel and events for notebook tests
This fixes a lot of tests (but not all).
2012-05-23 00:00:33 +02:00
Takafumi Arakaki
7fede75855 Fix ein:codecell: add kernel slot 2012-05-22 23:53:25 +02:00
Takafumi Arakaki
1c1135685b Fix ein:notebook-new: remove msg-cell-map 2012-05-22 23:51:04 +02:00
Takafumi Arakaki
6a7b0497b0 Simplify mocking for test-ein-kernel.el 2012-05-22 23:45:53 +02:00
Takafumi Arakaki
085fd73823 Fix test-ein-kernel.el: these tests are passed 2012-05-22 23:32:47 +02:00
Takafumi Arakaki
18c7c027ff Fix the event from ein:kernel-restart 2012-05-22 23:30:18 +02:00
Takafumi Arakaki
15a3f31412 Ensure that event hooks are called in notebook buffer 2012-05-22 23:03:21 +02:00
Takafumi Arakaki
83d7e15b04 Use updated execute functions in notebook 2012-05-22 22:38:39 +02:00
Takafumi Arakaki
7c4d628253 Setup event handler for kernel in notebook 2012-05-22 22:34:00 +02:00
Takafumi Arakaki
ce01997a1e Setup kernel for code cells 2012-05-22 22:32:49 +02:00
Takafumi Arakaki
1fc79a506e Fix ein:cell-execute: input text was not fetched 2012-05-22 22:30:34 +02:00
Takafumi Arakaki
d9bd79102b Allow empty CALLBACKS for ein:kernel-execute 2012-05-22 22:28:32 +02:00
Takafumi Arakaki
7ad7fa09f3 Remove ein:notebook-handle-shell-reply
Its code is moved to ein:notebook-complete-cell and
ein:notebook-request-tool-tip
2012-05-22 22:03:06 +02:00
Takafumi Arakaki
ff78d154f2 Remove ein:notebook-handle-payload
Its code is moved to ein:notebook--set-next-input and
ein:pager--open-with-text.
2012-05-22 21:42:30 +02:00
Takafumi Arakaki
b59a187c3e Remove useless ein:notebook-handle-iopub-reply
Its code is already moved to ein:cell--handle-clear-output and
ein:kernel--handle-iopub-reply.
2012-05-22 21:39:36 +02:00
Takafumi Arakaki
fcdd58343b Move cell-kernel interaction to ein-cell.el 2012-05-22 21:31:23 +02:00
Takafumi Arakaki
1cf85eb747 Cosmetic change on ein:kernel-execute's document 2012-05-22 21:24:11 +02:00
Takafumi Arakaki
cfa1e6cfe3 Document ein:kernel-execute more 2012-05-22 21:22:53 +02:00
Takafumi Arakaki
72b2adca4d Adapt notebook to the changes in kernel (WIP) 2012-05-22 20:50:47 +02:00
Takafumi Arakaki
0faf8bd316 Add ein:pager-bind-events 2012-05-22 20:15:12 +02:00
Takafumi Arakaki
b09a8a1eb0 Add ein:events-on to set event hook 2012-05-22 20:01:14 +02:00
Takafumi Arakaki
bd6a8db46d Fix compile error of ein-kernel.el
This happens because after-change-major-mode-hook is called while
compiling.  Use ein:eval-if-bound instead of directly referencing.
2012-05-22 19:37:35 +02:00
Takafumi Arakaki
db6f7983eb Start refactoring kernel module
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
2012-05-22 19:35:05 +02:00
Takafumi Arakaki
866f2ccafd Merge branch 'refactor-events' 2012-05-22 14:39:50 +02:00