From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id GHH/MHhmE2f1jAAA62LTzQ:P1 (envelope-from ) for ; Sat, 19 Oct 2024 07:57:44 +0000 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 GHH/MHhmE2f1jAAA62LTzQ (envelope-from ) for ; Sat, 19 Oct 2024 09:57:44 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=iO3jYyg6; dmarc=pass (policy=none) header.from=posteo.net; 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" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1729324664; a=rsa-sha256; cv=none; b=nxPfmqYOC375/cHzhvHk45oy50YHwL/3Rdhur+SgHQnGxxDWeBmP81QYoI7FSBmf7K3ACK KF6lupDCUKVfUo3dac/oZHrGrrorGCjxDGxD/Mhjj2uVfSHU0VqIwE0Yc5OGIqNCCbXm5H iQtdHFpo/8FNe1OUZ6Rn8IngFpaK/zUrtLXOjLy9hpTz+ysn9FR3sotdZmWnqvAwHrpX6w /LXm6fpefpnrrVpgZjDAKrPIWV/6UJwmV47lEGIvnakfRgOG8eC6FqHMsUCM3ZcT3rIhBr u3lraJC/6mL216eaXzkwA60AgmgmQsuVNQzbOxmQ6U0no7Tta/J6DsEGSRqibA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=iO3jYyg6; dmarc=pass (policy=none) header.from=posteo.net; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1729324664; 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=lwWwZ+/sjOcUrmt1NJhtHkPSEWQekaimrAI9PpD2bd8=; b=AM05DBaDdkdHA4LD6p8gNMsR0NNejijHkZQQEaiRFRFxTYtBwCHAf0HIT3ZjPYctGc4YsK 1jirxU6csa0LXzANivcT7esBFT4rsgN8AZNX8pMkhWY6HBkA3Qy9x62TW9Ec0rnCgwl04N dktKrvOYvOaLDYp4DVcBeDoqMLUmYiMs1/vf4dwv9E9lrISBs4pjNlD+xe2mkJffen6sDK s2ZTckOVsVinQPIj3vzHBU9kFy8AFUq1HNB7tjtvxn2D6YMxo4bsbQnOSeEH+tv7nfedpV BbdNap+bmIJ72YhTGrdlF6kL0W9PYhdx7TaAEOmr9kbupVPQXzBJgAY0deNMyA== 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 4F097F63 for ; Sat, 19 Oct 2024 09:57:44 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t24KU-0000Cb-OA; Sat, 19 Oct 2024 03:56:54 -0400 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 1t24KT-0000CR-9P for emacs-orgmode@gnu.org; Sat, 19 Oct 2024 03:56:53 -0400 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 1t24KQ-0007zS-E0 for emacs-orgmode@gnu.org; Sat, 19 Oct 2024 03:56:53 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 6B283240027 for ; Sat, 19 Oct 2024 09:56:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1729324606; bh=1UZGxStERDF+qbMfPWrGBzyfm6XUCx+10GUIYS/p90I=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=iO3jYyg6mMrsvErwQYZ6WVBfAq+Sr1Cz0UfixXS3V3u3Hb9vNw8Arouj2hPVPLlSj dJoWeQn/Thu0+W+LRzTq8bR0v3LQRatTYP5O4ks/jMk7mrZfRFsEDlAoxxAPN/a2iv SXgaXnZOw7sCmiBZZ87j6uA8scBq67xhzdms++CfpJ46Y4tgcaYiyT0MHWZgOnIaht SGUSS7zy7JpL5Xl6hdFyzpnmKgT8O54/NjtkrN9Rur8S9Odd821LiEEcZsdESq9TPk Ckq4uV3XDs7y7jjZZlJYFHJcHhVEZip1EsdUJIwLDNNrHwrLy/yQgP71I5A4LXfvMD iZ5tuWFI04z9w== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4XVv6P26wgz9rxR; Sat, 19 Oct 2024 09:56:45 +0200 (CEST) From: Ihor Radchenko To: Jack Kamm Cc: emacs-orgmode@gnu.org, matt@excalamus.com, jeremiejuste@gmail.com Subject: Re: [PATCH] Async sessions: Fix prompt removal regression in ob-R In-Reply-To: <87wmi9etku.fsf@gmail.com> References: <87setrqs4z.fsf@gmail.com> <87wmiqigfp.fsf@localhost> <87wmi9etku.fsf@gmail.com> Date: Sat, 19 Oct 2024 07:58:33 +0000 Message-ID: <87h698wml2.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: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: -1.18 X-Spam-Score: -1.18 X-Migadu-Queue-Id: 4F097F63 X-Migadu-Scanner: mx12.migadu.com X-TUID: m4oM/xQ5Yuho Jack Kamm writes: > ... > Therefore, I've attached an updated patch that provides such a mechanism > for ob-R and ob-python, reverting them to the Org 9.6 behavior. This is > done through a variable `org-babel-comint-async-remove-prompts-p', which > is set by an optional argument in `org-babel-comint-async-register'. Looks reasonable in general. > More generally, I think it is best to avoid doing the prompt removal > when possible, since it is difficult (impossible?) to do it perfectly, > and it can cause many problems. This is why ob-python avoids using > `org-babel-comint-with-output' -- it sources a tmp file rather than > inputting code directly to comint, so that prompts do not leak. I think > non-async R evaluation would benefit from a similar approach, and plan > to propose a patch to make ob-R non-async eval more similar to > ob-python. Agree. The prompt removal code is there simply because comint has no reliable facilities to distinguish between prompts, input, and output. If we can avoid it, we should. I recall the annoying issues with ob-ruby, where the REPL spits prompts asynchronously, making prompt filtering very hard (impossible?). https://list.orgmode.org/orgmode/875y4vv8ie.fsf@localhost/ I have one small nipick comment on the patch: > (org-babel-comint-async-register > session (current-buffer) > "ob_comint_async_python_\\(start\\|end\\|file\\)_\\(.+\\)" > - 'org-babel-chomp 'org-babel-python-async-value-callback) > + 'org-babel-chomp 'org-babel-python-async-value-callback > + t) Rather than `t', I'd use something more descriptive like 'disable-prompt-filtering. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at