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 YEGgLG1Gj2WDVwEAkFu2QA (envelope-from ) for ; Fri, 29 Dec 2023 23:21:33 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id wBCLJm1Gj2XxKgEAe85BDQ (envelope-from ) for ; Fri, 29 Dec 2023 23:21:33 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=R9DA2Ky7; 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=1703888493; 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=sOpm+wQlN5b9xosMNArPTOU9j/hS8FRlYcP0YwwecKY=; b=pVP4v9n323oDSsQ4CQlKQzYRmoj1sT5A0DUb0g0Yuw2zrfgAeJjQE1RVUwvUe+BOr8BCek PcrHmQTYLGZHOPTgsglvv8ZGfKZ9BcNamcaJscoxG8SDR4pmCtgEHXQFB3tbISrVJGx8vW Xz61Ij0Uw/cJxw1sQC6lna4kihQTqqxaduCTL2KOMJlsvej0dtYcfDsmFpcCjQ3Jno2vzS pn9T6duvG+qKhSxPlyHYp0tfnx9J9b7vHSocfSxRLEboIsjcoiLSpXMpRmFwE2xIOO451t wWzOjhmb2FRSDUQvX82Bp/4hJbZtLcz8qngA7Zn2bpSn9eYpg8B4WdGf9VjD/w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=R9DA2Ky7; 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-Seal: i=1; s=key1; d=yhetil.org; t=1703888493; a=rsa-sha256; cv=none; b=U6HYElPdITDUIh4NLytqHVmpsNLoFwGJwtXbfEWTQRgER/0tnmJJCweFM70/g/sSag4SVB UK5O2DQ1Wz2e4ER7ZJ+TBXg4euU7SCzV2w52rVDqXuP4aNPI2c3ItEIRCrW5vqrCSk3kLK iUFmhUJI4w77iXrmVU25zWwknUN/DIXBu89Y15DZThBkvyF+SFruvJBLasrHBctK6xUAXV WV7zTIUwrauJXu7YMPT3d6flgK0MLF+gQ0leG1HMJU2yZeaTc4g/C5dhTV6HfTspSz9QhE nzjGBb5gvr14YBiFI6Borl/TmFZkOrfRVBP1w1UgS9VGNPBQXuzPQvCcRFiicQ== 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 8A2711601A for ; Fri, 29 Dec 2023 23:21:33 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rJLDe-0004Lo-RI; Fri, 29 Dec 2023 17:20:42 -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 1rJLDc-0004LZ-Va for emacs-orgmode@gnu.org; Fri, 29 Dec 2023 17:20:41 -0500 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rJLDb-00016W-FP for emacs-orgmode@gnu.org; Fri, 29 Dec 2023 17:20:40 -0500 Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-1d408d0bb87so51871205ad.0 for ; Fri, 29 Dec 2023 14:20:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703888438; x=1704493238; 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=sOpm+wQlN5b9xosMNArPTOU9j/hS8FRlYcP0YwwecKY=; b=R9DA2Ky7/oz3OGYzEqt2jWXJWxDivx0pOIZPVHo5tiUSarAXXnx13zY++rHIY1T30O xb0WN+TajBCSjH4AVYYsqB8o+Mv2swbOviOmUU4kBrECU1HBOwd6GGX29ImtiqsRv1ty H52YmSfNRvAJUwHiT8v4WIUbBywYCICcD/ODA6Lulw3HoJVT1qBcFbyju/K63PJqqnJ/ iRZZ1VhcXME+BmBJ0l8fEyFOv0afNlYy0Zj73F4CsJUxbzoXcBb7Uafhu+Kt+5YEvATv 0EWM2PDy6ghJgNO31WtilGc+34SBndqyWZO6zK9I6YVp8toLK4d/KOYqr4aV00XoQQxo 7OMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703888438; x=1704493238; 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=sOpm+wQlN5b9xosMNArPTOU9j/hS8FRlYcP0YwwecKY=; b=D/Xy3r9gTm79784NJrntTO2rRE47LQT3LU+7rRwnumj7escEekIK6vAvnwiWo4O3oY N3ST+0IPH6f3OPZSLEtatqlh2y3lvP2AtZiQxNE6Vh8kOvupZyBplDvWbUBG7GPChah0 /TMw5AcHbF0gUlCVy+FqzF0hv3xDkVlKU5xlNGM2RMT3LaWsOq6FuykWsLQT3m0ln3KF Vh0nhsp7Qw6AvTeTxrVRmGvNTrX01K5R2H4QW+X/7XsPZLSXWHntS11i03QUylnbPYPZ iIp0qU7A1aCZcuKS4D1dx/7UNU0TDgrh/4fIt2Z2TUyP3Ke2N1pu6ePSo2zBrRaQemN0 bdSg== X-Gm-Message-State: AOJu0YyRayhKwKc6NDrWNDL7gx4KJvT/x5I7aQegafZE2pqTe1Jd9Nq/ 7P8E+KHpASi4nrO/8DaQHIA= X-Google-Smtp-Source: AGHT+IFGmtw3mCqeRLYsHYIByJiL/7G7gDT8ic7AwSwW68KcwyuH51XAbIMWioTShszP0Jxk569XwA== X-Received: by 2002:a17:903:94f:b0:1cf:e9b5:90ea with SMTP id ma15-20020a170903094f00b001cfe9b590eamr17223361plb.36.1703888437826; Fri, 29 Dec 2023 14:20:37 -0800 (PST) Received: from localhost (157-131-78-143.fiber.dynamic.sonic.net. [157.131.78.143]) by smtp.gmail.com with ESMTPSA id a19-20020a170902ee9300b001cfb14a09a4sm16200631pld.126.2023.12.29.14.20.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Dec 2023 14:20:36 -0800 (PST) From: Jack Kamm To: Liu Hui , Ihor Radchenko Cc: emacs-orgmode@gnu.org Subject: Re: [PATCH] Set Python shell in Org edit buffer In-Reply-To: References: <87zfyosw8n.fsf@localhost> <87ttovlb1u.fsf@localhost> <878r6647vv.fsf@localhost> <87bkb2rqer.fsf@localhost> Date: Fri, 29 Dec 2023 14:20:35 -0800 Message-ID: <87bka81wi4.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::62c; envelope-from=jackkamm@gmail.com; helo=mail-pl1-x62c.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-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Scanner: mx13.migadu.com X-Migadu-Spam-Score: -6.30 X-Spam-Score: -6.30 X-Migadu-Queue-Id: 8A2711601A X-TUID: 3ibqHpHXa+ek Liu Hui writes: > But it is indeed possible that two sessions are inconsistent, if users > intend to have different org-babel-python-command and > python-shell-interpreter, which are used by > `org-babel-python-initiate-session' and `run-python', respectively. I have just proposed this patch, which will reduce this discrepancy by having ob-python sessions use the same interpreter as `run-python' by default: https://list.orgmode.org/87edf41yeb.fsf@gmail.com/T/#u Additionally, we could set `python-shell-interpreter(-args)' in `org-babel-edit-prep:python' to make `run-python' in Org Src buffer use the same interpreter as :python header or customized `org-babel-python-command'. See the changes to `org-babel-python-initiate-session-by-key' in the linked patch for an example -- specifically the part using `split-string-and-unquote' to get the 2 parts for `python-shell-interpreter' and `python-shell-interpreter-args', respectively.