mirror of
https://github.com/vale981/emacs-jupyter
synced 2025-03-04 15:41:37 -05:00
jupyter-org-with-src-block-client: Macro hygiene
This commit is contained in:
parent
ad5113b9a7
commit
9ff1722293
1 changed files with 11 additions and 9 deletions
|
@ -401,15 +401,17 @@ when it is evaluated.
|
|||
In addition to evaluating BODY with an active Jupyter client set,
|
||||
the `syntax-table' will be set to that of the REPL buffers."
|
||||
(declare (debug (body)))
|
||||
`(jupyter-org-when-in-src-block
|
||||
(let* ((params (car jupyter-org--src-block-cache))
|
||||
(jupyter-current-client
|
||||
(buffer-local-value 'jupyter-current-client
|
||||
(org-babel-jupyter-initiate-session
|
||||
(alist-get :session params) params)))
|
||||
(syntax (jupyter-kernel-language-syntax-table jupyter-current-client)))
|
||||
(with-syntax-table syntax
|
||||
,@body))))
|
||||
(let ((params (make-symbol "params"))
|
||||
(syntax (make-symbol "syntax")))
|
||||
`(jupyter-org-when-in-src-block
|
||||
(let* ((,params (car jupyter-org--src-block-cache))
|
||||
(jupyter-current-client
|
||||
(buffer-local-value 'jupyter-current-client
|
||||
(org-babel-jupyter-initiate-session
|
||||
(alist-get :session ,params) ,params)))
|
||||
(,syntax (jupyter-kernel-language-syntax-table jupyter-current-client)))
|
||||
(with-syntax-table ,syntax
|
||||
,@body)))))
|
||||
|
||||
(cl-defmethod jupyter-code-context ((_type (eql inspect))
|
||||
&context (major-mode org-mode))
|
||||
|
|
Loading…
Add table
Reference in a new issue