emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eric Schulte <schulte.eric@gmail.com>
To: Michael Gauland <mikelygee@no8wireless.co.nz>
Cc: emacs-orgmode Org-Mode <emacs-orgmode@gnu.org>
Subject: Re: Help with babel results
Date: Sun, 10 Mar 2013 15:37:39 -0600	[thread overview]
Message-ID: <87li9vgcm4.fsf@gmail.com> (raw)
In-Reply-To: <513BE29D.20208@no8wireless.co.nz> (Michael Gauland's message of "Sun, 10 Mar 2013 14:32:13 +1300")

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

Michael Gauland <mikelygee@no8wireless.co.nz> writes:

> I'm working with an sqlite database of songs, and I've run into trouble
> with titles that start with a '(' (for example,
> (I Can't Get No) Satisfaction). 'Verbatim' results work:
>
>     #+BEGIN_SRC sqlite :db test-db :results verbatim
>     .mode csv
>     .separator |
>     drop table playlist;
>     create table playlist (title varchar, artist varchar);
>     insert into playlist values("(I Can't Get No) Satisfaction",
> "Rolling Stones");
>     select * from playlist;
>     #+END_SRC
>
>     #+RESULTS:
>     : "(I Can't Get No) Satisfaction"|"Rolling Stones"
>
> But :results table' reports:
>
>     eval: Symbol's function definition is void: I
>
> It looks to me like org is trying to interpret (I Can't Get No) as emacs
> lisp, but I haven't been able to figure out how to prevent that.
>
> Advice would be greatly appreciated.
>
> Kind Regards,
> Mike
>

Hi Mike,

Thanks for reporting this problem.  Your diagnosis is correct, the table
contents were being interpreted as lisp.  I've fixed this issue with the
attached patch.  I'm unable to ping orgmode.org right now, so I can't
commit this fix, but I will commit it as soon as I'm able.

Thanks,


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-don-t-read-sqlite-output-as-lisp.patch --]
[-- Type: text/x-patch, Size: 949 bytes --]

From 2196096cdecde82c9af8695422ae3f6c5fa42ff1 Mon Sep 17 00:00:00 2001
From: Eric Schulte <schulte.eric@gmail.com>
Date: Sun, 10 Mar 2013 15:34:56 -0600
Subject: [PATCH] don't read sqlite output as lisp

Thanks to Michael Gauland for pointing out this bug.

* lisp/ob-sqlite.el (org-babel-sqlite-table-or-scalar): Don't read
  sqlite output as lisp.
---
 lisp/ob-sqlite.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/ob-sqlite.el b/lisp/ob-sqlite.el
index 30bfc73..84d4688 100644
--- a/lisp/ob-sqlite.el
+++ b/lisp/ob-sqlite.el
@@ -143,7 +143,7 @@ This function is called by `org-babel-execute-src-block'."
     (mapcar (lambda (row)
 	      (if (equal 'hline row)
 		  'hline
-		(mapcar #'org-babel-read row))) result)))
+		(mapcar #'org-babel-string-read row))) result)))
 
 (defun org-babel-sqlite-offset-colnames (table headers-p)
   "If HEADERS-P is non-nil then offset the first row as column names."
-- 
1.8.1.5


[-- Attachment #3: Type: text/plain, Size: 46 bytes --]


-- 
Eric Schulte
http://cs.unm.edu/~eschulte

  reply	other threads:[~2013-03-10 21:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-10  1:32 Help with babel results Michael Gauland
2013-03-10 21:37 ` Eric Schulte [this message]
2013-03-10 23:48   ` Eric Schulte
2013-03-11 17:43     ` Michael Gauland

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=87li9vgcm4.fsf@gmail.com \
    --to=schulte.eric@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=mikelygee@no8wireless.co.nz \
    /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).