ob: Allow babel settings to be made in multiple #+babel: lines

* lisp/ob.el (org-babel-params-from-buffer): Process all #+babel:
lines in the buffer
This commit is contained in:
Dan Davison 2011-01-20 14:59:13 +00:00
parent 624141cc68
commit 05ef2ae7cc
1 changed files with 13 additions and 11 deletions

View File

@ -856,18 +856,20 @@ may be specified in the properties of the current outline entry."
(defun org-babel-params-from-buffer ()
"Retrieve per-buffer parameters.
Return an association list of any source block params which
may be specified at the top of the current buffer."
may be specified in the current buffer."
(or org-babel-current-buffer-properties
(setq org-babel-current-buffer-properties
(save-match-data
(save-excursion
(save-restriction
(widen)
(goto-char (point-min))
(when (re-search-forward
(org-make-options-regexp (list "BABEL")) nil t)
(org-babel-parse-header-arguments
(org-match-string-no-properties 2)))))))))
(save-match-data
(save-excursion
(save-restriction
(widen)
(goto-char (point-min))
(while (re-search-forward
(org-make-options-regexp (list "BABEL")) nil t)
(setq org-babel-current-buffer-properties
(org-babel-merge-params
org-babel-current-buffer-properties
(org-babel-parse-header-arguments
(org-match-string-no-properties 2))))))))))
(defvar org-src-preserve-indentation)
(defun org-babel-parse-src-block-match ()