From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ivars Finvers Subject: Bug: ob-ref.el table indexing broken [7.8.11 (release_7.8.11-515-g5f1fc2.dirty] Date: Wed, 15 Aug 2012 11:55:20 -0600 (MDT) Message-ID: <2037286474.17591117.1345053320833.JavaMail.root@cds013> References: <1383925928.17590575.1345053091810.JavaMail.root@cds013> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([208.118.235.92]:42532) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T1hog-0005b7-NR for emacs-orgmode@gnu.org; Wed, 15 Aug 2012 13:55:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T1hof-0001Xx-L5 for emacs-orgmode@gnu.org; Wed, 15 Aug 2012 13:55:38 -0400 Received: from idcmail-mo1so.shaw.ca ([24.71.223.10]:25000) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T1hof-0001Xn-Fk for emacs-orgmode@gnu.org; Wed, 15 Aug 2012 13:55:37 -0400 In-Reply-To: <1383925928.17590575.1345053091810.JavaMail.root@cds013> 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: emacs-orgmode@gnu.org Hi, After updating my org-mode setup to 7.8.11 I noticed that row and column indexing no longer worked when accessing table data in a code block call. An example is: #+name: test-data | 10 | 20 | 30 | 40 | | 11 | 21 | 31 | 41 | | 12 | 22 | 32 | 42 | #+begin_src python :results output raw :var data=test-data[,0:1] print data #+end_src #+RESULTS: [[10, 20, 30, 40], [11, 21, 31, 41], [12, 22, 32, 42]] The correct result should be: #+RESULTS: [[10, 20], [11, 21], [12, 22]] I noticed that a change was recently made to the ob-ref.el file to remove org-flet usage. After some work with the elisp debugger I believe the problem occurs due to a mis-aligned closing parenthesis in the org-babel-ref-index-list function. The following patch appears to fix the problem (but I don't fully understand the function, so there may be some unintended consequences): diff --git a/lisp/ob-ref.el b/lisp/ob-ref.el index d223589..05f3ea0 100644 --- a/lisp/ob-ref.el +++ b/lisp/ob-ref.el @@ -240,8 +240,8 @@ to \"0:-1\"." (funcall wrap (string-to-number (match-string 2 portion))) (funcall wrap (string-to-number (match-string 3 portion)))) (list (funcall wrap 0) (funcall wrap -1))))) - (list (nth (funcall wrap (string-to-number portion)) lis))))))) - lis) + (list (nth (funcall wrap (string-to-number portion)) lis)))))) + lis)) (defun org-babel-ref-split-args (arg-string) "Split ARG-STRING into top-level arguments of balanced parenthesis." -- Thanks. Ivars Emacs : GNU Emacs 23.3.1 (x86_64-unknown-linux-gnu, X toolkit, Xaw3d scroll bars) of 2011-10-19 Package: Org-mode version 7.8.11 (release_7.8.11-515-g5f1fc2.dirty)