emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[BUG] org babel python execute from local buffer to remote session [9.5.


From: George Moutsopoulos
Subject: [BUG] org babel python execute from local buffer to remote session [9.5.4 (9.5.4-ge0b05b @ /home/moutsopoulosg/.emacs.d/elpa/org-9.5.4/)]
Date: Fri, 26 Aug 2022 09:58:41 +0100

Hi all. I often need to run some code on a remote ssh session, because
only there I can access a database and the environment is hard to
replicate, while I want to keep the code I run on my local machine.

The remote session is initialised with run-python after I change
default-directory and use pythonic-activate. Sending commands from a
local python buffer using python.el works without issues. It would be nice if I can do
the same from a local org-mode buffer from a python source block.

It does not work because org-babel-python-evaluate-session has two
org-babel-temp-file commands that run in the context of the local
buffer. If I replace them with
(let* ((tmp-src-file (with-current-buffer session (org-babel-temp-file
"python-"))) ...) ...)
and
(let* ((tmp-results-file (with-current-buffer session
(org-babel-temp-file "python-"))) ...) ...)
then executing the code works again. I have also changed similarly
org-babel-python-async-evaluate-session
although I haven't tested async.

I am hoping this is a change worth making at source, or maybe there is
a better way to achieve the same.

Thank you.


Emacs  : GNU Emacs 28.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.20, cairo version 1.16.0)
 of 2022-06-24
Package: Org mode version 9.5.4 (9.5.4-ge0b05b @ /home/moutsopoulosg/.emacs.d/elpa/org-9.5.4/)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]