[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] ob-clojure: presentation of map structures?
From: |
Eric Schulte |
Subject: |
Re: [O] ob-clojure: presentation of map structures? |
Date: |
Sun, 02 Feb 2014 00:06:22 -0700 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) |
Phill Wolf <address@hidden> writes:
> 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 <<what options?>>
> (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.
Maybe try ":results pp org".
--
Eric Schulte
https://cs.unm.edu/~eschulte
PGP: 0x614CA05D