Add jupyter-request-inhibit-handlers for convenience

This commit is contained in:
Nathaniel Nicandro 2018-01-02 13:55:08 -06:00
parent 068f09fa9e
commit bcaa7ef2d7

View file

@ -677,6 +677,19 @@ for the heartbeat channel."
(sleep-for 0 10)))
(jupyter-request--id req))
(defun jupyter-request-inhibit-handlers (req)
"Inhibit the execution of a `jupyter-kernel-client's handlers for REQ.
Set `jupyter-request-run-handlers-p' to nil for REQ and return
REQ. This function is intended to be a convenience function so
that you can do:
(jupyter-add-callback 'execute-reply
(jupyter-request-inhibit-handlers
(jupyter-execute-request client ...))
(lambda (msg) ...))"
(setf (jupyter-request-run-handlers-p req) nil)
req)
(defun jupyter-request-run-callbacks (req msg)
"Run the MSG callbacks of REQ."
(when req