From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: Help with babel results Date: Sun, 10 Mar 2013 15:37:39 -0600 Message-ID: <87li9vgcm4.fsf@gmail.com> References: <513BE29D.20208@no8wireless.co.nz> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([208.118.235.92]:40232) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UEnwB-0005f5-T4 for emacs-orgmode@gnu.org; Sun, 10 Mar 2013 17:37:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UEnw7-0003uZ-U0 for emacs-orgmode@gnu.org; Sun, 10 Mar 2013 17:37:47 -0400 Received: from mail-pb0-f47.google.com ([209.85.160.47]:34803) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UEnw7-0003uK-JP for emacs-orgmode@gnu.org; Sun, 10 Mar 2013 17:37:43 -0400 Received: by mail-pb0-f47.google.com with SMTP id rp2so3024747pbb.20 for ; Sun, 10 Mar 2013 14:37:42 -0700 (PDT) In-Reply-To: <513BE29D.20208@no8wireless.co.nz> (Michael Gauland's message of "Sun, 10 Mar 2013 14:32:13 +1300") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Michael Gauland Cc: emacs-orgmode Org-Mode --=-=-= Content-Type: text/plain Michael Gauland 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, --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-don-t-read-sqlite-output-as-lisp.patch >From 2196096cdecde82c9af8695422ae3f6c5fa42ff1 Mon Sep 17 00:00:00 2001 From: Eric Schulte 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 --=-=-= Content-Type: text/plain -- Eric Schulte http://cs.unm.edu/~eschulte --=-=-=--