Merge branch 'master' of git://repo.or.cz/org-mode

This commit is contained in:
Dan Davison 2010-04-21 11:56:07 -04:00
commit d9ef2d0f3a
1 changed files with 15 additions and 13 deletions

View File

@ -169,19 +169,21 @@ which case the entire range is returned."
(let ((length (length lis))
(portion (match-string 1 index))
(remainder (substring index (match-end 0))))
(flet ((wrap (num) (if (< num 0) (+ length num) num)))
(mapcar
(lambda (sub-lis) (org-babel-ref-index-list remainder sub-lis))
(if (string-match "\\(\\([-[:digit:]]+\\):\\([-[:digit:]]+\\)\\|\*\\)"
portion)
(mapcar (lambda (n) (nth n lis))
(apply 'number-sequence
(if (match-string 2 portion)
(list
(wrap (string-to-number (match-string 2 portion)))
(wrap (string-to-number (match-string 3 portion))))
(list (wrap 0) (wrap -1)))))
(list (nth (wrap (string-to-number portion)) lis))))))
(flet ((wrap (num) (if (< num 0) (+ length num) num))
(open (lis) (if (and (listp lis) (= (length lis) 1)) (car lis) lis)))
(open
(mapcar
(lambda (sub-lis) (org-babel-ref-index-list remainder sub-lis))
(if (string-match "\\(\\([-[:digit:]]+\\):\\([-[:digit:]]+\\)\\|\*\\)"
portion)
(mapcar (lambda (n) (nth n lis))
(apply 'number-sequence
(if (match-string 2 portion)
(list
(wrap (string-to-number (match-string 2 portion)))
(wrap (string-to-number (match-string 3 portion))))
(list (wrap 0) (wrap -1)))))
(list (nth (wrap (string-to-number portion)) lis)))))))
lis))
(defun org-babel-ref-split-args (arg-string)