Commit graph

435 commits

Author SHA1 Message Date
Takafumi Arakaki
5a65aba368 Add DATA-TYPE argument to ein:query-ajax
This solves the problem due to the url-retrieve gotcha.

Main changes:
* Separation of the function to parse buffer and callback.
  This is good because parsed data can be used from multiple
  callbacks (SUCCESS and STATUS-CODE).
* As a result, current buffer for callbacks is not process
  buffer anymore. Callbacks should not assume any particular
  current buffer.
* RESPONSE-STATUS is added to the arguments for callbacks
  to pass around the value of url-http-response-status.

Previous attempts:
* cb5f53c183:
  Simpler and better fix than the previous one
* fff269fc39:
  ein:notebooklist-delete-notebook works again
2012-05-26 20:12:31 +02:00
Takafumi Arakaki
7a50ae0a3a Add ein:notebooklist-new-notebook-callback 2012-05-26 19:53:23 +02:00
Takafumi Arakaki
cb5f53c183 Simpler and better fix than the previous one
Previous fix ignores callbacks even if it is specified if the buffer
is killed.  This is simply wrong.  As the user of :STATUS-CODE
callback does not touch current buffer, I change the spec.
2012-05-26 19:25:00 +02:00
Takafumi Arakaki
fff269fc39 ein:notebooklist-delete-notebook works again
The bug was in ein:query-ajax-callback.  When url-retrieve called in
its callback (which is the case of ein:notebooklist-delete-notebook),
same process buffer is reused.  Therefore, old code killed another
buffer (namely notebook list buffer) by accident and the variable
url-http-response-status was void because it is outside of the process
buffer (I am not sure about this part).  Current workaround is to
check if the buffer is live before executing buffer, using new macro
ein:with-live-buffer.
2012-05-26 19:08:15 +02:00
Takafumi Arakaki
9061e1c515 Use ein:query-ajax in ein:notebooklist-delete-notebook 2012-05-26 19:01:39 +02:00
Takafumi Arakaki
388a59efa2 Fix ein:notebooklist-new-notebook
Do not kill process buffer when using ein:query-ajax
2012-05-26 19:00:34 +02:00
Takafumi Arakaki
783e430105 Use ein:query-ajax in ein:notebooklist-new-notebook 2012-05-26 17:30:58 +02:00
Takafumi Arakaki
55eb908993 Remove unused url-http-method in ajax callback 2012-05-26 17:22:08 +02:00
Takafumi Arakaki
fb67781402 Fix ein:query-ajax-callback
Callback must be wrapped one by one.  Fix "url-http-response-status is
void" error when calling ein:notebooklist-open.
2012-05-26 17:20:20 +02:00
Takafumi Arakaki
56d92f9121 Revert "Suppress error: url-http-response-status is void"
This reverts commit 48a8f3835e.

Conflicts:

	ein-query.el
2012-05-26 17:18:34 +02:00
Takafumi Arakaki
4d1166dcbd Fix bugs in ein:notebooklist-open
There was two bugs:

* Process buffer was killed in ein:notebooklist-url-retrieve-callback
  where should be handled by ein:query-ajax-callback.  There was two
  calls of kill-buffer.  This is why the list buffer was killed.

* At the time ein:query-ajax-cancel-timer is called in
  ein:query-ajax-callback the current buffer was changed because
  pop-to-buffer is called in the callback.  Wrapping callbacks
  with save-current-buffer fixes the problem.
2012-05-26 17:13:17 +02:00
Takafumi Arakaki
ef8f59a3bf Fix arguments for run-at-time in ein-query 2012-05-26 17:01:23 +02:00
Takafumi Arakaki
a06442194a Bit better ein:query-ajax-cancel-timer 2012-05-26 17:00:21 +02:00
Takafumi Arakaki
48a8f3835e Suppress error: url-http-response-status is void 2012-05-26 16:59:42 +02:00
Takafumi Arakaki
c90d66f4f4 Use ein:query-ajax in ein:notebooklist-open
notebooklist-open does not work.
2012-05-26 16:57:42 +02:00
Takafumi Arakaki
4011a79ace Add ein:query-ajax-cancel-timer 2012-05-26 16:37:12 +02:00
Takafumi Arakaki
33ef77d3be Add "Coding rule about current buffer."
And apply it to the previous fix.
2012-05-25 22:58:01 +02:00
Takafumi Arakaki
be1148ff4a Fix a bug: retrying save saves random texts
This is because ein:notebook-to-json touches to current buffer and
read the text from there.
2012-05-25 22:43:56 +02:00
Takafumi Arakaki
3385c6fb47 Add ein:debug global switch 2012-05-25 22:19:05 +02:00
Takafumi Arakaki
81334a86e8 Use ein-query-ajax in ein:notebook-save-notebook
This change adds timeout to notebook-save-notebook.  This is useful
since sometimes Emacs does not start transaction and have opened
process hanging around.

This change also fixes a bug which might be occurred in the previous
version: ein:notebook-discard-output-p is called from
ein:notebook-save-notebook via ein:notebook-to-json but not on the
notebook buffer.  This function access to the buffer, but not treated
properly.  This change fixes this problem.
2012-05-25 22:12:34 +02:00
Takafumi Arakaki
82d5cffeca Add ein-query.el 2012-05-25 21:57:59 +02:00
Takafumi Arakaki
6135204f62 Go to the top of notebook list on open/refresh 2012-05-25 18:13:44 +02:00
Takafumi Arakaki
63835d82be Unbind C-c C-d (delete-cell) 2012-05-25 18:06:45 +02:00
Takafumi Arakaki
e5a4e8a229 Allow no undo after deleting a cell 2012-05-25 17:57:52 +02:00
Takafumi Arakaki
98ae4efbb9 Fix compile error of test-ein-notebook.el 2012-05-25 17:40:29 +02:00
Takafumi Arakaki
ce182462f3 Bit more robust ein:notebook-del 2012-05-25 16:11:26 +02:00
Takafumi Arakaki
7b00834dad Suppress compile warning in ein-dev.el 2012-05-25 15:51:32 +02:00
Takafumi Arakaki
da6c563363 ein:notebook-kill-all-buffers from ein:dev-reload 2012-05-25 15:50:48 +02:00
Takafumi Arakaki
7cd63ecad4 Add ein:notebook-kill-all-buffers command 2012-05-25 15:44:00 +02:00
Takafumi Arakaki
559da7b154 Merge branch 'filter-output-on-save' 2012-05-25 15:16:51 +02:00
Takafumi Arakaki
8d5e174f53 Test discard-output option of ein:cell-to-json 2012-05-25 15:12:54 +02:00
Takafumi Arakaki
ede88fc70a Add eintest:cell-to-json to simplify tests 2012-05-25 15:01:35 +02:00
Takafumi Arakaki
0e086985ea Add tests for ein:cell-to-json 2012-05-25 14:54:03 +02:00
Takafumi Arakaki
173dc7f389 Fix a bug in ein:cell-to-json
ein:cell-to-json is needed to accept two arguments.
2012-05-25 05:22:14 +02:00
Takafumi Arakaki
179916fd31 Show "Restarting kernel..." message which fadeouts 2012-05-25 03:03:57 +02:00
Takafumi Arakaki
315b106c96 Start using notification widget 2012-05-25 02:04:07 +02:00
Takafumi Arakaki
e87ddd2bb2 Simplify ein:notification-bind-events 2012-05-25 01:49:45 +02:00
Takafumi Arakaki
f2c6df94e0 Fix a bug in ein:notification-bind-events 2012-05-25 01:48:29 +02:00
Takafumi Arakaki
0d051b0102 Add tests on notification widget and fix bugs 2012-05-25 01:32:05 +02:00
Takafumi Arakaki
cec308d90d Implement event callbacks for notification widget 2012-05-25 01:11:33 +02:00
Takafumi Arakaki
3660960013 Add config to discard output on notebook save
This is done by adding one configurable variable:
ein:notebook-discard-output-on-save
2012-05-25 00:23:09 +02:00
Takafumi Arakaki
720fd5bdce Add FIXME comments on ein-events.el 2012-05-24 19:38:31 +02:00
Takafumi Arakaki
9cda42ece7 Start writing ein-notification.el 2012-05-24 19:33:07 +02:00
Takafumi Arakaki
62e096454d Kill log buffer when notebook is closed 2012-05-24 19:20:45 +02:00
Takafumi Arakaki
35d68055c5 Add a comment on ein:events-trigger 2012-05-24 19:13:47 +02:00
Takafumi Arakaki
fc98886e49 Show message when eval-ing code using ein-connect 2012-05-24 17:56:01 +02:00
Takafumi Arakaki
7d01c8dc80 ein:dev-reload reconfigures sub-packages now 2012-05-24 17:36:15 +02:00
Takafumi Arakaki
5da0839071 Add sections in ein-shared-output.el 2012-05-24 14:43:28 +02:00
Takafumi Arakaki
4da179c440 Notify when the output goes into the shared buffer 2012-05-24 14:42:30 +02:00
Takafumi Arakaki
bccae92dde Use ein-shared-output.el from ein-connect.el 2012-05-24 13:17:42 +02:00