all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH] lisp/ob-haskell.el: Fix org-babel-script-escape expects a string
@ 2022-11-08 18:37 Bruno Barbier
  2022-11-09  2:35 ` Ihor Radchenko
  0 siblings, 1 reply; 2+ messages in thread
From: Bruno Barbier @ 2022-11-08 18:37 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 228 bytes --]


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.





[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: [PATCH] lisp/ob-haskell.el: Fix org-babel-script-escape expects a string --]
[-- Type: text/x-diff, Size: 1092 bytes --]

From d508dbf18e8edb95543a11774702f2a9bd4116e6 Mon Sep 17 00:00:00 2001
From: Bruno BARBIER <brubar.cs@gmail.com>
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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] lisp/ob-haskell.el: Fix org-babel-script-escape expects a string
  2022-11-08 18:37 [PATCH] lisp/ob-haskell.el: Fix org-babel-script-escape expects a string Bruno Barbier
@ 2022-11-09  2:35 ` Ihor Radchenko
  0 siblings, 0 replies; 2+ messages in thread
From: Ihor Radchenko @ 2022-11-09  2:35 UTC (permalink / raw)
  To: Bruno Barbier; +Cc: emacs-orgmode

Bruno Barbier <perso.bruno.barbier@free.fr> 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 <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-11-09  2:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-08 18:37 [PATCH] lisp/ob-haskell.el: Fix org-babel-script-escape expects a string Bruno Barbier
2022-11-09  2:35 ` Ihor Radchenko

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.