emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug: ob-ref.el table indexing broken [7.8.11 (release_7.8.11-515-g5f1fc2.dirty]
       [not found] <1383925928.17590575.1345053091810.JavaMail.root@cds013>
@ 2012-08-15 17:55 ` Ivars Finvers
  2012-08-16  6:14   ` Bastien
  0 siblings, 1 reply; 2+ messages in thread
From: Ivars Finvers @ 2012-08-15 17:55 UTC (permalink / raw)
  To: emacs-orgmode

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)

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

* Re: Bug: ob-ref.el table indexing broken [7.8.11 (release_7.8.11-515-g5f1fc2.dirty]
  2012-08-15 17:55 ` Bug: ob-ref.el table indexing broken [7.8.11 (release_7.8.11-515-g5f1fc2.dirty] Ivars Finvers
@ 2012-08-16  6:14   ` Bastien
  0 siblings, 0 replies; 2+ messages in thread
From: Bastien @ 2012-08-16  6:14 UTC (permalink / raw)
  To: Ivars Finvers; +Cc: emacs-orgmode

Hi Ivars,

Ivars Finvers <ifinvers@shaw.ca> writes:

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

Fixed in git, thanks a lot for reporting this,

-- 
 Bastien

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

end of thread, other threads:[~2012-08-16  6:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1383925928.17590575.1345053091810.JavaMail.root@cds013>
2012-08-15 17:55 ` Bug: ob-ref.el table indexing broken [7.8.11 (release_7.8.11-515-g5f1fc2.dirty] Ivars Finvers
2012-08-16  6:14   ` Bastien

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