Rename internal functions for clarity

The following changes are made:

jupyter--run-handler-p -> jupyter--request-allows-handler-p
jupyter--handler-dispatch -> jupyter--run-handler

* jupyter-client.el: Do it.

* test/jupyter-test.el: Do it.
This commit is contained in:
Nathaniel Nicandro 2020-04-12 02:47:30 -05:00
parent da6154fe17
commit d08d4fce61
2 changed files with 7 additions and 7 deletions

View file

@ -784,7 +784,7 @@ received for it and it is not the most recently sent request."
(jupyter-drop-request client req)
(remhash (jupyter-request-id req) requests)))))
(defsubst jupyter--run-handler-p (req msg)
(defsubst jupyter--request-allows-handler-p (req msg)
"Return non-nil if REQ doesn't inhibit the handler for MSG."
(let* ((ihandlers (and req (jupyter-request-inhibited-handlers req)))
(type (and (listp ihandlers)
@ -831,7 +831,7 @@ nil is returned otherwise."
(:stdin . ,(handler-alist
:input-reply :input-request)))))
(defun jupyter--handler-dispatch (client channel msg req)
(defun jupyter--run-handler (client channel msg req)
(when (jupyter-handle-message-p client channel msg)
(let* ((msg-type (jupyter-message-type msg))
(channel-handlers
@ -902,8 +902,8 @@ completed, requests from CLIENT's request table."
(unwind-protect
(jupyter--run-callbacks req msg)
(unwind-protect
(when (jupyter--run-handler-p req msg)
(jupyter--handler-dispatch client channel msg req))
(when (jupyter--request-allows-handler-p req msg)
(jupyter--run-handler client channel msg req))
(when (jupyter--message-completes-request-p msg)
;; Order matters here. We want to remove idle requests *before*
;; setting another request idle to account for idle messages
@ -915,8 +915,8 @@ completed, requests from CLIENT's request table."
(when (and (or (jupyter-get client 'jupyter-include-other-output)
;; Always handle a startup message
(jupyter-message-status-starting-p msg))
(jupyter--run-handler-p req msg))
(jupyter--handler-dispatch client channel msg req)))))))
(jupyter--request-allows-handler-p req msg))
(jupyter--run-handler client channel msg req)))))))
;;; STDIN handlers

View file

@ -839,7 +839,7 @@
(req (jupyter-send-kernel-info-request client)))
(should (equal (jupyter-request-inhibited-handlers req)
'(:stream)))
(should-not (jupyter--run-handler-p
(should-not (jupyter--request-allows-handler-p
req (jupyter-test-message
req :stream (list :name "stdout" :text "foo"))))
(setq jupyter-inhibit-handlers '(:foo))