|
@@ -124,12 +124,14 @@ Emacs Lisp representation of the value of the variable."
|
|
|
(save-excursion
|
|
|
(let ((case-fold-search t)
|
|
|
args new-refere new-header-args new-referent split-file split-ref
|
|
|
- index)
|
|
|
+ index contents)
|
|
|
;; if ref is indexed grab the indices -- beware nested indices
|
|
|
- (when (and (string-match "\\[\\([^\\[]+\\)\\]$" ref)
|
|
|
+ (when (and (string-match "\\[\\([^\\[]*\\)\\]$" ref)
|
|
|
(let ((str (substring ref 0 (match-beginning 0))))
|
|
|
(= (cl-count ?\( str) (cl-count ?\) str))))
|
|
|
- (setq index (match-string 1 ref))
|
|
|
+ (if (> (length (match-string 1 ref)) 0)
|
|
|
+ (setq index (match-string 1 ref))
|
|
|
+ (setq contents t))
|
|
|
(setq ref (substring ref 0 (match-beginning 0))))
|
|
|
;; assign any arguments to pass to source block
|
|
|
(when (string-match
|
|
@@ -171,7 +173,7 @@ Emacs Lisp representation of the value of the variable."
|
|
|
(throw :found
|
|
|
(org-babel-execute-src-block
|
|
|
nil (org-babel-lob-get-info e) params)))
|
|
|
- (`src-block
|
|
|
+ ((and `src-block (guard (not contents)))
|
|
|
(throw :found
|
|
|
(org-babel-execute-src-block
|
|
|
nil nil
|