summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Schulte <schulte.eric@gmail.com>2010-10-15 11:20:21 -0600
committerDan Davison <davison@stats.ox.ac.uk>2010-10-21 13:05:59 +0100
commit9c0aae1814b90ac0e101965e1c12e3e73c3105a2 (patch)
tree6f7496d4a72700aa01fb024713b02105f73728dd
parent539c8044575dcbac6bb33f77f12cff73f74f321c (diff)
downloadorg-mode-9c0aae1814b90ac0e101965e1c12e3e73c3105a2.tar.gz
more lightening -- resolving foreign functions between ob-ref and ob
-rw-r--r--lisp/ob-ref.el7
-rw-r--r--lisp/ob.el19
2 files changed, 10 insertions, 16 deletions
diff --git a/lisp/ob-ref.el b/lisp/ob-ref.el
index 2a1a528..512aafd 100644
--- a/lisp/ob-ref.el
+++ b/lisp/ob-ref.el
@@ -57,13 +57,6 @@
(declare-function org-at-table-p "org" (&optional table-type))
(declare-function org-count "org" (CL-ITEM CL-SEQ))
-(defun org-babel-ref-variables (params)
- "Convert PARAMS to variable names and values.
-Takes a parameter alist, and return an alist of variable names,
-and the emacs-lisp representation of the related value."
- (mapcar (lambda (el) (org-babel-ref-parse (cdr el)))
- (org-babel-get-header params :var)))
-
(defvar org-babel-ref-split-regexp
"[ \f\t\n\r\v]*\\(.+?\\)[ \f\t\n\r\v]*=[ \f\t\n\r\v]*\\(.+\\)[ \f\t\n\r\v]*")
diff --git a/lisp/ob.el b/lisp/ob.el
index 9cbfe54..c0666f5 100644
--- a/lisp/ob.el
+++ b/lisp/ob.el
@@ -68,9 +68,7 @@
(declare-function orgtbl-to-orgtbl "org-table" (table params))
(declare-function org-babel-lob-get-info "ob-lob" nil)
(declare-function org-babel-ref-split-args "ob-ref" (arg-string))
-(declare-function org-babel-ref-variables "ob-ref" (params))
-(declare-function org-babel-ref-resolve-reference "ob-ref"
- (ref &optional params))
+(declare-function org-babel-ref-parse "ob-ref" (assignment &optional params))
(declare-function org-babel-lob-execute-maybe "ob-lob" ())
(declare-function org-number-sequence "org-compat" (from &optional to inc))
@@ -142,9 +140,10 @@ remove code block execution from the C-c C-c keybinding."
"Select only header argument of type KEY from a list.
Optional argument OTHERS indicates that only the header that do
not match KEY should be returned."
- (delq nil (mapcar
- (lambda (p) (when ((if others #'not #'identity) (eq (car p) key)) p))
- params)))
+ (delq nil
+ (mapcar
+ (lambda (p) (when (funcall (if others #'not #'identity) (eq (car p) key)) p))
+ params)))
(defun org-babel-get-src-block-info (&optional light)
"Get information on the current source block.
@@ -180,8 +179,10 @@ Returns a list
;; resolve variable references
(when (and info (not light))
(setf (nth 2 info)
- (append (org-babel-ref-variables (nth 2 info))
- (org-babel-get-header (nth 2 info) :var 'other))))
+ (let ((params (nth 2 info)))
+ (append (mapcar (lambda (el) (org-babel-ref-parse (cdr el)))
+ (org-babel-get-header params :var))
+ (org-babel-get-header params :var 'other)))))
info))
(defun org-babel-confirm-evaluate (info)
@@ -891,7 +892,7 @@ may be specified at the top of the current buffer."
Return a list (session vars result-params result-type colnames rownames)."
(let* ((session (cdr (assoc :session params)))
(vars-and-names (org-babel-disassemble-tables
- (org-babel-ref-variables params)
+ (org-babel-get-header params :var)
(cdr (assoc :hlines params))
(cdr (assoc :colnames params))
(cdr (assoc :rownames params))))