Use ein:query-ajax in ein:notebooklist-open

notebooklist-open does not work.
This commit is contained in:
Takafumi Arakaki 2012-05-26 16:57:42 +02:00
parent 4011a79ace
commit c90d66f4f4

View file

@ -71,16 +71,23 @@
(when (and (stringp url-or-port) (when (and (stringp url-or-port)
(string-match "^[0-9]+$" url-or-port)) (string-match "^[0-9]+$" url-or-port))
(setq url-or-port (string-to-number url-or-port))) (setq url-or-port (string-to-number url-or-port)))
(url-retrieve (let ((success
(ein:notebooklist-url url-or-port) (if no-popup
(if no-popup #'ein:notebooklist-url-retrieve-callback
#'ein:notebooklist-url-retrieve-callback (lambda (&rest args)
(lambda (&rest args) (pop-to-buffer
(pop-to-buffer (apply #'ein:notebooklist-url-retrieve-callback args)))) (apply #'ein:notebooklist-url-retrieve-callback args))))))
(list url-or-port)) (ein:query-ajax
(ein:notebooklist-url url-or-port)
:cache nil
:success (cons success url-or-port)
:timeout 5000))
(ein:notebooklist-get-buffer url-or-port)) (ein:notebooklist-get-buffer url-or-port))
(defun ein:notebooklist-url-retrieve-callback (status url-or-port) (defun* ein:notebooklist-url-retrieve-callback (url-or-port
&key
status
&allow-other-keys)
"Called via `ein:notebooklist-open'." "Called via `ein:notebooklist-open'."
(ein:aif (plist-get status :error) (ein:aif (plist-get status :error)
(error "Failed to connect to server '%s'. Got: %S" (error "Failed to connect to server '%s'. Got: %S"