From mboxrd@z Thu Jan 1 00:00:00 1970 From: Phill Wolf Subject: ob-clojure: presentation of map structures? Date: Sun, 2 Feb 2014 01:42:43 -0500 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11c1707ed8ad3f04f166b68e Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37765) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W9qlR-0005t1-Bk for emacs-orgmode@gnu.org; Sun, 02 Feb 2014 01:42:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W9qlQ-0005Wz-C9 for emacs-orgmode@gnu.org; Sun, 02 Feb 2014 01:42:45 -0500 Received: from mail-qa0-x233.google.com ([2607:f8b0:400d:c00::233]:53263) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W9qlQ-0005Ws-7t for emacs-orgmode@gnu.org; Sun, 02 Feb 2014 01:42:44 -0500 Received: by mail-qa0-f51.google.com with SMTP id f11so8584938qae.10 for ; Sat, 01 Feb 2014 22:42:43 -0800 (PST) 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 --001a11c1707ed8ad3f04f166b68e Content-Type: text/plain; charset=UTF-8 How may I use an Org document to illustrate Clojure src blocks that produce Clojure data structures -- particularly maps -- as pretty-printed text? I think I am using Org "master" in Emacs 24.3. #+BEGIN_SRC clojure :results value <> (zipmap ["Peru" "Paris" "Sankt-Peterburg" "Philadelphia" "Plattsburgh" "Pluto"] (range)) #+END_SRC By the way, Clojure pprint makes the value into the following, which would be very respectable (with the addition of ":" org markup) as a result block in the Org buffer: {"Pluto" 5, "Plattsburgh" 4, "Philadelphia" 3, "Putingrad" 2, "Paris" 1, "Peru" 0} Floundering among the options, I tried :results value pp. It yielded this: : "{\"Pluto\" 5,\n \"Plattsburgh\" 4,\n \"Philadelphia\" 3,\n \"Sankt-Peterburg\" 2,\n \"Paris\" 1,\n \"Peru\" 0}\n" pprint's good intentions are evident, but they collided with a superior force. --001a11c1707ed8ad3f04f166b68e Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
How may I use an Org document to illustrate Clojure s= rc blocks that produce Clojure data structures -- particularly maps -- as p= retty-printed text?=C2=A0 I think I am using Org "master" in Emac= s 24.3.

#+BEGIN_SRC clojure :results value <<what options?>>
(zi= pmap
=C2=A0 ["Peru" "Paris" "Sankt-Peterburg&q= uot; "Philadelphia" "Plattsburgh" "Pluto"] =C2=A0 (range))
#+END_SRC

By the way, Clojure pprint m= akes the value into the following, which would be very respectable (with th= e addition of ":" org markup) as a result block in the Org buffer= :

{"Pluto" 5,
=C2=A0"Plattsburgh" 4,
=C2=A0&quo= t;Philadelphia" 3,
=C2=A0"Putingrad" 2,
=C2=A0"Pa= ris" 1,
=C2=A0"Peru" 0}

Floundering amo= ng the options, I tried :results value pp.=C2=A0 It yielded this:

: "{\"Pluto\" 5,\n \"Plattsburgh\" 4,\n \"= ;Philadelphia\" 3,\n \"Sankt-Peterburg\" 2,\n \"Paris\&= quot; 1,\n \"Peru\" 0}\n"

pprint's goo= d intentions are evident, but they collided with a superior force.
--001a11c1707ed8ad3f04f166b68e--