forked from mirrors/org-mode
Merge branch 'master' of git+ssh://repo.or.cz/srv/git/org-mode
This commit is contained in:
commit
7400f2e9e8
|
@ -80,7 +80,7 @@ then run `org-babel-pop-to-session'."
|
|||
(add-hook 'org-metadown-hook 'org-babel-pop-to-session-maybe)
|
||||
|
||||
(defvar org-babel-default-header-args
|
||||
'((:session . "none") (:results . "replace") (:exports . "code") (:nocache))
|
||||
'((:session . "none") (:results . "replace") (:exports . "code") (:nocache) (:noweb . "no"))
|
||||
"Default arguments to use when evaluating a source block.")
|
||||
|
||||
(defvar org-babel-default-inline-header-args
|
||||
|
@ -198,7 +198,8 @@ block."
|
|||
(new-hash (unless (assoc :nocache params) (org-babel-sha1-hash info)))
|
||||
(old-hash (org-babel-result-hash info))
|
||||
(body (setf (second info)
|
||||
(if (assoc :noweb params)
|
||||
(if (and (cdr (assoc :noweb params))
|
||||
(string= "yes" (cdr (assoc :noweb params))))
|
||||
(org-babel-expand-noweb-references info) (second info))))
|
||||
(result-params (split-string (or (cdr (assoc :results params)) "")))
|
||||
(result-type (cond ((member "output" result-params) 'output)
|
||||
|
@ -739,7 +740,7 @@ code ---- the results are extracted in the syntax of the source
|
|||
(if (and (listp (car result))
|
||||
(listp (cdr (car result))))
|
||||
result (list result))
|
||||
'(:fmt (lambda (cell) (format "%S" cell)))) "\n"))
|
||||
'(:fmt (lambda (cell) (format "%s" cell)))) "\n"))
|
||||
(forward-line -1) (org-cycle))
|
||||
((member "file" result-params)
|
||||
(insert result))
|
||||
|
@ -830,7 +831,7 @@ parameters when merging lists."
|
|||
("output" "value")))
|
||||
(exports-exclusive-groups
|
||||
'(("code" "results" "both" "none")))
|
||||
params results exports tangle cache vars var ref)
|
||||
params results exports tangle noweb cache vars var ref)
|
||||
(flet ((e-merge (exclusive-groups &rest result-params)
|
||||
;; maintain exclusivity of mutually exclusive parameters
|
||||
(let (output)
|
||||
|
@ -870,7 +871,10 @@ parameters when merging lists."
|
|||
exports (split-string (cdr pair)))))
|
||||
(:tangle
|
||||
(setq tangle (e-merge '(("yes" "no"))
|
||||
tangle (split-string (cdr pair)))))
|
||||
tangle (split-string (or (cdr pair) "")))))
|
||||
(:noweb
|
||||
(setq noweb (e-merge '(("yes" "no"))
|
||||
noweb (split-string (or (cdr pair) "")))))
|
||||
(:cache (setq cache t)) (:nocache (setq cache nil))
|
||||
(t ;; replace: this covers e.g. :session
|
||||
(setq params (cons pair (assq-delete-all (car pair) params))))))
|
||||
|
@ -879,10 +883,11 @@ parameters when merging lists."
|
|||
(setq vars (mapcar (lambda (pair) (format "%s=%s" (car pair) (cdr pair))) vars))
|
||||
(while vars (setq params (cons (cons :var (pop vars)) params)))
|
||||
(cons (if cache (list :cache) (list :nocache))
|
||||
(cons (cons :noweb (mapconcat 'identity noweb " "))
|
||||
(cons (cons :tangle (mapconcat 'identity tangle " "))
|
||||
(cons (cons :exports (mapconcat 'identity exports " "))
|
||||
(cons (cons :results (mapconcat 'identity results " "))
|
||||
params))))))
|
||||
params)))))))
|
||||
|
||||
(defun org-babel-expand-noweb-references (&optional info parent-buffer)
|
||||
"This function expands Noweb style references in the body of
|
||||
|
|
Loading…
Reference in a new issue