Ihor Radchenko writes: > Now, the question is what to do with the existing implementation of > `org-src-associate-babel-session'. It only runs > org-babel--associate-session when > > (and session (not (string= session "none")) > (org-babel-comint-buffer-livep session) > (let ((f (intern (format "org-babel-%s-associate-session" > (nth 0 info))))) > (and (fboundp f) (funcall f session)))) > > The questionable check here is (org-babel-comint-buffer-livep session) - > it only triggers when session is already initiated, while ob-python and > some other backends do not necessarily need to start a new session to > "associate" it with Org Src buffer. > > I am tentatively inclined to change this check to > > (or (org-babel-comint-buffer-livep session) > (eq org-src-auto-initiate-session t) > (alist-get (nth 0 info) org-src-auto-initiate-session) > (alist-get 'default org-src-auto-initiate-session)) > > With `org-src-auto-initiate-session' being a customization that controls > whether to associate session for a given babel backend. > > We may set the default value to something like > > ((default . t) ("R" . nil)) I think this customization is reasonable. Agree to make it as a customization option, The ob-clojure CIDER session which managed by "sesman" seems also requires buffer associate with session. -- [ stardiviner ] I try to make every word tell the meaning that I want to express without misunderstanding. Blog: https://stardiviner.github.io/ IRC(libera.chat, freenode): stardiviner, Matrix: stardiviner GPG: F09F650D7D674819892591401B5DF1C95AE89AC3