emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Help with babel results
@ 2013-03-10  1:32 Michael Gauland
  2013-03-10 21:37 ` Eric Schulte
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Gauland @ 2013-03-10  1:32 UTC (permalink / raw)
  To: emacs-orgmode Org-Mode

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

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


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 901 bytes --]

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

* Re: Help with babel results
  2013-03-10  1:32 Help with babel results Michael Gauland
@ 2013-03-10 21:37 ` Eric Schulte
  2013-03-10 23:48   ` Eric Schulte
  0 siblings, 1 reply; 4+ messages in thread
From: Eric Schulte @ 2013-03-10 21:37 UTC (permalink / raw)
  To: Michael Gauland; +Cc: emacs-orgmode Org-Mode

[-- 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

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

* Re: Help with babel results
  2013-03-10 21:37 ` Eric Schulte
@ 2013-03-10 23:48   ` Eric Schulte
  2013-03-11 17:43     ` Michael Gauland
  0 siblings, 1 reply; 4+ messages in thread
From: Eric Schulte @ 2013-03-10 23:48 UTC (permalink / raw)
  To: Michael Gauland; +Cc: emacs-orgmode Org-Mode

I've now committed this patch.
-- 
Eric Schulte
http://cs.unm.edu/~eschulte

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

* Re: Help with babel results
  2013-03-10 23:48   ` Eric Schulte
@ 2013-03-11 17:43     ` Michael Gauland
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Gauland @ 2013-03-11 17:43 UTC (permalink / raw)
  To: Eric Schulte; +Cc: emacs-orgmode Org-Mode

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

On 11/03/13 12:48, Eric Schulte wrote:
> I've now committed this patch.
Thanks--that was fast.

Works for me now.

Kind Regards,
Mike



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 901 bytes --]

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

end of thread, other threads:[~2013-03-11 17:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-10  1:32 Help with babel results Michael Gauland
2013-03-10 21:37 ` Eric Schulte
2013-03-10 23:48   ` Eric Schulte
2013-03-11 17:43     ` Michael Gauland

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