From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Kelling Subject: Re: [PATCH] Fix error prone babel table output format detection Date: Sun, 04 May 2014 12:42:50 -0700 Message-ID: <87k3a1w7fc.fsf@treetowl.lan> References: <20140501065231.5AE63181A42@treetowl.lan> <8761lqrn5p.fsf@Rainer.invalid> <87eh0dnbot.fsf@treetowl.lan> <87d2fxlv4u.fsf@treetowl.lan> <87eh0dkfno.fsf@treetowl.lan> <87bnvhhlhn.fsf@treetowl.lan> <87bnvda5sx.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45791) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wh48S-0006MS-8c for emacs-orgmode@gnu.org; Sun, 04 May 2014 17:39:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wh48M-0005R9-1N for emacs-orgmode@gnu.org; Sun, 04 May 2014 17:39:48 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:42940) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wh48L-0005R3-Q3 for emacs-orgmode@gnu.org; Sun, 04 May 2014 17:39:41 -0400 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: Eric Schulte Cc: Achim Gratz , emacs-orgmode@gnu.org Eric Schulte writes: > Hi Ian, > > You should use the `org-every' function here. Look at the source of > that function to see code to efficiently perform this sort of check. > > Best, > Brilliant. Thank you. The updated patch below should be good. -- >8 -- Subject: [PATCH] Fix error prone babel table output format detection * lisp/ob-core.el: Test that all elements are in a list are lists or 'hline instead of just the first. org-babel table output uses different formatting for a list of lists, but detects it incorrectly causing an error. An example of a block causing an error is an emacs lisp source block containing just 1 line: '((1) 2) --- lisp/ob-core.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lisp/ob-core.el b/lisp/ob-core.el index 1348f04..4ddafaf 100644 --- a/lisp/ob-core.el +++ b/lisp/ob-core.el @@ -2184,9 +2184,9 @@ code ---- the results are extracted in the syntax of the source ((funcall proper-list-p result) (goto-char beg) (insert (concat (orgtbl-to-orgtbl - (if (or (eq 'hline (car result)) - (and (listp (car result)) - (listp (cdr (car result))))) + (if (org-every + (lambda (el) (or (listp el) (eq el 'hline))) + result) result (list result)) '(:fmt (lambda (cell) (format "%s" cell)))) "\n")) (goto-char beg) (when (org-at-table-p) (org-table-align))) -- 1.7.10.4