mirror of
https://github.com/vale981/emacs-jupyter
synced 2025-03-05 15:41:37 -05:00
Remove uses of lexical-let
This commit is contained in:
parent
326ff15d92
commit
9ba6ad331e
4 changed files with 26 additions and 31 deletions
|
@ -245,8 +245,7 @@ connected."
|
|||
(oset channel timer
|
||||
(run-with-timer
|
||||
0 (oref channel time-to-dead)
|
||||
(lexical-let ((identity identity)
|
||||
(sent nil))
|
||||
(let ((sent nil))
|
||||
(lambda (channel)
|
||||
(let ((sock (oref channel socket)))
|
||||
(when sent
|
||||
|
|
|
@ -527,8 +527,7 @@ that if no TIMEOUT is given, `jupyter-default-timeout' is used."
|
|||
(declare (indent 1))
|
||||
(setq timeout (or timeout jupyter-default-timeout))
|
||||
(cl-check-type timeout number)
|
||||
(lexical-let ((msg nil)
|
||||
(cb cb))
|
||||
(let ((msg nil))
|
||||
(jupyter-add-callback req
|
||||
msg-type (lambda (m) (setq msg (when (funcall cb m) m))))
|
||||
(with-timeout (timeout nil)
|
||||
|
|
|
@ -841,31 +841,28 @@ kernel that the REPL buffer is connected to."
|
|||
(candidates
|
||||
(cons
|
||||
:async
|
||||
(lexical-let ((arg arg))
|
||||
(lambda (cb)
|
||||
(let ((client jupyter-repl-current-client))
|
||||
(with-jupyter-repl-buffer client
|
||||
(jupyter-add-callback
|
||||
(jupyter-complete-request
|
||||
client
|
||||
:code (jupyter-repl-cell-code)
|
||||
;; Consider the case when completing
|
||||
;;
|
||||
;; In [1]: foo|
|
||||
;;
|
||||
;; The cell code position will be at position 4, i.e. where
|
||||
;; the cursor is at, but the cell code will only be 3
|
||||
;; characters long.
|
||||
:pos (1- (jupyter-repl-cell-code-position)))
|
||||
:complete-reply
|
||||
(apply-partially
|
||||
(lambda (cb msg)
|
||||
(cl-destructuring-bind (&key status matches
|
||||
&allow-other-keys)
|
||||
(jupyter-message-content msg)
|
||||
(if (equal status "ok") (funcall cb matches)
|
||||
(funcall cb '()))))
|
||||
cb))))))))
|
||||
(lambda (cb)
|
||||
(let ((client jupyter-repl-current-client))
|
||||
(with-jupyter-repl-buffer client
|
||||
(jupyter-add-callback
|
||||
(jupyter-complete-request
|
||||
client
|
||||
:code (jupyter-repl-cell-code)
|
||||
;; Consider the case when completing
|
||||
;;
|
||||
;; In [1]: foo|
|
||||
;;
|
||||
;; The cell code position will be at position 4, i.e. where
|
||||
;; the cursor is at, but the cell code will only be 3
|
||||
;; characters long.
|
||||
:pos (1- (jupyter-repl-cell-code-position)))
|
||||
:complete-reply
|
||||
(lambda (msg)
|
||||
(cl-destructuring-bind (&key status matches
|
||||
&allow-other-keys)
|
||||
(jupyter-message-content msg)
|
||||
(if (equal status "ok") (funcall cb matches)
|
||||
(funcall cb '()))))))))))
|
||||
(sorted t)
|
||||
(doc-buffer
|
||||
(let ((msg (jupyter-wait-until-received :inspect-reply
|
||||
|
|
|
@ -180,8 +180,8 @@ testing the callback functionality of a
|
|||
(setq ran-callbacks (nreverse ran-callbacks))
|
||||
(should (equal ran-callbacks '(1 1 1 2 2 2)))))
|
||||
(ert-info ("Multiple callbacks for a single message type")
|
||||
(lexical-let* ((ran-callbacks nil)
|
||||
(req (jupyter-execute-request client :code "foo")))
|
||||
(let* ((ran-callbacks nil)
|
||||
(req (jupyter-execute-request client :code "foo")))
|
||||
(jupyter-add-callback req
|
||||
:execute-reply (lambda (_msg) (push 1 ran-callbacks)))
|
||||
(jupyter-add-callback req
|
||||
|
|
Loading…
Add table
Reference in a new issue