From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id n9quMTOMBWRodwEAbAwnHQ (envelope-from ) for ; Mon, 06 Mar 2023 07:46:11 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id iPRwMDOMBWSsCAAAG6o9tA (envelope-from ) for ; Mon, 06 Mar 2023 07:46:11 +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 695992393D for ; Mon, 6 Mar 2023 07:46:11 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=excalamus.com header.s=zmail header.b=GjQyWIcM; dmarc=none; 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=pass ("zohomail.com:s=zohoarc:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1678085171; 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=J+QVHq8iRmx+EnzOEsnswpJ0ITumNZ94kivOBi/x+hE=; b=kqUVQAdLus/WqReG3w6f1sOwDuYsAKOrEp+7OAs/Nyj0TxrL3lMXdcQ0tEs1Kj3TAZD31C 6FcTpOgTlS9cBtUVQfYgXm3fwhxzsVc3GQ8x8/e2UGEBiaa2G++F613cgxZEcQAjYznaGA 238WfQo4gCLJLfzwGvfcsQ6q0gpfr7I1PseRmoZv/8KoFxdTYZCZmrJl2HvOvqNOa48FLn tdPy6jg1UAnvxrUVtHHJJ1OtrMPMVOlTqH42kBxQZlfYROI6HSM1+26Ox3a8daE8ge6d6f HgTLOvWT/saXgLtMzTtfA48RVCcKaY4Xt+vIqmb13J15UzDN71vUngJ8vuRv3w== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=pass header.d=excalamus.com header.s=zmail header.b=GjQyWIcM; dmarc=none; 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=pass ("zohomail.com:s=zohoarc:i=1") ARC-Seal: i=2; s=key1; d=yhetil.org; t=1678085171; a=rsa-sha256; cv=pass; b=eAYXg0xKB3HghKCOoaL17sXjy26zVcPXBFDJB1picoIBmG4LsErGZmjhUr0jZAudfmXqmH x5wGx7wLoFdjbvK+0WPKKp2CWK8/EQcRiBSnnpYSeqk/b9+nCZMYeC05vgs7U9PA8Vz5R+ +NvriOQGuZ2N2XPTIiKyxdkGv3TsxEwVHHV9dUqx1V0Xy8Dkic3BJicBlfwZEZ5RV2Ccdr 1o5G48jYhBJBxGehKnXUF4TMXfS1GnjTJC0EsFYuGYN3HTrs01SyfhiZ6Qm5mHCSFGe7Dl 7CXdEGthlgKTgFQjbgALGVT2l0wSJwXAvGQlSMT09q+u3HgQmO+Qek+MAfnS9g== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pZ4ay-0001lT-Ub; Mon, 06 Mar 2023 01:45:16 -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 1pZ4at-0001lA-5d for emacs-orgmode@gnu.org; Mon, 06 Mar 2023 01:45:12 -0500 Received: from sender4-op-o15.zoho.com ([136.143.188.15]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pZ4ar-0007qP-3F for emacs-orgmode@gnu.org; Mon, 06 Mar 2023 01:45:10 -0500 ARC-Seal: i=1; a=rsa-sha256; t=1678085104; cv=none; d=zohomail.com; s=zohoarc; b=T/ttvi/9l08gmUdfekg9jqJPVd258O/DuGfKuco3neWwg5tduJuAeBuvNu1ZammedeXofr32VYW8gc3ixKpxqA4xHfOVleS6QWKvcawLe5TgShFsG2RZy7ATVAAp4uiF1B+kcJr2N7OK4Um0xE4WzWuo246T9/8jgY2SB1Z2Ziw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678085104; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=J+QVHq8iRmx+EnzOEsnswpJ0ITumNZ94kivOBi/x+hE=; b=HtqZbcYH9N7lOxFY4dWbvjc5rPKNFnwUmerfQd2xkha47hImqkUTirLF+xkbAQFhY3uE2vGaxrSDQRxh7FNTa+1GRvwtMARx4J9i0nPdmY1nipT7LYjqVgtfE+X1dZ4ssZlcuFccFoqTGhsexNV5vwYOH6fVxcShYRFe7hYOW7w= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=excalamus.com; spf=pass smtp.mailfrom=matt@excalamus.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1678085104; s=zmail; d=excalamus.com; i=matt@excalamus.com; h=Date:Date:From:From:To:To:Cc:Cc:Message-ID:In-Reply-To:References:Subject:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To; bh=J+QVHq8iRmx+EnzOEsnswpJ0ITumNZ94kivOBi/x+hE=; b=GjQyWIcMuUAWU671ntAIwRrFHJBSCvnioc0AVRc2zrgVIb5E6EHAzbmUBoFMBWX7 2gWwglwDINMBdtC2DUt157lBWufEbTkA7Xvurz61IwZbgP1sd5EhL3VB3lmFi9+qjSV uE+9tIO+5o3qshxtpKAPPg9lEvaw2suOgZa23tYQ= Received: from mail.zoho.com by mx.zohomail.com with SMTP id 1678085102950241.65295825693204; Sun, 5 Mar 2023 22:45:02 -0800 (PST) Date: Mon, 06 Mar 2023 01:45:02 -0500 From: Matt To: "Ihor Radchenko" Cc: "emacs-orgmode" Message-ID: <186b5aa9d56.1238923db2169250.3173443400140454866@excalamus.com> In-Reply-To: <87ilffz95g.fsf@localhost> References: <186283d230a.129f5feb61660123.3289004102603503414@excalamus.com> <87v8kd8zzw.fsf@localhost> <1863472efe9.10fdd5ba4258906.5972264927968042941@excalamus.com> <87y1p7axpe.fsf@localhost> <1863d69188f.11e078bd1228881.451172865246440158@excalamus.com> <87fsbcbf47.fsf@localhost> <186471d8980.c36aecd0374444.2548279362371712281@excalamus.com> <87sff73r0g.fsf@localhost> <18658639a30.dec640641420614.2364646537016397698@excalamus.com> <87lekwd10z.fsf@localhost> <1866bf50874.bc4ef1a92164564.1238825567948423531@excalamus.com> <87r0ukefzv.fsf@localhost> <1866fda933d.cf33745c2396994.7118762013608820270@excalamus.com> <87sfeyc7qr.fsf@localhost> <1869ff63e3e.f8c4ed671354538.4585567073216319262@excalamus.com> <87bkl96g6e.fsf@localhost> <186a89b5a24.cc4913fe1885630.21323979015166045@excalamus.com> <87ilffz95g.fsf@localhost> Subject: Re: [PATCH] Async evaluation in ob-shell MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Importance: Medium User-Agent: Zoho Mail X-Mailer: Zoho Mail Received-SPF: pass client-ip=136.143.188.15; envelope-from=matt@excalamus.com; helo=sender4-op-o15.zoho.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, RCVD_IN_DNSWL_NONE=-0.0001, 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: X-Migadu-Scanner: scn0.migadu.com X-Migadu-Queue-Id: 695992393D X-Spam-Score: -8.59 X-Migadu-Spam-Score: -8.59 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-TUID: hBxa7qZu0pkj ---- On Sun, 05 Mar 2023 07:14:21 -0500 Ihor Radchenko wrote --- > > Matt matt@excalamus.com> writes: > > > > Sorry for missing that. The issue is that when I replaced > > `org-babel-sh-prompt' with `comint-prompt-regexp', the regexp no > > longer matches the output and grabs the next prompt. It looks like > > the reason is `comint-prompt-regexp' is set to "^org_babel_sh_prompt> > > *" (with two spaces between the '>' and '*'). Attached is a revised > > patch which removes one of the spaces by changing how > > `org-babel-sh-initiate-session' sets the `comint-prompt-regexp'. > > Another place this could be done is in the defvar for > > `org-babel-sh-prompt' itself (which ends with a space). However, I > > think it's customary to leave a trailing space for prompts? > > The actual prompt is "org_babel_sh_prompt> ". Agreed. > And we want to skip leading spaces in addition. What do you mean by this? > Adding " *" does not make the prompt match 2 spaces, but 1+. Agreed. It's not clear to me what pattern you're looking to match. > > > > + (let ((uuid (org-id-uuid))) > > > > > > Do you need to use `org-id-uuid' here? ob-python directly uses `md5'. > > > If you still prefer org-id-uuid, we probably need to move it to > > > org-macs.el > > > > I just need a random string. `md5' would work for that. However, > > might it be better to update ob-R and ob-python to use `org-id-uuid'? > > Both of those manually declare the randomness. It's conceivable that > > someone may delete or mistype the number (100000000), resulting in a > > lower entropy. An md5 is also not a uuid, strictly speaking. Of > > course, the chance of collision is still basically zero and the cost > > of collision about the same. Using `org-id-uuid' would only provide a > > consistent way to do things. > > `md5' will be slightly faster compared to `org-id-uuid'. But it should > not matter. > > If we want use `org-id-uuid', lets move it to org-macs.el. Requiring the > whole org-id.el must not be done. It has side effects of defining id: > links. In the next revision (once we figure out the regex), I can create a separate commit moving `org-id-uuid' to org-macs.el and updating ob-R and ob-python from `md5' to `org-id-uuid' (assuming that's not an issue for the maintainers of those). If you think speed is a concern, however, I can switch ob-shell.el to use plain `md5'. > > > (concat "^" (regexp-quote org-babel-sh-prompt) > > - " *")) > > + "*")) > > This is wrong. It unconditionally makes the last char in > `org-babel-sh-prompt' 0+. (Imagine it is changed to non-space in > future). When you say "imagine it is changed to non-space...", do you refer to `org-babel-sh-prompt'? Honestly, it's not clear to me what pattern(s) we need to match.