From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:5f26::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id uDb7EFPpm2VH6gAAkFu2QA (envelope-from ) for ; Mon, 08 Jan 2024 13:23:47 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id YGe5C1Ppm2UqyAAAqHPOHw (envelope-from ) for ; Mon, 08 Jan 2024 13:23:47 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=LhK69gnC; 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=1704716627; 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=LoT3UBOkWQ7EdfktkLtQ+v8CY8U/kfiR0MFWgMO0Om4=; b=VGz7HnG6uNFhIwwZL3k6oeifRYkeurvfVC+Di7nflbg5TUZBZKuipyB7RfPtea7oAHsgaU sX+aAPUX6g4sbdRNdTImP6cbqDyrlALZBgLXA4j6x5ITOWXq+oUeXwV5O0gf2KgnP1nlNR +sPbDEcGbsHGipEnw7aOYUI4a74yJDAbnYBt78tvmqw7yFp27YOZxzErXFIXy6oZnGgpMc aAEe6GhnEFTisn/+8Mx0anx82nFV5MU5iP6+Y89Ux3mb1+e00WBV47EUeZ9OBT/6DCGcf6 CKE22yvFFhOLTdqjWgO3MQ7A9qSGcjfLfTCSVk/401ie/vi/Wtz9IJZQR4Mykg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1704716627; a=rsa-sha256; cv=none; b=QEpU46wIf3Y7ksnYuwdWQueapf7ONh6FkE04t+Mq4rYEGo96I0ApyJ5UhkGFphxYVII5cm ZN+ZwINjNYm3is+TNCtmL2yCibe7xBvgXWARYEVBmH23rMb/UrAXrKSLKo4/Nxft/Wlh87 +Q4BDtDFLi1e67zwE50S3AFxb80aY9hDOJPxpevNOLMqR7Ysz4+r2LnrWQlvRpeehSNZtk ONuyS3gFkQjsZel8ifVvY4IFvl0d8ESD1G88cRaOE0rUyri0cAN5gS3VLbYI89o0VW4KID K0TdXFvH6Exl1nqfzom33D4Y9V8G0trLA5Vh89bNpC4/wpUZHjl3fYjAsYW+4g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=LhK69gnC; 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 1D59538566 for ; Mon, 8 Jan 2024 13:23:46 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rMoee-00037M-Dl; Mon, 08 Jan 2024 07:22:56 -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 1rMoec-000353-0q for emacs-orgmode@gnu.org; Mon, 08 Jan 2024 07:22:54 -0500 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rMoeZ-0006Mz-Oa for emacs-orgmode@gnu.org; Mon, 08 Jan 2024 07:22:53 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 9B2A1240028 for ; Mon, 8 Jan 2024 13:22:49 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1704716569; bh=Og1tf6deiBCj5Wi9Z48QU1PrL+vk4qJD1Em6Mn5if5A=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=LhK69gnCQmRvUhvIMoDMgnjBuPc2kQENvB3vFLNMk3IvCz0W8GB+CwSnN4TN2G0zL xuNZqg7sYKBbEwpobRxbuZl+GUd04JtKYCFja3hA58I/GLHpP02UGDjsiX1VoQ3pD1 hNPo5N0GNy03Y/a9u8W1QpNWZjtgs4NYNLc67A5eIcFcqNEAThxDNo2BB8rhtIZ963 jkSy+h6R8UBEGMbvHad24Y9RZMVzBxVqG1VoaS6n+a4BqXDzuUZy+/N3X+teIRn0sF gUqTooE/tFxb4Su01Ywze5vn1QoLP6gTInZNMYGo87u6Y9vJZsXIpt9NHU4MFnb0xo C1MOsxR+v5DgA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4T7tVw6Ht3z6twx; Mon, 8 Jan 2024 13:22:48 +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: <87le91t13e.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> <87wmsn6ghw.fsf@localhost> <87o7dxu15h.fsf@gmail.com> <87msthwbfz.fsf@localhost> <87le91t13e.fsf@gmail.com> Date: Mon, 08 Jan 2024 12:26:01 +0000 Message-ID: <87zfxgxb8m.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@posteo.net; helo=mout01.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-Spam-Score: -9.00 X-Spam-Score: -9.00 X-Migadu-Queue-Id: 1D59538566 X-Migadu-Scanner: mx11.migadu.com X-TUID: DXBxZe5PTIAA Jack Kamm writes: > Ihor Radchenko writes: > >> So, a good option could be >> (1) removing (org-babel-comint-buffer-livep session) from >> `org-src-associate-babel-session' >> (2) Removing `org-babel-edit-prep:R' >> >> With the above, we can use `org-babel-python-associate-session' > > Sounds good to me. Note that I proposed to remove auto-starting session completely, which is in odds to what you propose below. > I think their behavior is peculiar enough to have an ob-R/julia-specific > option on whether to initiate session on edit, with options nil, t, and > earmuffs. Earmuffs is the current behavior, but it's surprising enough > (IMO) that it might be worth changing the default to nil or t. But still > worth keeping the earmuffs option since this behavior seems to go back > to the original implementation (30931bfe1). If it helps, I can prepare a > patch for this after you've made the changes for > org-babel--associate-session. IMHO, it might be enough to adjust org-babel-R-associate-session as the following (defun org-babel-R-associate-session (session) "Associate R code buffer with an R session. Make SESSION be the inferior ESS process associated with the current code buffer." (setq ess-local-process-name (process-name (get-buffer-process session))) (when ess-local-process-name (ess-make-buffer-current)) (setq-local ess-gen-proc-buffer-name-function (lambda (_) session))) >From the user point of view, it should then make no difference. If we follow the advice from https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-R.html, Use ESS to step through evaluation line-by-line - Use C-c ' to visit the edit buffer for your code block - Use ess-eval-line-and-step to evaluate each line in turn ess-eval-line-and-step should still work regardless whether ESS session is already initiated or not before opening Org Src buffer. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at