From mboxrd@z Thu Jan 1 00:00:00 1970 From: Phill Wolf Subject: ob-clojure: ':results pp' parses the output as a string value Date: Sun, 13 Apr 2014 15:29:15 -0400 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11c0f62c1b7e5504f6f195d3 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56635) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WZQ5k-0000YT-Ct for emacs-orgmode@gnu.org; Sun, 13 Apr 2014 15:29:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WZQ5d-0003ME-1h for emacs-orgmode@gnu.org; Sun, 13 Apr 2014 15:29:24 -0400 Received: from mail-qg0-x22b.google.com ([2607:f8b0:400d:c04::22b]:63935) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WZQ5c-0003KT-Rj for emacs-orgmode@gnu.org; Sun, 13 Apr 2014 15:29:16 -0400 Received: by mail-qg0-f43.google.com with SMTP id f51so7531393qge.30 for ; Sun, 13 Apr 2014 12:29:16 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --001a11c0f62c1b7e5504f6f195d3 Content-Type: text/plain; charset=UTF-8 I am getting a strange effect from ":results pp" and ob-clojure. "It\n looks\n like\n this.\n" I built Emacs 24.4.50 from trunk and cloned ob-clojure from git today. clojure-mode is 20140331 from ELPA. cider is 20140411 from ELPA. Two examples follow. 1. uses =:results pp= ("and\n looks\n like\n this\n") 2. uses its own ~pprint~, and =:results output= (and looks correct) I expected example 2's output from both 1 and 2. Here's the data to pretty-print: #+name: columnar-stuff | State | Bird | | New York | Eastern Bluebird | | New Jersey | Eastern Goldfinch | | Connecticut | Penguin | Here is an attempt using =:results pp=: #+begin_src clojure :exports both :results pp :var rows=columnar-stuff rows #+end_src #+RESULTS: : "((\"State\" \"Bird\")\n (\"New York\" \"Eastern Bluebird\")\n (\"New Jersey\" \"Eastern Goldfinch\")\n (\"Connecticut\" \"Penguin\"))\n" Here is a successful (but uglier) src block with an explicit ~pprint~, and =:results output=: #+begin_src clojure :exports both :results output :var rows=columnar-stuff (clojure.pprint/pprint rows) #+end_src #+RESULTS: : (("State" "Bird") : ("New York" "Eastern Bluebird") : ("New Jersey" "Eastern Goldfinch") : ("Connecticut" "Penguin")) I would prefer =:results pp= to produce the same effect as the explicit ~pprint~, because keeping the ~pprint~ out of the published src block makes the presentation clearer. --001a11c0f62c1b7e5504f6f195d3 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I am getting a strange effect from ":results pp"= and ob-clojure.=C2=A0 "It\n looks\n like\n this.\n"=C2=A0 I buil= t Emacs 24.4.50 from trunk and cloned ob-clojure from git today. clojure-mo= de is 20140331 from ELPA.=C2=A0 cider is 20140411 from ELPA.

Two examples follow.

=C2=A01. uses =3D:results pp=3D ("and\= n looks\n like\n this\n")
=C2=A02. uses its own ~pprint~, and =3D:r= esults output=3D (and looks correct)

I expected example 2's outp= ut from both 1 and 2.

Here's the data to pretty-print:

#+name: columnar-stuff
|= State=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | Bird=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |
| New York=C2= =A0=C2=A0=C2=A0 | Eastern Bluebird=C2=A0 |
| New Jersey=C2=A0 | Eastern = Goldfinch |
| Connecticut | Penguin=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 |

Here is an attempt using =3D:results pp=3D:

#+begin_src clojure = :exports both :results pp :var rows=3Dcolumnar-stuff
rows
#+end_src
#+RESULTS:
: "((\"State\" \"Bird\")\n (\&= quot;New York\" \"Eastern Bluebird\")\n (\"New Jersey\&= quot; \"Eastern Goldfinch\")\n (\"Connecticut\" \"= Penguin\"))\n"

Here is a successful (but uglier) src block with an explicit ~pprint~,<= br>and =3D:results output=3D:

#+begin_src clojure :exports both :res= ults output :var rows=3Dcolumnar-stuff
(clojure.pprint/pprint rows)
#= +end_src

#+RESULTS:
: (("State" "Bird")
:=C2=A0 ("= ;New York" "Eastern Bluebird")
:=C2=A0 ("New Jersey&= quot; "Eastern Goldfinch")
:=C2=A0 ("Connecticut" &q= uot;Penguin"))

I would prefer =3D:results pp=3D to produce the same effect as the expl= icit ~pprint~, because keeping the ~pprint~ out of the published src block = makes the presentation clearer.

--001a11c0f62c1b7e5504f6f195d3--