From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id PsbWI2hdzF6KBwAA0tVLHw (envelope-from ) for ; Tue, 26 May 2020 00:06:00 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id 2Aw4H2hdzF44cAAAbx9fmQ (envelope-from ) for ; Tue, 26 May 2020 00:06:00 +0000 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 018D79404C3 for ; Tue, 26 May 2020 00:06:00 +0000 (UTC) Received: from localhost ([::1]:53572 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jdN6U-00024n-Ud for larch@yhetil.org; Mon, 25 May 2020 20:05:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50660) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jdN66-00023E-7R for emacs-orgmode@gnu.org; Mon, 25 May 2020 20:05:34 -0400 Received: from pb-smtp2.pobox.com ([64.147.108.71]:53436) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jdN65-0003eE-3b for emacs-orgmode@gnu.org; Mon, 25 May 2020 20:05:33 -0400 Received: from pb-smtp2.pobox.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id 57E6A68929; Mon, 25 May 2020 20:05:32 -0400 (EDT) (envelope-from kyle@kyleam.com) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:in-reply-to:date:message-id:mime-version:content-type :content-transfer-encoding; s=sasl; bh=+OS7bfgxPKwiciidcmz4+fjhF Ys=; b=UQoZyqCUv8T/v7PTgH78jJHHVkbd8n1IHvdzKq3w1t3/kDURozYgwkTjF vEHSr3/k0BHa7rZvlx8wTs929w9+CeEMBa2ZfJGJkVjvMi9d2auN3znY2AH0spot q0GfZgO5zgZNHh6j5gtu7xpYxtalSFEnImIA0P8WF71RiUm/A4= Received: from pb-smtp2.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id 4EE4468928; Mon, 25 May 2020 20:05:32 -0400 (EDT) (envelope-from kyle@kyleam.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=kyleam.com; h=from:to:cc:subject:in-reply-to:date:message-id:mime-version:content-type:content-transfer-encoding; s=mesmtp; bh=TmLfTq5ZiDGBgowFzAagvMc1yu5YkEVJ7CjYKizHs9w=; b=gtt5qL9OKoc+gnbhCqcV+O1DBx01/PMArd+BRYPqeOitgICeJgFJG0WTxeOgIKPyf0U9AhXYeYNQk7hoUr2U6oVAqgOsdZVxpm2UdX6tB0ZqJjk0MVDu+B8vo6fxgF4+CJl2VstuufCS5O/K8ViXokPiToZgXVO2hxp0W4BaplA= Received: from localhost (unknown [45.33.91.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp2.pobox.com (Postfix) with ESMTPSA id 99F2468927; Mon, 25 May 2020 20:05:31 -0400 (EDT) (envelope-from kyle@kyleam.com) From: Kyle Meyer To: Nick Daly Subject: Re: [PATCH] ob-haskell: Line Continuations Mangle Block Output In-Reply-To: Date: Tue, 26 May 2020 00:05:30 +0000 Message-ID: <87367nlfw5.fsf@kyleam.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Pobox-Relay-ID: 9D43E11E-9EE4-11EA-A910-D1361DBA3BAF-24757444!pb-smtp2.pobox.com Received-SPF: pass client-ip=64.147.108.71; envelope-from=kyle@kyleam.com; helo=pb-smtp2.pobox.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/25 20:02:53 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Org Mode Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=pobox.com header.s=sasl header.b=UQoZyqCU; dkim=pass header.d=kyleam.com header.s=mesmtp header.b=gtt5qL9O; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Spam-Score: -1.21 X-TUID: ismWUpss7dE3 Nick Daly writes: > On Sat, May 23, 2020 at 7:02 PM Nick Daly wrote: >> : "^\\*?[[:upper:]][\\._[:alnum:]]*\\(?: >> \\*?[[:upper:]][\\._[:alnum:]]*\\)*\\( =CE=BB\\)?> " >> >> =3Dcomint-prompt-regexp=3D's variable documentation calls out much simpl= er >> regexps >> >> : "^[^>]+\\(> \\)?" > > This simplified patch breaks one case that I'd forgotten about: the > true one-liner, where the output displays before the "Prelude> " > prompt even appears. > > #+BEGIN_SRC haskell > [... several examples ... ] Thanks for the nice examples. It'd be great to eventually include at least some of them as tests. > diff --git a/lisp/ob-haskell.el b/lisp/ob-haskell.el > index bea162528..6ac34f2f5 100644 > --- a/lisp/ob-haskell.el > +++ b/lisp/ob-haskell.el > @@ -56,15 +56,27 @@ For the next iteration, could you send a patch generated by git-format-patch? See . Please also consider signing copyright papers, but I suspect the ob-haskell.el changes will end up being few enough lines that they can be accepted as a TINYCHANGE. > (defvar org-babel-haskell-eoe "\"org-babel-haskell-eoe\"") >=20=20 > -(defvar haskell-prompt-regexp) > +(defvar haskell-prompt-regexp "^\\(\\*?[[:upper:]][\\._[:alnum:]]*\\(?: = \\*?[[:upper:]][\\._[:alnum:]]*\\)*\\( =CE=BB\\)?[|>] \\)*" > + "Filter out prompts from Haskell interpreters: > + > +GHC: > + > +- 'output > + ^Prelude> EOE' > +- '^Prelude> output EOE' > +- '^Prelude| Prelude| Prelude> output EOE' > + > +Unknown Interpreter: > + > +- '^> ' > +- '^=CE=BB> '") This is inf-haskell's variable. ob-haskell shouldn't set it. The original (defvar haskell-prompt-regexp) just silenced the bytecompiler. If ob-haskell needs to tweak comint-prompt-regexp to deal with the "^Prelude| Prelude| Prelude" above, it should done without overwriting an inf-haskell value. As touched on in my other email, there's also the issue of compatibility with versions of haskell mode before v17.1 that lack a haskell-prompt-regexp. I believe this is why you're seeing the undefined errors. So, I dunno. I'm not a ob-haskell user or a really a Babel user. But in my view it'd be cleaner to just leave inferior-haskell-mode's comint-prompt-regexp alone and strip the "Prelude| Prelude| ..." once the output comes out of org-babel-comint-with-output. It's hacky and error-prone, but I don't think it's so different than what org-babel-comint-with-output already does.