emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Babel Haskell. Print all results when header has :results output
@ 2020-04-28 16:22 Roland Coeurjoly
  2020-05-04 15:01 ` Nicolas Goaziou
  0 siblings, 1 reply; 3+ messages in thread
From: Roland Coeurjoly @ 2020-04-28 16:22 UTC (permalink / raw)
  To: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 428 bytes --]

Right now, when executing the following source block

#+begin_src haskell :results output
[1..10]
"hello" == "hello"
   #+end_src

I get the following output:

#+RESULTS:
   : True

Whereas (for me) the desired result would be

#+RESULTS:
   : [1,2,3,4,5,6,7,8,9,10]
   : True

I created the attached patch that achieves the desired result.

Please notice that the default behaviour (without :results output) remains
unchanged.

[-- Attachment #1.2: Type: text/html, Size: 684 bytes --]

[-- Attachment #2: 0001-Print-all-results.patch --]
[-- Type: text/x-patch, Size: 879 bytes --]

From 0e7d2ac22a028507eaf5ecc85623b62572ee3de8 Mon Sep 17 00:00:00 2001
From: Roland Coeurjoly <rolandcoeurjoly@gmail.com>
Date: Tue, 28 Apr 2020 18:06:50 +0200
Subject: [PATCH] Print all results

---
 lisp/org/ob-haskell.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org/ob-haskell.el b/lisp/org/ob-haskell.el
index d32a2f7bc0..e5ef0999e0 100644
--- a/lisp/org/ob-haskell.el
+++ b/lisp/org/ob-haskell.el
@@ -145,7 +145,7 @@ org-babel-interpret-Haskell
     (org-babel-reassemble-table
      (let ((result
             (pcase result-type
-              (`output (mapconcat #'identity (reverse (cdr results)) "\n"))
+              (`output (mapconcat #'identity (reverse results) "\n"))
               (`value (car results)))))
        (org-babel-result-cond (cdr (assq :result-params params))
 	 result (org-babel-script-escape result)))
-- 
2.20.1


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

* Re: Babel Haskell. Print all results when header has :results output
  2020-04-28 16:22 Babel Haskell. Print all results when header has :results output Roland Coeurjoly
@ 2020-05-04 15:01 ` Nicolas Goaziou
  2020-05-04 15:44   ` Roland Coeurjoly
  0 siblings, 1 reply; 3+ messages in thread
From: Nicolas Goaziou @ 2020-05-04 15:01 UTC (permalink / raw)
  To: Roland Coeurjoly; +Cc: emacs-orgmode

Hello,

Roland Coeurjoly <rolandcoeurjoly@gmail.com> writes:

> Right now, when executing the following source block
>
> #+begin_src haskell :results output
> [1..10]
> "hello" == "hello"
>    #+end_src
>
> I get the following output:
>
> #+RESULTS:
>    : True
>
> Whereas (for me) the desired result would be
>
> #+RESULTS:
>    : [1,2,3,4,5,6,7,8,9,10]
>    : True
>
> I created the attached patch that achieves the desired result.

I added a proper commit message and applied your patch. Thank you!

Have you signed FSF papers? If you haven't, you need to add TINYCHANGE
cookie in your commit messages (and consider signing them, of course!).

Regards,

-- 
Nicolas Goaziou


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

* Re: Babel Haskell. Print all results when header has :results output
  2020-05-04 15:01 ` Nicolas Goaziou
@ 2020-05-04 15:44   ` Roland Coeurjoly
  0 siblings, 0 replies; 3+ messages in thread
From: Roland Coeurjoly @ 2020-05-04 15:44 UTC (permalink / raw)
  To: Roland Coeurjoly, emacs-orgmode

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

No, I haven't yet. As it is required to firm them for the other patch, I am
willing to firm them but unsure how to proceed.
Please advise.

On Mon, May 4, 2020, 17:01 Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote:

> Hello,
>
> Roland Coeurjoly <rolandcoeurjoly@gmail.com> writes:
>
> > Right now, when executing the following source block
> >
> > #+begin_src haskell :results output
> > [1..10]
> > "hello" == "hello"
> >    #+end_src
> >
> > I get the following output:
> >
> > #+RESULTS:
> >    : True
> >
> > Whereas (for me) the desired result would be
> >
> > #+RESULTS:
> >    : [1,2,3,4,5,6,7,8,9,10]
> >    : True
> >
> > I created the attached patch that achieves the desired result.
>
> I added a proper commit message and applied your patch. Thank you!
>
> Have you signed FSF papers? If you haven't, you need to add TINYCHANGE
> cookie in your commit messages (and consider signing them, of course!).
>
> Regards,
>
> --
> Nicolas Goaziou
>

[-- Attachment #2: Type: text/html, Size: 1557 bytes --]

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

end of thread, other threads:[~2020-05-04 16:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-28 16:22 Babel Haskell. Print all results when header has :results output Roland Coeurjoly
2020-05-04 15:01 ` Nicolas Goaziou
2020-05-04 15:44   ` Roland Coeurjoly

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).