Skip to content

Commit

Permalink
Ensure point is at the source block when a hook is run
Browse files Browse the repository at this point in the history
Since `point` can be located at an arbitrary location in an arbitrary
buffer during asynchronous execution, make sure that it is located at
the source block when running `org-babel-after-execute-hook` during
handling of "execute_reply" messages.

* jupyter-org-client.el (jupyter-handle-execute-reply): Do it.
  • Loading branch information
nnicandro committed Sep 25, 2023
1 parent 0f6a902 commit 0480c47
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion jupyter-org-client.el
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,8 @@ to."
(message "An error occurred when evaluating code block."))
(when (jupyter-org-request-async-p req)
(jupyter-org--clear-request-id req)
(run-hooks 'org-babel-after-execute-hook))))
(org-with-point-at (jupyter-org-request-marker req)
(run-hooks 'org-babel-after-execute-hook)))))

;;; Completion in code blocks

Expand Down

0 comments on commit 0480c47

Please sign in to comment.