Skip to content

Commit 0480c47

Browse files
committed
Ensure point is at the source block when a hook is run
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.
1 parent 0f6a902 commit 0480c47

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

jupyter-org-client.el

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,8 @@ to."
347347
(message "An error occurred when evaluating code block."))
348348
(when (jupyter-org-request-async-p req)
349349
(jupyter-org--clear-request-id req)
350-
(run-hooks 'org-babel-after-execute-hook))))
350+
(org-with-point-at (jupyter-org-request-marker req)
351+
(run-hooks 'org-babel-after-execute-hook)))))
351352

352353
;;; Completion in code blocks
353354

0 commit comments

Comments
 (0)