Commit graph

33 commits

Author SHA1 Message Date
Takafumi Arakaki
38a3533e8f Minor fix in ein:query-ajax-timeout-callback 2012-06-21 01:05:54 +02:00
Takafumi Arakaki
1b7edc7aa1 Document query timeout configurations 2012-06-21 00:48:03 +02:00
Takafumi Arakaki
0bf69e5e7b Make default query timeout shorter 2012-06-21 00:02:14 +02:00
Takafumi Arakaki
1ad0b71d6c Add ein:query-singleton-ajax 2012-06-20 23:14:25 +02:00
Takafumi Arakaki
de7f0c7fa6 Refactor to make timeout cancel more general 2012-06-20 20:29:06 +02:00
Takafumi Arakaki
255b3a7696 No need to reset process-query-on-exit-flag
The code for resetting process-query-on-exit-flag is not executed and
it works fine without it.  I think this flag was reset in the old
version because the buffer is killed in the query callback.
2012-06-12 20:40:23 +02:00
Takafumi Arakaki
d32f7e5a75 Fix: success callback was called when timeout 2012-06-12 19:48:18 +02:00
Takafumi Arakaki
936f652369 Process instance is no available in the URL callback 2012-06-12 19:47:26 +02:00
Takafumi Arakaki
fa681ff2d5 Fix bugs in ein:query-ajax-callback
1. `process-query-on-exit-flag' reset does not work because
   `kill-buffer' is called in the callback.
2. data is set to the value of which `kill-buffer' is returned.
3. ein:query-ajax-timeout is used after the buffer is killed.
4. `kill-buffer' was called twice.  As delete-buffer calls the
   callback which kill buffer, killing buffer in the timeout
   callback is not needed.
2012-06-12 19:22:41 +02:00
Takafumi Arakaki
669bf2a529 Fix ein:query-ajax-callback: callback called twice
Callback was called twice because url-retrieve calls the callback when
the process is deleted.
2012-06-12 18:13:08 +02:00
Takafumi Arakaki
e931cc26d3 Set process-query-on-exit-flag before kill-buffer 2012-06-12 17:38:02 +02:00
Takafumi Arakaki
10edb8d239 Tweak documents 2012-06-11 14:24:20 +02:00
Takafumi Arakaki
112e1945ec Fix ein:query-ajax-callback 2012-06-10 03:24:45 +02:00
Takafumi Arakaki
dd03689536 Inhibit confirmation on timeout in ein:query-ajax 2012-06-10 02:38:16 +02:00
Takafumi Arakaki
7c04c3927f Add ein:query-default-error-callback 2012-06-08 14:01:33 +02:00
Takafumi Arakaki
01143e1f35 Add sections to ein-query.el 2012-06-08 13:54:39 +02:00
Takafumi Arakaki
dc83830dd0 Fix ein:query-ajax-timeout-callback
Usage of the functions were simply wrong.
2012-06-08 00:37:48 +02:00
Takafumi Arakaki
fbbff8b644 Remove hard-coded timeout 2012-05-27 02:03:58 +02:00
Takafumi Arakaki
878c74d3e1 Fix: response-status was not passed to ajax callbacks 2012-05-26 22:55:23 +02:00
Takafumi Arakaki
95434c845d Use ein:query-ajax in ein:notebook-request-open 2012-05-26 20:41:47 +02:00
Takafumi Arakaki
f6bcb438e8 Rename s/data-type/parser/g 2012-05-26 20:23:22 +02:00
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
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
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
4011a79ace Add ein:query-ajax-cancel-timer 2012-05-26 16:37:12 +02:00
Takafumi Arakaki
82d5cffeca Add ein-query.el 2012-05-25 21:57:59 +02:00