From 288fb17ece295d26899b14d6db222c2dbdd3168f Mon Sep 17 00:00:00 2001 From: Nathaniel Nicandro Date: Tue, 16 Oct 2018 14:59:54 -0500 Subject: [PATCH] Update comments --- jupyter-channels.el | 5 ----- jupyter-client.el | 7 +++++++ jupyter-repl.el | 9 +++++++++ 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/jupyter-channels.el b/jupyter-channels.el index 282f3a9..4bd7d33 100644 --- a/jupyter-channels.el +++ b/jupyter-channels.el @@ -279,11 +279,6 @@ a response after 5 `time-to-dead' periods." (defun jupyter-hb--send-ping (channel &optional counter) (unless (oref channel paused) (zmq-send (oref channel socket) "ping") - ;; TODO: How to avoid running when idle for a long - ;; time? Would we even want that, when we keep checking - ;; and we are idle Emacs consistently spends a few - ;; percent of CPU time, but is this really necessary? - ;; Maybe extend the time by some factor when idle. (run-with-timer (oref channel time-to-dead) nil (lambda () diff --git a/jupyter-client.el b/jupyter-client.el index 6e1b3a7..0c08cc0 100644 --- a/jupyter-client.el +++ b/jupyter-client.el @@ -636,6 +636,13 @@ by `jupyter--ioloop'." (when jupyter--debug (message "STOPPING-CHANNEL: %s" ctype)) (let ((channel (jupyter--get-channel client ctype))) + ;; TODO: Wrap this in an async channel method, maybe + ;; re-use `jupyter-stop-channel'. On the first call, + ;; when we send a stop channel message to the + ;; subprocess we set the status to pending, then + ;; here once we know the channel was stopped, we + ;; call `jupyter-stop-channel' again and it updates + ;; the status to stopped. Seems too complicated. (oset channel status 'stopped))) ('(start) (when jupyter--debug diff --git a/jupyter-repl.el b/jupyter-repl.el index 0a1494a..51f4016 100644 --- a/jupyter-repl.el +++ b/jupyter-repl.el @@ -683,6 +683,8 @@ When no valid mimetype is present in DATA, a warning is shown." (jupyter-repl-newline)) (t (warn "No supported mimetype found %s" mimetypes))))) +;; FIXME: The support for display IDs has not really been tested. + (defun jupyter-repl-insert-data-with-id (display-id data metadata) "Associate DISPLAY-ID with DATA when inserting DATA. DATA and METADATA have the same meaning as in @@ -2790,6 +2792,13 @@ Otherwise, in a non-interactive call, return the (cl-destructuring-bind (_manager client) (jupyter-start-new-kernel kernel-name client-class) (jupyter-repl--new-repl client repl-name) + ;; TODO: An alist mapping kernel languages to their + ;; corresponding major modes in Emacs. This ways we can + ;; error out earlier before starting the REPL. The + ;; reason why this can't be done is because we use the + ;; extension key of the kernel-info to get the major + ;; mode using `auto-mode-alist'. See + ;; `jupyter-repl-kernel-language-mode-properties'. (when (and associate-buffer (eq major-mode (jupyter-repl-language-mode client))) (jupyter-repl-associate-buffer client))