Re: [PATCH] lisp/ob-haskell.el: Fix org-babel-script-escape expects a string

2022-11-08 Thread Ihor Radchenko
Bruno Barbier  writes:

> When running, for example, the following haskell block in ghci
>
>#+begin_src haskell
>v=2
>#+end_src
>
> there is no result.
>
> The attached patch avoids calling `org-babel-script-escape' in such a
> case.

Thanks!
Applied onto main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=7f72807aead9c350d85513702deb04722b65a25b

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



[PATCH] lisp/ob-haskell.el: Fix org-babel-script-escape expects a string

2022-11-08 Thread Bruno Barbier

Hi,

When running, for example, the following haskell block in ghci

   #+begin_src haskell
   v=2
   #+end_src

there is no result.

The attached patch avoids calling `org-babel-script-escape' in such a
case.


Bruno.




>From d508dbf18e8edb95543a11774702f2a9bd4116e6 Mon Sep 17 00:00:00 2001
From: Bruno BARBIER 
Date: Tue, 8 Nov 2022 19:19:32 +0100
Subject: [PATCH] lisp/ob-haskell.el: Fix org-babel-script-escape expects a
 string

* lisp/ob-haskell.el (org-babel-interpret-haskell): Don't call
`org-babel-script-escape' when the result is nil.
---
 lisp/ob-haskell.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/ob-haskell.el b/lisp/ob-haskell.el
index 99e590bfb..095286c79 100644
--- a/lisp/ob-haskell.el
+++ b/lisp/ob-haskell.el
@@ -150,7 +150,7 @@ (defun org-babel-interpret-haskell (body params)
   (`output (mapconcat #'identity (reverse results) "\n"))
   (`value (car results)
(org-babel-result-cond (cdr (assq :result-params params))
-	 result (org-babel-script-escape result)))
+	 result (when result (org-babel-script-escape result
  (org-babel-pick-name (cdr (assq :colname-names params))
 			  (cdr (assq :colname-names params)))
  (org-babel-pick-name (cdr (assq :rowname-names params))
-- 
2.37.4