Check ein:kernel-live-p in ein:ac-* functions

This commit is contained in:
Takafumi Arakaki 2013-02-13 21:05:42 +01:00
parent 6bbabf6ab6
commit a5a246c734
2 changed files with 4 additions and 2 deletions

View file

@ -105,7 +105,8 @@
(symbol . "c")))
(defun ein:ac-request-in-background ()
(ein:and-let* ((kernel (ein:get-kernel)))
(ein:and-let* ((kernel (ein:get-kernel))
((ein:kernel-live-p kernel)))
(ein:completer-complete
kernel
:callbacks
@ -162,7 +163,7 @@ popup help string."
(callbacks (list :object_info_reply
(cons #'ein:ac-set-document candidate))))
(when (and candidate
kernel
(ein:kernel-live-p kernel)
(not (get-text-property 0 'document candidate)))
(ein:log 'debug "Requesting object info for AC candidate %S"
candidate)

View file

@ -252,6 +252,7 @@
(defun ein:kernel-live-p (kernel)
(and
(ein:$kernel-p kernel)
(ein:aand (ein:$kernel-shell-channel kernel) (ein:websocket-open-p it))
(ein:aand (ein:$kernel-iopub-channel kernel) (ein:websocket-open-p it))))