瀏覽代碼

babel: `org-babel-ref-resolve-reference' doesn't break paren nesting when resolving indicies

Eric Schulte 15 年之前
父節點
當前提交
44bb82d38e
共有 1 個文件被更改,包括 4 次插入2 次删除
  1. 4 2
      contrib/babel/lisp/org-babel-ref.el

+ 4 - 2
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