From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:700:3204::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id kiTfAHIHmGWyggEAkFu2QA (envelope-from ) for ; Fri, 05 Jan 2024 14:43:14 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id cLuDMnEHmGV8hgAAe85BDQ (envelope-from ) for ; Fri, 05 Jan 2024 14:43:13 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=EKoB921O; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=posteo.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1704462193; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=2VWAX+I31xOfAWinKg2Sb3ng2+Ub1LQLz3yOporFVBw=; b=Xkm0bqoZT9W8CwOOn7XbMPYGkO6o5TeAWFl/4w0ERkLPkLrdJwJzdyAdN+GQejQnhMShJl jHWbN0+ko41rnLtGVJFTILyu0GfL9vl09Gqachk3DjXIg+ooUozJTR7EMUYaZP9w78Z4NM rfiWjiBpsD1s8pG5slo5jMY6U6Vkmy+/2EDU4U+ng2tu7uNQ37fxyOpr47Lntun3f+IxAK KhfeaRysU2vMoizIVHMdF8Gkkw/5apob1A2F7aZDwuf3t6UPMbMo8/255/8+b5RwjY18w3 AmUvdhS81MnQMCvwnm/YNKBSIKKI4hubVzmnXTEg1mxkId98yAcNPbTS0RG/+A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1704462193; a=rsa-sha256; cv=none; b=Ihff1+cbXzOBL1gqs0vgrmrKZIUF8jZrILyJ8i3HIB3VtHdYlid59UKldDRfpaIv1emTsg uJFtQv1zeJfgobObzhs7N5NVROq8niw+TE5D8XIdoPbdFeK1GxZAnRrlo/YLThjN9/0OeX WW7dy0y4LD+KHcnbNHfXN2GzVIvC8PV/cC8y2XRcHT98T1QChQ8v3ED+s7xDPDr0ctlvLL 1AYC7JPss3z4tWHdepAS5lMb7wOYv031KBKdj0BxzrRFIl4Gr7+WjMQOnkNIQdoS0F7acU u4Hu9s1z+h8VbzB26TevG6P2jeb+LYqw/0uqpNRlYKyG2t8N4B4lLG7T9ZqUow== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=EKoB921O; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=posteo.net Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 67FBE7367B for ; Fri, 5 Jan 2024 14:43:12 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLkSz-0001Dc-D7; Fri, 05 Jan 2024 08:42:29 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rLkSw-0001DG-6f for emacs-orgmode@gnu.org; Fri, 05 Jan 2024 08:42:26 -0500 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rLkSs-0000DX-Nx for emacs-orgmode@gnu.org; Fri, 05 Jan 2024 08:42:25 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 1BC15240104 for ; Fri, 5 Jan 2024 14:42:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1704462140; bh=yFU/W7qSwdXWa096lmVKzInDi3NWm8P/lLJwqD71+7A=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=EKoB921OAh9H78aDyS0z8TP31UxHUJtRccrSj0pVX/+Lan7DF5dpLFTI0dTSbcDqY 4eI7GfkDhoD84RAFmjjcM8mk8CLy5l33ez/KUA9r3OUC4wSqEtz2SHe9Cvhbkl18KW W+BlqTTnYP7Dv7MeCivQNCwHqnNuZwCNmWuXIM+ELR12yV9OkXvRoaf2gr7//yQbYf vFwmppuybRkoes8acyACPX0+KH8zgnFtP5PIFwIdBeRxTIn+cElzxsyvUkvX8Fu2am mEblo46IgxZ0fbs57iP6DDRLkn336iULalvNcFSFyyk+CO8sl81e9mNxbSmYblp264 fSpa3/1bC+Gdg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4T64Q31txLz9rxW; Fri, 5 Jan 2024 14:42:19 +0100 (CET) From: Ihor Radchenko To: Jack Kamm Cc: Liu Hui , emacs-orgmode@gnu.org Subject: Re: [PATCH] Set Python shell in Org edit buffer In-Reply-To: <87ttnyz0jv.fsf@gmail.com> References: <87zfyosw8n.fsf@localhost> <87ttovlb1u.fsf@localhost> <878r6647vv.fsf@localhost> <87bkb2rqer.fsf@localhost> <87edfwsuvx.fsf@localhost> <87sf4bsm1w.fsf@localhost> <87mstw18r4.fsf@gmail.com> <87bkaak0ol.fsf@localhost> <87ttnyz0jv.fsf@gmail.com> Date: Fri, 05 Jan 2024 13:45:31 +0000 Message-ID: <87wmsn6ghw.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Queue-Id: 67FBE7367B X-Migadu-Scanner: mx10.migadu.com X-Migadu-Spam-Score: -9.41 X-Spam-Score: -9.41 X-TUID: hv9eQbuwgjnr Jack Kamm writes: >> Because I am still thinking about the idea with global customization and >> `org-babel--associate-session'. > > It's great that you're thinking about this -- it would be nice to have > better consistency between ob-R, ob-python, etc, and to have better > configurability on this. In particular, ob-R's behavior to automatically > start a session is annoying for me, especially when editing on my HPC's > login node which forbids starting R, python, etc outside of slurm. > > However, the most recent version of Liu's patch is very small, and the > changes should be easy to modify in future, whatever your conclusion on > `org-babel--associate-session'. So I would suggest not to let it > be blocked by this for too long. I just do not want to do double work. I now reverted the obsoletion of org-babel--associate-session. https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=99c9cae25 https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=b4687fcd6 I also fixed the problem where org-babel--associate-session was never actually executed due to `org-src--babel-info' being set after `org-src-mode-hook'. 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)) -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at