emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Bruno Barbier <perso.bruno.barbier@free.fr>
To: emacs-orgmode@gnu.org
Subject: [PATCH] lisp/ob-haskell.el: Fix org-babel-script-escape expects a string
Date: Tue, 08 Nov 2022 19:37:40 +0100	[thread overview]
Message-ID: <E1osTO5-00054a-0s@lists.gnu.org> (raw)

[-- 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


             reply	other threads:[~2022-11-08 20:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-08 18:37 Bruno Barbier [this message]
2022-11-09  2:35 ` [PATCH] lisp/ob-haskell.el: Fix org-babel-script-escape expects a string Ihor Radchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1osTO5-00054a-0s@lists.gnu.org \
    --to=perso.bruno.barbier@free.fr \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).