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 6Er1LIJmkWWVCAEAkFu2QA (envelope-from ) for ; Sun, 31 Dec 2023 14:02:58 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id UBHyKYJmkWWlgQAAqHPOHw (envelope-from ) for ; Sun, 31 Dec 2023 14:02:58 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=ihkJcZ8I; 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=1704027778; 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=bugjmtAvI+ALUzG+O76lL89iqSPJOzIQy4mpj9hsplI=; b=JD6BhFyyqoHFbFYmSgZmq0m3/1cwdV8lpX1s11pqo4tV2kzSs0R2FXee9JgujFkshycMc3 qLkAWC3dJCrnddqW1RT04nv3CSx/Rkg2az3n58QzTaJkb20o7V0oct8JO6WbB2Ae+8QbDR OhSoZ2417dcIixYqDOG+oVUYyia7tocIlb5a2xFXbdKaiQd041hH4VFjzIyM6mhkLcCJC9 +be47Oiz+mg33ZM8dmh2/xq5eklVsWjC6fiUrQae+fK5bWPZxaANsdIZ8Lmg+ttNns1cWl 0zgxwq/jPqoxY8kfClOtl+1V5nrwMxW7GpJZ/qCvI3rjwVKLMqRI2K35CksvIw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=ihkJcZ8I; 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-Seal: i=1; s=key1; d=yhetil.org; t=1704027778; a=rsa-sha256; cv=none; b=XpzTmZ8YihYGwn5VHDYFq01j36iHyTqZRihCY7oKDRXaybdgvW3/HTxBb6KJALLp3UneYP y8DrVnEscHT0dolSfMxm/BT2s4HA2e2+TgStjazTksYA1A6+bLbISLjnGMpohni0HR8EEN hPH1RM9h2AOokbtcuYesLjc2nP2yKXWn9oPNtOSqpblRUYxQ4Wmh/X1aEB4CPZUVoPSgW7 Pbx6ik6fRc7+UPMYcckfQiLEeNhogAp2KhzQtSHfiUvRmvAKdaJScoQ051q4NIRzZzmSQr e+mvmd6x63FqssbIlMaTw9WUSn78BoFgJ6ulV50h49KvL66MXYicPNidP036fw== 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 09BE1119FF for ; Sun, 31 Dec 2023 14:02:58 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rJvSN-0006bx-AN; Sun, 31 Dec 2023 08:02:19 -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 1rJvSK-0006Zv-P0 for emacs-orgmode@gnu.org; Sun, 31 Dec 2023 08:02:16 -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 1rJvSD-0000dY-Vb for emacs-orgmode@gnu.org; Sun, 31 Dec 2023 08:02:16 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 6E63F240028 for ; Sun, 31 Dec 2023 14:02:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1704027727; bh=pD2ttyZVmaU6t9QhNA7LyFIiYefiIF0ffmfy2fkMcs8=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=ihkJcZ8IzT+nzgIb2MHnGWvy99umjIo954bW3Eq3OjtX9LFIC710WPzulgRSrmEm1 QXgrRCWlUbmv1P7eLvOIduPcDv2G9b8baLJTQCvL8QfkfMhDCbT6qy+El7OB7NRZkf kIw7/Og35reyW+KBLXzhKvBWMqA799/r/xFwP5+znKJw79ZzdhdaLWIXDiVO13S7ZI NytEf1N3wzcj+uL6aI9ldVsP/sXf4Ulrwy9S1DDpa8PYXlI/mLAFLPY/Z+RaAXWkUp CHfZTMlQx52aS3k6K7YGT8Y3bbnQIyzQ8TPjvhrimvu8HhTK+nbuUFnLE1cPkphouY bWtvJ0llMvphA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4T2zly4P3kz6txL; Sun, 31 Dec 2023 14:02:06 +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: <87h6k10zcg.fsf@gmail.com> References: <87zfyosw8n.fsf@localhost> <87ttovlb1u.fsf@localhost> <878r6647vv.fsf@localhost> <87bkb2rqer.fsf@localhost> <87edfwsuvx.fsf@localhost> <87sf4bsm1w.fsf@localhost> <87jzp018lv.fsf@gmail.com> <878r5ek0jj.fsf@localhost> <87h6k10zcg.fsf@gmail.com> Date: Sun, 31 Dec 2023 13:05:20 +0000 Message-ID: <875y0e8qun.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: -53 X-Spam_score: -5.4 X-Spam_bar: ----- X-Spam_report: (-5.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=-1, RCVD_IN_MSPIKE_WL=-0.01, 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-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Scanner: mx13.migadu.com X-Migadu-Spam-Score: -6.86 X-Spam-Score: -6.86 X-Migadu-Queue-Id: 09BE1119FF X-TUID: a8K/rmmrqYj0 Jack Kamm writes: >> What might be more robust is to provide an explicit "start session >> from Org Src buffer" command for ob-python and re-bind `run-python' to >> this command in Org Src buffers. > > We could refactor `org-babel-python-initiate-session-by-key' to call a > separate `org-babel-python-run-python' interactive command that wraps > `run-python', and then rebind `run-python' to it in a local minor mode > for ob-python Src buffers, which could be started in > `org-babel-edit-prep:python'. > > But I'm not sure if it's worth the hassle, or if d0d838b02 already > addresses the concern sufficiently? For ob-python, there is little difference. I am thinking in a more general context of all the babel backends that support sessions. python.el is convenient as it allows setting the session buffer name in advance via buffer-local variable. Then, all the normal python-mode commands, including `run-python' or `python-shell-send-region' will work as expected. However, other babel backends like ob-R do not have such a luxury (see the dance with renaming R process buffer in `org-babel-R-initiate-session'). That's why I thought about remapping `run-python' and all the equivalent commands for other backends. However, as in the above example, `run-python' is not the only mean to initiate session in various major modes - sending a line or region at point is another common command; and they might be others. Not to mention that re-binding is not panacea - people may still run the original commands via M-x. So, re-binding is probably not the best idea. In other words, `org-babel-python-run-python' is not necessary. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at