mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-08-25 11:02:53 +00:00
Merge branch 'master' of git+ssh://repo.or.cz/srv/git/org-mode
This commit is contained in:
commit
63c49bcaed
|
@ -59,8 +59,14 @@ called by `org-babel-execute-src-block'."
|
||||||
(defun org-babel-prep-session:R (session params)
|
(defun org-babel-prep-session:R (session params)
|
||||||
"Prepare SESSION according to the header arguments specified in PARAMS."
|
"Prepare SESSION according to the header arguments specified in PARAMS."
|
||||||
(let* ((session (org-babel-R-initiate-session session params))
|
(let* ((session (org-babel-R-initiate-session session params))
|
||||||
(vars (org-babel-ref-variables params)))
|
(vars (org-babel-ref-variables params))
|
||||||
(mapc (lambda (pair) (org-babel-R-assign-elisp session (car pair) (cdr pair))) vars)
|
(var-lines
|
||||||
|
(mapcar
|
||||||
|
(lambda (pair) (org-babel-R-assign-elisp (car pair) (cdr pair))) vars)))
|
||||||
|
(org-babel-comint-in-buffer session
|
||||||
|
(mapc (lambda (var)
|
||||||
|
(move-end-of-line 1) (insert var) (comint-send-input nil t)
|
||||||
|
(org-babel-comint-wait-for-output session)) var-lines))
|
||||||
session))
|
session))
|
||||||
|
|
||||||
(defun org-babel-load-session:R (session body params)
|
(defun org-babel-load-session:R (session body params)
|
||||||
|
@ -81,7 +87,7 @@ called by `org-babel-execute-src-block'."
|
||||||
(format "%S" s)))
|
(format "%S" s)))
|
||||||
|
|
||||||
(defun org-babel-R-assign-elisp (name value)
|
(defun org-babel-R-assign-elisp (name value)
|
||||||
"Read the elisp VALUE into a variable named NAME."
|
"Construct R code assigning the elisp VALUE to a variable named NAME."
|
||||||
(if (listp value)
|
(if (listp value)
|
||||||
(let ((transition-file (make-temp-file "org-babel-R-import")))
|
(let ((transition-file (make-temp-file "org-babel-R-import")))
|
||||||
;; ensure VALUE has an orgtbl structure (depth of at least 2)
|
;; ensure VALUE has an orgtbl structure (depth of at least 2)
|
||||||
|
|
|
@ -172,8 +172,10 @@ code blocks by language."
|
||||||
(source-name (intern (or (fifth info)
|
(source-name (intern (or (fifth info)
|
||||||
(format "block-%d" block-counter))))
|
(format "block-%d" block-counter))))
|
||||||
(src-lang (first info))
|
(src-lang (first info))
|
||||||
(body (org-babel-expand-noweb-references info))
|
|
||||||
(params (third info))
|
(params (third info))
|
||||||
|
(body (if (equal "no" (cdr (assoc :noweb params)))
|
||||||
|
(second info)
|
||||||
|
(org-babel-expand-noweb-references info)))
|
||||||
(spec (list link source-name params body (third (cdr (assoc src-lang org-babel-tangle-langs)))))
|
(spec (list link source-name params body (third (cdr (assoc src-lang org-babel-tangle-langs)))))
|
||||||
by-lang)
|
by-lang)
|
||||||
(unless (string= (cdr (assoc :tangle params)) "no") ;; maybe skip
|
(unless (string= (cdr (assoc :tangle params)) "no") ;; maybe skip
|
||||||
|
|
Loading…
Reference in a new issue