emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Help with babel results


From: Eric Schulte
Subject: Re: [O] Help with babel results
Date: Sun, 10 Mar 2013 15:37:39 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux)

Michael Gauland <address@hidden> 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,

>From 2196096cdecde82c9af8695422ae3f6c5fa42ff1 Mon Sep 17 00:00:00 2001
From: Eric Schulte <address@hidden>
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

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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]