From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id 2E8eHr4YpGU0iwAAe85BDQ:P1 (envelope-from ) for ; Sun, 14 Jan 2024 18:24:14 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id 2E8eHr4YpGU0iwAAe85BDQ (envelope-from ) for ; Sun, 14 Jan 2024 18:24:14 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=DMJHR6Yd; 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=1705253054; 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=7V1Twvh497ihNZ1V+ryWNsEqz6BrNnUM8b4/sOBGoBY=; b=Q+m+2RKFT1WgtwqdXb4nUx0M0vDGrxO0B+PXBhqjLhp2j45jiPJNUDodVr7Wd7kUGmZO1A tsqXtwJzgEobcp3q9ZXkppm4U3qzlCQ5slxPBl4IIyKfARTWQDbSU/w7oov9eoeESNvX39 WYntAIYXP5osyoe/sReXENfhBnEIiI3oH2gghNiG/FCQo96t2wuGdAOjopVasDjmTUf4hw qz/o0yQFvtB5uM1tF8mxcR9cQaAXkZ24w4/TETl5DVAO93vKn6gUAq74A2+7JeUSQGX7ex 9E0NETkteOJRrZlHQdJWIXMdZj3nKq1098GBifFzhDfBAkmblztM25+lHJuTfg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=DMJHR6Yd; 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=1705253054; a=rsa-sha256; cv=none; b=bzd4hq2EU+Gb8ehYpTqXNFSeublP1PMY7/FpxGE3p4G3ofxpAX5jIHMm0+nnlzTHkbM4CF hN7Ir4Vc+IzjpMR+VQJAWll7+cURcA1HMDtuBQVt6foscYMbjymkAGHz4T8Zl0BvK4qRgf FmXqx8U8CkGRLpwyKdSrdcvDJ48TuEkiHzh3Nn66U9Og/jADFnjpdjOelVQhm462uvnfAN AvHuA3ARP9syO7tvTIy48S8MCp2/7+E9KgK7JRfAlIM4cZKGQk5PSjn4lVVzShbrNUXT94 WBsqBWO15kk6aW92gfOAxOw4JPcZ5e8P9N2Cy+xZxn+1ACa/fW5nanN+bh11DA== 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 17A145B91C for ; Sun, 14 Jan 2024 18:24:14 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rP4Ce-0007Qg-2l; Sun, 14 Jan 2024 12:23:20 -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 1rP4Cc-0007QJ-0h for emacs-orgmode@gnu.org; Sun, 14 Jan 2024 12:23:18 -0500 Received: from mail-il1-x132.google.com ([2607:f8b0:4864:20::132]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rP4Ca-0006uX-EP for emacs-orgmode@gnu.org; Sun, 14 Jan 2024 12:23:17 -0500 Received: by mail-il1-x132.google.com with SMTP id e9e14a558f8ab-36091f4d8easo29198055ab.2 for ; Sun, 14 Jan 2024 09:23:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705252995; x=1705857795; 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=7V1Twvh497ihNZ1V+ryWNsEqz6BrNnUM8b4/sOBGoBY=; b=DMJHR6YdutiwK4vYcm2igoCl7zseZrgywp7sxDlM+zPQzh7gv4PfqUb+XtYN5MKkvc B9N8T1Jc7lz+pqdZVaQpB+sLOFm+Gbx87LIUGhBX4ItGG/9/08UGnQuLfZtB7Gq/YLaI bOOcUhodYQSZq5n3uPtIwrlrQuskK2emveoLJC6svFSD9ia96fN9cZbkUI7ecrrCC3BO X9J08El0NpsuPLbcW+8VDT5ymX4ZKoltukCoGGuiQaKUyL9r36etEvI0j8hL8NLt/I0T izwuSUWYwmkqeGJnz+0E6LbzQ1OyB1kkBDdNBxt9kITRT9DaRTZz1EbA1Yg6yRCTan1y HPVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705252995; x=1705857795; 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=7V1Twvh497ihNZ1V+ryWNsEqz6BrNnUM8b4/sOBGoBY=; b=ldWB57F7t78jrvRIZvmlWK2cktvUCZa7NqHf/3q/xjGW+stB1eCiJoJLXB1LH47NHm JHvQf7ZH511JbCCmfP4jJ3conJ+fzRQY2OmayRFLVtKNGiUz7hW0XuypLXGKM5yaCZFu I7j+x6itkc/FC1FzFBFW4hOD5gVUD64Zhtl/5Hgulx1gITUZkYZNUsKN6804AZecgnu8 sVRRoLumGUrfQT6PwPXEiZ3DO7i1WaerPz2dingHIjuq0Kn3d1rUzHwxwhLkDnXg9YUx gEWMNbFyIHmlASbfVCRao8Hz7DEyUqQh9Pj7LppTWJ/vk7fnt+FY3Uf9K953+jRWRqBz Sagg== X-Gm-Message-State: AOJu0Yz5kvyDXgIcNOBgpEa1P52zcYFT/1YJtQ/Kgw9QVl4CgfzBoR6r selo2VM5UZvaB5tFOQLloZI= X-Google-Smtp-Source: AGHT+IGkFDV9O4QflLPdfacSIYQ3CIThK18e74HueudwumfeW0vp+RlrSBwoJu937RS71Hkdt3Y6vA== X-Received: by 2002:a05:6e02:1b0c:b0:360:7b9b:a887 with SMTP id i12-20020a056e021b0c00b003607b9ba887mr4721361ilv.12.1705252994774; Sun, 14 Jan 2024 09:23:14 -0800 (PST) Received: from localhost (157-131-78-143.fiber.dynamic.sonic.net. [157.131.78.143]) by smtp.gmail.com with ESMTPSA id jx2-20020a170903138200b001d46d9953a3sm6327049plb.241.2024.01.14.09.23.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Jan 2024 09:23:14 -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: <87a5pdqt21.fsf@localhost> References: <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> <87zfxgxb8m.fsf@localhost> <87r0ir2ln8.fsf@gmail.com> <87zfxewewe.fsf@localhost> <87le8x3e0a.fsf@gmail.com> <87a5pdqt21.fsf@localhost> Date: Sun, 14 Jan 2024 09:23:13 -0800 Message-ID: <87il3v3k3i.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::132; envelope-from=jackkamm@gmail.com; helo=mail-il1-x132.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: -10.00 X-Migadu-Queue-Id: 17A145B91C X-Spam-Score: -10.00 X-Migadu-Scanner: mx11.migadu.com X-TUID: BCtFFUJU8cl8 Ihor Radchenko writes: >> It's annoying there's no way to tell ESS to start new session instead of >> evaluating in existing one. Here are a few alternatives we could >> consider to deal with this: >> >> 1. Change the worg/ORG-NEWS, to suggest users make sure the session >> exists (either by evaluating a source block or call "M-x R" in edit >> block) before running ess-eval-line. >> >> 2. Add ob-R and ob-julia customization options (as previously suggested) >> to explicitly control the startup behavior (either to auto-start, or not). >> >> 3. Submit PR to ESS to add a variable we could let-bind, to force it to >> start an associated session rather than evaluate in an existing >> non-associated sessions. >> >> Currently I lean towards a combination of #1 and #3, but am not sure, >> and happy to go with whatever you think is best. > > We can also advice `ess-request-a-process' as a temporary workaround. My concern is that advising `ess-request-a-process' would cause maintenance burden on ob-R. It would require some knowledge about the ESS internals to maintain properly. Reading through `ess-request-a-process' is rather daunting, and it doesn't look straightforward to patch it to behave as we want. I think the reason is because ESS allows you to call `rename-buffer' on the inferior R session, and still have it remain associated with its editing buffers. Which is quite a different model than the way python.el works. After some more thought, I'm now leaning towards #2 as the best and simplest option. In particular, I think ob-R should have an option `org-babel-R-start-session-on-edit', which would have 2 options, nil (default) or t. No need to add an option for the current "earmuffs" behavior unless we find someone who actually wants it. Then, update Worg documentation to suggest manually calling "M-x R" if session hasn't already started yet, or to set `org-babel-R-start-session-on-edit' if the user would like that behavior. The alternative (trying to make `ess-eval-line' smart enough to start new session without user intervention) seems overcomplicated from Org development/maintenance POV, for too little gain. Clear documentation and configuration options on Org side are good enough. This is a bit of an edge case anyways, and unless there is interest from the ESS developers, I think it is too much struggle to try and change how ESS works for this. (But thank you for emailing ESS to ask).