summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2017-12-11 15:14:01 +0100
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2017-12-11 15:14:01 +0100
commite8b71b86d21fa384873ef69e9f7495d17d084124 (patch)
treeca296886e017b10a06fe25407a8ecc85cb3a0651
parentc3c1c52eb8db75ed0691b0f5b21f24ee5b1f6077 (diff)
parentb4678774375251927d002811ff1d32426503eef8 (diff)
downloadorg-mode-e8b71b86d21fa384873ef69e9f7495d17d084124.tar.gz
Merge branch 'maint'
-rw-r--r--lisp/ob-haskell.el9
1 files changed, 9 insertions, 0 deletions
diff --git a/lisp/ob-haskell.el b/lisp/ob-haskell.el
index cc78bec..faf976b 100644
--- a/lisp/ob-haskell.el
+++ b/lisp/ob-haskell.el
@@ -59,14 +59,23 @@
(defvar org-babel-haskell-eoe "\"org-babel-haskell-eoe\"")
+(defvar haskell-prompt-regexp)
+
(defun org-babel-execute:haskell (body params)
"Execute a block of Haskell code."
+ (require 'inf-haskell)
+ (add-hook 'inferior-haskell-hook
+ (lambda ()
+ (setq-local comint-prompt-regexp
+ (concat haskell-prompt-regexp "\\|^λ?> "))))
(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))
(raw (org-babel-comint-with-output
(session org-babel-haskell-eoe t full-body)
(insert (org-trim full-body))