summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Schulte <schulte.eric@gmail.com>2010-04-24 13:26:34 -0600
committerEric Schulte <schulte.eric@gmail.com>2010-04-24 13:26:34 -0600
commit44bb82d38e75edf856224ae7df3570e2bcc44274 (patch)
tree14fe2c9d49c4a3dafdc5b8d00b63dd1e13b5e51c
parentb8adc74894bcb9b086517aacef262cd8d97bb5c3 (diff)
downloadorg-mode-44bb82d38e75edf856224ae7df3570e2bcc44274.tar.gz
babel: `org-babel-ref-resolve-reference' doesn't break paren nesting when resolving indicies
-rw-r--r--contrib/babel/lisp/org-babel-ref.el6
1 files changed, 4 insertions, 2 deletions
diff --git a/contrib/babel/lisp/org-babel-ref.el b/contrib/babel/lisp/org-babel-ref.el
index 8eb200f..e508e8b 100644
--- a/contrib/babel/lisp/org-babel-ref.el
+++ b/contrib/babel/lisp/org-babel-ref.el
@@ -98,8 +98,10 @@ return nil."
(let ((case-fold-search t)
type args new-refere new-referent result lob-info split-file split-ref
index index-row index-col)
- ;; if ref is indexed grab the indices
- (when (string-match "\\[\\(.+\\)\\]" ref)
+ ;; if ref is indexed grab the indices -- beware nested indicies
+ (when (and (string-match "\\[\\(.+\\)\\]" ref)
+ (let ((str (substring ref 0 (match-beginning 0))))
+ (= (count ?( str) (count ?) str))))
(setq index (match-string 1 ref))
(setq ref (substring ref 0 (match-beginning 0))))
;; assign any arguments to pass to source block