From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:1008:1e59::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id aC2yF1nujmVATQEAkFu2QA (envelope-from ) for ; Fri, 29 Dec 2023 17:05:45 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id UCpdFFnujmXdMgAA62LTzQ (envelope-from ) for ; Fri, 29 Dec 2023 17:05:45 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=I4I9we7X; 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=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1703865945; 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=vVKfoA6rFNfHfK1f81uh8Zgb0EAO4UQzE1hola1Zy7c=; b=m0EYPS5aGNrBQbBru5o4M8tbNveAzKkpE/jBWj1ZCSi8CHnwWJ8ueyPjnUI4DEr2GeIog6 V72R+PRuCr787aCc/SkGyD4fYC2QzVIAU7JrFva8XKYQpvxKc+nlahVt1wKcOmE2ILQRbR CxQKQXL7TkKr6wk60jWwS6MoJyqgLUZbn19OT27d1vR83iv4wNvBUROUXiPpHpRxl/TERT G8J6xvlRuvjuF0a4M5QNre7KR7Fxfssx3Jh0cDEa8FuExnpxz2pRSQ5VKu4AJdO6rzEBrr Ep9KzOfkcG0O4nA9DGZEBYdf5o/i8bItorgKtJl2MwMYJHC3sbtJSSGePG/odA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1703865945; a=rsa-sha256; cv=none; b=boK8wyYw8cWlqWo4heQ/26JL8TkEVmYtEfdco/WxCSxBuKcF5ot3folqI5JUjsf6aE9v14 XeotEBA1k3uDlEsgd4Q3OxyDex31DgqUYn46LxIRlkNCgrmxdRh/fYkrCw+PdOPyWLkkFO Z5/onu442nSxGirzHI6+7qQ8l1za80Gzs4Wc3VBdCnZG9CDEScApzVkjctjjRwskYxwNvG GPcqz1VbS5zfJnlfuhec/IqRca2Cyliao/M1M4G59Pt9AzqLMqyA3pZNtG+B/41h6j6YSR cubglgzA26hUgRMHSE8be82c45qknT1nJeL3yrOG9pFTOSBlB/dBcsajVs9yIQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=I4I9we7X; 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=gmail.com 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 410B01C406 for ; Fri, 29 Dec 2023 17:05:45 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rJFLl-0002GP-AT; Fri, 29 Dec 2023 11:04:41 -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 1rJFLk-0002GH-4N for emacs-orgmode@gnu.org; Fri, 29 Dec 2023 11:04:40 -0500 Received: from mail-pg1-x52a.google.com ([2607:f8b0:4864:20::52a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rJFLi-0007wl-HE for emacs-orgmode@gnu.org; Fri, 29 Dec 2023 11:04:39 -0500 Received: by mail-pg1-x52a.google.com with SMTP id 41be03b00d2f7-5cda3e35b26so1991774a12.1 for ; Fri, 29 Dec 2023 08:04:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703865876; x=1704470676; darn=gnu.org; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=vVKfoA6rFNfHfK1f81uh8Zgb0EAO4UQzE1hola1Zy7c=; b=I4I9we7XdgveUHOkwtiLLwXnNm31WFWYivKJWZGBxciaaYG/bfmtfBz2auh9diAYpU 6cNh08lTkEo9ayc+3H/X9SEt0513RH5PhSsD20YeQj640M3PZGhFCc2GNTFJB+kmOPIQ rzkDrbFfaj4DmZ1GMR53jDHdL6S+sgHc6bjPRxIjkVT+YTsRd6n+g5JH3AJ2gm80eGXH sb9HJVRyfqhpy/7L06Hzwex4th1dg9FrR1a7xO7/QG97mZ1rZ5tQDHkT2q+ambiq+bTF taD9783vurPRsHPtFn1ZenPKPjtJSExeHFfGXnP6SCRuY6I6lc5rLdv/Ke64dPJ3ptFx Wn+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703865876; x=1704470676; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=vVKfoA6rFNfHfK1f81uh8Zgb0EAO4UQzE1hola1Zy7c=; b=R987R/EtMLrBiWkYgV/DH3s2Is0q9Oqk1LNyTTnP21iylWnCJlMrJ4UOgakq0R2Cpx vulVgTShhn/nL8vE80N05nsUKgIdhe2OWEn6oHDN8r+IMF9Klmf41L7EAEtjgdb2wTZk EC/y9YkOn6uXBqXsa0Oo+vqZKAamM/ueecbIGaxUOhWDDWG58Ve36Kb7FaF2EYY9Hy1I 0Fkv1PDcHpxd0Kq7NBb7HafCdrs8J2QyzX2M30lVvDq7YZfGI+z7LgA3wdwsCHz2H/kZ JEmnr/CfaViy+rdgxhXajP/M2EpvRZb8lBa92/uWw6jE7M7a6o6qkQuWrE60UP85MPTu CfJQ== X-Gm-Message-State: AOJu0YxOs+XdmVolW5npNuJppsUwSkTcUUSc/EX7ROoy8hCBigtXNFO9 6E4a2ut4U9MK3c/BfIXUhjw= X-Google-Smtp-Source: AGHT+IFNr2LM7QYu405RAuZcc548ZS2wwbANwNW5XbnR7aYuA7N9pZo4WsRT0d/4LBQNrZV/podVsQ== X-Received: by 2002:a17:90a:f404:b0:28c:814c:fd76 with SMTP id ch4-20020a17090af40400b0028c814cfd76mr2664342pjb.6.1703865875952; Fri, 29 Dec 2023 08:04:35 -0800 (PST) Received: from localhost (157-131-78-143.fiber.dynamic.sonic.net. [157.131.78.143]) by smtp.gmail.com with ESMTPSA id j2-20020a17090a588200b0028c9349c79esm5148238pji.36.2023.12.29.08.04.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Dec 2023 08:04:34 -0800 (PST) From: Jack Kamm To: Ihor Radchenko Cc: Liu Hui , emacs-orgmode@gnu.org Subject: Re: [PATCH] Set Python shell in Org edit buffer In-Reply-To: <878r5ek0jj.fsf@localhost> 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> Date: Fri, 29 Dec 2023 08:04:31 -0800 Message-ID: <87h6k10zcg.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::52a; envelope-from=jackkamm@gmail.com; helo=mail-pg1-x52a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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: -7.54 X-Spam-Score: -7.54 X-Migadu-Queue-Id: 410B01C406 X-Migadu-Scanner: mx12.migadu.com X-TUID: YrC17/CD4gsy Ihor Radchenko writes: > As long as it remains undocumented, we can break this in future (maybe > years from now, but still...). Fair enough, I've had to fix this feature from time to time due to breakage in the past. I just pushed d0d838b02 which should hopefully prevent future breakage: https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=d0d838b02e44a40adca14d6eae39fd4c364730da It adds a unit test for this feature, and makes the docstrings for org-babel-python-initiate-session(-by-key) more thorough. It also improves robustness if the source block is executed before run-python finishes initializing. > 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? Note that I'd like ob-python to keep working with run-python, even if it's invoked outside of an Org Src buffer.