emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* ob-clojure: ':results pp' parses the output as a string value
@ 2014-04-13 19:29 Phill Wolf
  2014-04-14 10:35 ` Oleh
  0 siblings, 1 reply; 3+ messages in thread
From: Phill Wolf @ 2014-04-13 19:29 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1433 bytes --]

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.

[-- Attachment #2: Type: text/html, Size: 1844 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-04-15  2:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-13 19:29 ob-clojure: ':results pp' parses the output as a string value Phill Wolf
2014-04-14 10:35 ` Oleh
2014-04-15  2:37   ` Phill Wolf

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).