From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: ob-clojure: presentation of map structures? Date: Sun, 02 Feb 2014 00:06:22 -0700 Message-ID: <878utut2et.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40339) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W9rEx-0000a0-ST for emacs-orgmode@gnu.org; Sun, 02 Feb 2014 02:13:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W9rEs-0004dx-Mi for emacs-orgmode@gnu.org; Sun, 02 Feb 2014 02:13:15 -0500 Received: from mail-pd0-x22d.google.com ([2607:f8b0:400e:c02::22d]:58573) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W9rEs-0004ds-Eg for emacs-orgmode@gnu.org; Sun, 02 Feb 2014 02:13:10 -0500 Received: by mail-pd0-f173.google.com with SMTP id y10so5789248pdj.32 for ; Sat, 01 Feb 2014 23:13:09 -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: Phill Wolf Cc: emacs-orgmode@gnu.org Phill Wolf 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 <> > (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