tweak(org): don't configure ob-python

More recent versions of ob-python (Org 9.7+) calculates the python
command from `python-shell-interpreter` and
`python-shell-interpreter-args`, effectively rendering this block
(mostly) redundant. It still leaves
`org-babel-python-command-nonsession` to be changed, but I think I'll
leave that to users to set, for simplicity's sake.

What's more, users who repin Org to an older version (predating
bzg/org-mode@9239b0e8d1) will see void-variable errors for this new
variable.

Fix: #8509
This commit is contained in:
Henrik Lissner
2025-09-17 20:56:35 -04:00
parent 4c9dee2c78
commit a72c865c35

View File

@@ -284,17 +284,7 @@ Also adds support for a `:sync' parameter to override `:async'."
(save-excursion
(when-let ((beg (org-babel-where-is-src-block-result))
(end (progn (goto-char beg) (forward-line) (org-babel-result-end))))
(org-display-inline-images nil nil (min beg end) (max beg end)))))))
(after! ob-python
(when (equal org-babel-python-command-nonsession "python")
(setq org-babel-python-command-nonsession
(string-trim
(concat python-shell-interpreter " "
(if (string-match-p "\\<i?python[23]?$" python-shell-interpreter)
(replace-regexp-in-string
"\\(^\\| \\)-i\\( \\|$\\)" " " python-shell-interpreter-args)
python-shell-interpreter-args)))))))
(org-display-inline-images nil nil (min beg end) (max beg end))))))))
(defun +org-init-babel-lazy-loader-h ()