summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Schulte <schulte.eric@gmail.com>2010-10-16 13:11:02 -0600
committerDan Davison <davison@stats.ox.ac.uk>2010-10-21 13:06:55 +0100
commitdc9401f95b1e6e58e4ac13fa0846933b74c02f41 (patch)
tree45cc662b3bedab8c341f2fda74768acced0e6dc1
parenta5ac523ec9e7c82e43af611d82d5840206cc1884 (diff)
downloadorg-mode-dc9401f95b1e6e58e4ac13fa0846933b74c02f41.tar.gz
ob-ref: cleanup of variable usage and indentation
* lisp/ob-ref.el (org-babel-ref-resolve): cleanup of variable usage and indentation
-rw-r--r--lisp/ob-ref.el15
1 files changed, 8 insertions, 7 deletions
diff --git a/lisp/ob-ref.el b/lisp/ob-ref.el
index bcb1515..76cf4b9 100644
--- a/lisp/ob-ref.el
+++ b/lisp/ob-ref.el
@@ -109,12 +109,10 @@ return nil."
(when (string-match "^\\(.+?\\)\(\\(.*\\)\)$" ref)
(setq new-refere (match-string 1 ref))
(setq new-referent (match-string 2 ref))
- ;; (message "new-refere=%S, new-referent=%S" new-refere new-referent) ;; debugging
(when (> (length new-refere) 0)
(if (> (length new-referent) 0)
(setq args (mapcar (lambda (ref) (cons :var ref))
(org-babel-ref-split-args new-referent))))
- ;; (message "args=%S" args) ;; debugging
(setq ref new-refere)))
(when (string-match "^\\(.+\\):\\(.+\\)$" ref)
(setq split-file (match-string 1 ref))
@@ -123,7 +121,8 @@ return nil."
(save-restriction
(widen)
(goto-char (point-min))
- (if (let ((result_regexp (concat "^[ \t]*#\\+\\(TBLNAME\\|RESNAME\\|RESULTS\\):[ \t]*"
+ (if (let ((result_regexp (concat "^[ \t]*#\\+\\(TBLNAME\\|RESNAME"
+ "\\|RESULTS\\):[ \t]*"
(regexp-quote ref) "[ \t]*$"))
(regexp (concat org-babel-src-name-regexp
(regexp-quote ref) "\\(\(.*\)\\)?" "[ \t]*$")))
@@ -134,7 +133,8 @@ return nil."
(re-search-forward regexp nil t)
(re-search-backward regexp nil t)
;; check the Library of Babel
- (setq lob-info (cdr (assoc (intern ref) org-babel-library-of-babel)))))
+ (setq lob-info (cdr (assoc (intern ref)
+ org-babel-library-of-babel)))))
(unless lob-info (goto-char (match-beginning 0)))
;; ;; TODO: allow searching for names in other buffers
;; (setq id-loc (org-id-find ref 'marker)
@@ -149,14 +149,15 @@ return nil."
(beginning-of-line)
(if (or (= (point) (point-min)) (= (point) (point-max)))
(error "reference not found"))))
- (setq params (org-babel-process-params '((:results . "silent"))))
(setq result
(case type
('results-line (org-babel-read-result))
('table (org-babel-read-table))
('file (org-babel-read-link))
- ('source-block (org-babel-execute-src-block nil nil params))
- ('lob (org-babel-execute-src-block nil lob-info params))))
+ ('source-block (org-babel-execute-src-block
+ nil nil '((:results . "silent"))))
+ ('lob (org-babel-execute-src-block
+ nil lob-info '((:results . "silent"))))))
(if (symbolp result)
(format "%S" result)
(if (and index (listp result))