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
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.
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.