From: Eric Schulte <schulte.eric@gmail.com>
To: Phill Wolf <phill.wolf@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: ob-clojure: presentation of map structures?
Date: Sun, 02 Feb 2014 00:06:22 -0700 [thread overview]
Message-ID: <878utut2et.fsf@gmail.com> (raw)
In-Reply-To: CAH+qJsJ17uE6rFXf3=46_bSyYm+1g6YVvDTtJFBQWOZPSTPxDg@mail.gmail.com
Phill Wolf <phill.wolf@gmail.com> 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
next prev parent reply other threads:[~2014-02-02 7:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-02 6:42 ob-clojure: presentation of map structures? Phill Wolf
2014-02-02 7:06 ` Eric Schulte [this message]
2014-02-02 22:26 ` Soapy Smith
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=878utut2et.fsf@gmail.com \
--to=schulte.eric@gmail.com \
--cc=emacs-orgmode@gnu.org \
--cc=phill.wolf@gmail.com \
/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).