[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Set Python shell in Org edit buffer
From: |
Liu Hui |
Subject: |
Re: [PATCH] Set Python shell in Org edit buffer |
Date: |
Thu, 7 Dec 2023 22:17:58 +0800 |
Ihor Radchenko <yantar92@posteo.net> 于2023年12月7日周四 18:33写道:
> > +(defun org-babel-edit-prep:python (info)
> > + "Set Python shell in Org edit buffer according to INFO."
> > + (let ((session (cdr (assq :session (nth 2 info)))))
> > + (when (and session (not (string= session "none")))
> > + (setq-local python-shell-buffer-name
> > + (org-babel-python-without-earmuffs session)))))
>
> Will this work if Python session does not exist yet?
If the specified session does not exist, users have to start the
session manually if they want to evaluate code directly in the edit
buffer. In fact, python-shell-send-* commands will clearly suggest
users using 'run-python' or C-c C-p to create the session in this
case.
Another choice is to use '(org-babel-python-initiate-session session)'
in org-babel-edit-prep:python, like ob-R, to create the session when
the specified session does not exist, but I feel it is invasive as
users may just want to edit the code.
- [PATCH] Set Python shell in Org edit buffer, Liu Hui, 2023/12/05
- Re: [PATCH] Set Python shell in Org edit buffer, Ihor Radchenko, 2023/12/05
- Re: [PATCH] Set Python shell in Org edit buffer, Liu Hui, 2023/12/05
- Re: [PATCH] Set Python shell in Org edit buffer, Ihor Radchenko, 2023/12/06
- Re: [PATCH] Set Python shell in Org edit buffer, Liu Hui, 2023/12/06
- Re: [PATCH] Set Python shell in Org edit buffer, Ihor Radchenko, 2023/12/07
- Re: [PATCH] Set Python shell in Org edit buffer,
Liu Hui <=
- Re: [PATCH] Set Python shell in Org edit buffer, Ihor Radchenko, 2023/12/07
- Re: [PATCH] Set Python shell in Org edit buffer, Liu Hui, 2023/12/08
- Re: [PATCH] Set Python shell in Org edit buffer, Ihor Radchenko, 2023/12/08
- Re: [PATCH] Set Python shell in Org edit buffer, Liu Hui, 2023/12/08
- Re: [PATCH] Set Python shell in Org edit buffer, Ihor Radchenko, 2023/12/09
- Re: [PATCH] Set Python shell in Org edit buffer, Liu Hui, 2023/12/09
- Re: [PATCH] Set Python shell in Org edit buffer, Jack Kamm, 2023/12/27
- Re: [PATCH] Set Python shell in Org edit buffer, Ihor Radchenko, 2023/12/28
- Re: [PATCH] Set Python shell in Org edit buffer, Jack Kamm, 2023/12/31
- Re: [PATCH] Set Python shell in Org edit buffer, Jack Kamm, 2023/12/27