From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id uNPWOEvSc2WDfgAA9RJhRA:P1 (envelope-from ) for ; Sat, 09 Dec 2023 03:34:52 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id uNPWOEvSc2WDfgAA9RJhRA (envelope-from ) for ; Sat, 09 Dec 2023 03:34:52 +0100 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 BC31C31595 for ; Sat, 9 Dec 2023 03:34:51 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=aVs+jhr9; 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=1702089291; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=1bQZ2IhE42c7ovZ9GK3inBbpScVHjp/IyLsGeZYM0jI=; b=BMbCYGZEah3ia0soXJLPJPZKQ45VkGO3z6GLUmE9tTtS5yL9qQyly2AxWExmhAw6cd4w3g HYsjigS6ausEQ2YA7Dpq6wC4fChSIq/K0buz5VrcNWE8SNen8+o4KY53h4PWVT9v8zy8Mg QMBPDNLNpneifph9COruuSw7dieXOwHFk+HdR9PbxQ5BO5ubPOqaQ/oeP1jaOEJcxe02zl U0VsKZDTPj9uu42KoBu1MjRmVEjEpNbIcf3XgCa5SqslA3URtUTzN0JgUpBdswsvR3liWy TPAWx5F9mVjwBy/6zrSQSoO4xzobxoXLPNItFzpvZHwyk2TUQZvvRRI51Zduzg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1702089291; a=rsa-sha256; cv=none; b=g7IEVjTFiGwxa1vQsUkcB/cUE/WvjoovpnM8IH7pRta0fTgZ5/WW97AafdDsSQkf7nFvlL XH4BJI+z9CRvZ42NzmnYsDj6JoNZBEKYl4mj68TE2SZ+tsLKhjMUXMy1qCggvIu8/GUlBD yRn64hm4eLw2CUmDTFBjH7ULXWFHEzjAWDUFf4xDozXAb28x9Qy3pSLfNpJcPJKFEh1s0W 7+hbpC9GI+13Wa/XXhTjqPfyOMcTBzlJ+Qp9tigVzwp3RN5a3XmoQPAbV6WhmhjwolPTLc b1jXrrvad2EXsCYjsNKQ9dvHAA+ryhNvozXO7jvd5SjCyhZo82vzz3dvWsYnFw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=aVs+jhr9; 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 localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rBnAV-0004nZ-8q; Fri, 08 Dec 2023 21:34:15 -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 1rBnAT-0004n7-An for emacs-orgmode@gnu.org; Fri, 08 Dec 2023 21:34:14 -0500 Received: from mail-vk1-xa2c.google.com ([2607:f8b0:4864:20::a2c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rBnAR-00050r-MB for emacs-orgmode@gnu.org; Fri, 08 Dec 2023 21:34:13 -0500 Received: by mail-vk1-xa2c.google.com with SMTP id 71dfb90a1353d-4b2eaa89796so721498e0c.0 for ; Fri, 08 Dec 2023 18:34:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702089249; x=1702694049; darn=gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=1bQZ2IhE42c7ovZ9GK3inBbpScVHjp/IyLsGeZYM0jI=; b=aVs+jhr9KbFw2T88a1m41snliuwPKKBXUqZwUc8ReuhHbh+O/G9sR8dLguzFNM/GjD vj5DwWsReQsvj3JxaqJwnvmoRa3r+OB1At3Ia8By2CwpAya3/89IetbRRMMhNBZvABz5 geP3PHOiXMy+r61I0iIquNmkxqRzHQlc0De0LJIgAuc8gbElrhXcAcicub1FZBBKocMx fdI+aHClF8VaUZrkRX7nocXbl8LwblxojLDCL8ANvQ+ncS6RicOcu7BvLNiDd8qPsU06 VkRgmcnbqh2cjlO30bjUi4qdqAhoJqeaGYT9P8OcVMzgpJaOpF6CPgWuv13JH9m7G9pq e8PA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702089249; x=1702694049; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1bQZ2IhE42c7ovZ9GK3inBbpScVHjp/IyLsGeZYM0jI=; b=ajq64ph587m5Qr6e9wxImrzhBIjGdrC4jqeeJ7iF10RA/FY7ZqRozQFfpf3HFGxago dtI4/b6LGC7qorOn3zKVKtHvNLqaF3AflDeQjs9m2hqyPgVE79jJJDPqEBLk2IC5urnl t298AbLFQQZfaCIHV3+96YiN9vlD/rAf+C+zd4QCDqpAawPCM+cV5HGgIsoYJ6oz+/2x 8GQY8VuWs5npKcCc/Zw29RgjtoB9tcM7KXfxtu9fNDH1+AQ4V2Gen7kRhLVQeHXSYAny Q2fDwIwlFTSqBhR3pSSQRbjuRtu2RsK6b+b0Ecbz1TnUNjyDMMsuibLtOqQ3CSqqEURs 2FAg== X-Gm-Message-State: AOJu0YzE8mQhL1X/Mek95zA7eE6tPPeoeFzLW0m+pbcuDgVxj8zgwDVb BkkuVy2jwHnQqhlrSjc28Moj6D90pgYo9U/G+lUpY5PXCZWK7A== X-Google-Smtp-Source: AGHT+IF0jrPGrO8QivI0KdPueAVtORr0I8nsTf5R0D/WWNsPyx4Ir9966huBYDW4AK2Yqcp7y/z+v1ayQHmjdaS3lcw= X-Received: by 2002:a05:6102:32c9:b0:464:4eef:b9a9 with SMTP id o9-20020a05610232c900b004644eefb9a9mr1233046vss.0.1702089249264; Fri, 08 Dec 2023 18:34:09 -0800 (PST) MIME-Version: 1.0 References: <87zfyosw8n.fsf@localhost> <87ttovlb1u.fsf@localhost> <878r6647vv.fsf@localhost> <87bkb2rqer.fsf@localhost> <87edfwsuvx.fsf@localhost> In-Reply-To: <87edfwsuvx.fsf@localhost> From: Liu Hui Date: Sat, 9 Dec 2023 10:33:57 +0800 Message-ID: Subject: Re: [PATCH] Set Python shell in Org edit buffer To: Ihor Radchenko Cc: emacs-orgmode@gnu.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2607:f8b0:4864:20::a2c; envelope-from=liuhui1610@gmail.com; helo=mail-vk1-xa2c.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 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_ENVFROM_END_DIGIT=0.25, 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: -8.83 X-Spam-Score: -8.83 X-Migadu-Queue-Id: BC31C31595 X-Migadu-Scanner: mx12.migadu.com X-TUID: EMaixv945NKN Ihor Radchenko =E4=BA=8E2023=E5=B9=B412=E6=9C=888=E6= =97=A5=E5=91=A8=E4=BA=94 21:06=E5=86=99=E9=81=93=EF=BC=9A > > Liu Hui writes: > > >> What about displaying a yes/no query about starting a new session when > >> there is none? > > > > I think it is OK. I can add an option to allow users to disable the > > query. WDYT? > > I now have second thoughts about obsoleting > org-babel--associate-session. > If we need a customization for the new session dialogue, I expect that > users will be willing to set it for all src blocks that support such a > feature, not just python. But then we somehow need to make this global > customization visible to babel backend authors - something we normally > do using the set of org-babel-...: functions. > > What I am thinking now is > 1. Introduce a global customization for users to choose whether to > start a new session in org-src buffers with allowed values t, nil, > 'ask, or an alist of (lang . t/nil/ask) for per-language customization= . I think it makes sense. Currently, org-babel-edit-prep:R/julia always start the session when editing src blocks with a valid session header, and other backends don't. It would allow users to change the behavior. > 2. Check the new variable and attempt to run > `org-babel--associate-session' in org-src-mode definition. I think associating the edit buffer with some session doesn't require starting the session, which is at least feasible for ob-python. When editing python src block, users can use C-c C-p to start the session themselves for evaluating code. So it would be nice to allow a value of 'associate in the customization, which means just running `org-babel--associate-session'.