From: Phill Wolf <phill.wolf@gmail.com>
To: emacs-orgmode@gnu.org
Subject: ob-clojure: ':results pp' parses the output as a string value
Date: Sun, 13 Apr 2014 15:29:15 -0400 [thread overview]
Message-ID: <CAH+qJs+WhQZNxngZZUWKgiXLoU1xYKZcsJW1CU63xEQ6ZkT+Wg@mail.gmail.com> (raw)
[-- 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 --]
next reply other threads:[~2014-04-13 19:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-13 19:29 Phill Wolf [this message]
2014-04-14 10:35 ` ob-clojure: ':results pp' parses the output as a string value Oleh
2014-04-15 2:37 ` Phill Wolf
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=CAH+qJs+WhQZNxngZZUWKgiXLoU1xYKZcsJW1CU63xEQ6ZkT+Wg@mail.gmail.com \
--to=phill.wolf@gmail.com \
--cc=emacs-orgmode@gnu.org \
/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).