From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [PATCH]: Fix ob-haskell.el to work with custom ghci prompts Date: Thu, 16 Nov 2017 22:04:24 +0100 Message-ID: <87k1yque93.fsf@nicolasgoaziou.fr> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46554) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eFRKq-00013w-6S for emacs-orgmode@gnu.org; Thu, 16 Nov 2017 16:04:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eFRKn-0004zz-0Y for emacs-orgmode@gnu.org; Thu, 16 Nov 2017 16:04:32 -0500 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:56087) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eFRKm-0004yn-QB for emacs-orgmode@gnu.org; Thu, 16 Nov 2017 16:04:28 -0500 In-Reply-To: (Doro Rose's message of "Mon, 06 Nov 2017 07:53:58 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Doro Rose Cc: emacs-orgmode@gnu.org Hello, Doro Rose writes: > I noticed that ob-haskell.el doesn't support custom ghci prompts at prese= nt. > Custom ghci prompts such as "=CE=BB>" are quite popular in the haskell co= mmunity, see for example > > https://stackoverflow.com/questions/42081379/how-to-set-up-org-babel-for-= haskell-with-stack > > Could you have a look at the following patch and see, wether that would w= ork in general, wrt. coding standars etc. > Obviously it works on my system, but I'm not an experienced elisp program= mer, so I guess there might be room for > improvement. Thank you. > + (require 'inf-haskell) > + (add-hook 'inferior-haskell-hook > + (lambda () > + (setq-local comint-prompt-regexp > + (concat haskell-prompt-regexp "\\|^=CE=BB?> ")= ))) Doesn't this kind of configuration ultimately belongs to the user? Org is not supposed to mess with `haskell-prompt-regexp' in the current buffer, IMO. > (let* ((session (cdr (assq :session params))) > (result-type (cdr (assq :result-type params))) > (full-body (org-babel-expand-body:generic > body params > (org-babel-variable-assignments:haskell params))) > (session (org-babel-haskell-initiate-session session params)) > + (comint-preoutput-filter-functions > + (cons 'ansi-color-filter-apply comint-preoutput-filter-functions= )) Ditto. Regards, --=20 Nicolas Goaziou