1
0
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-11-23 07:18:53 +00:00

cleanup and fixing bug RE: default header arguments on export

This commit is contained in:
Eric Schulte 2009-09-01 15:30:39 -06:00
parent d45e3d318f
commit 4346aadd6f
3 changed files with 16 additions and 7 deletions

View File

@ -45,7 +45,8 @@
(add-to-list 'org-babel-tangle-langs '("ditaa" "ditaa"))
(defvar org-babel-default-header-args:ditaa '((:results . "file") (:exports . "results"))
(defvar org-babel-default-header-args:ditaa
'((:results . "file") (:exports . "none"))
"Default arguments to use when evaluating a ditaa source block.")
(defun org-babel-execute:ditaa (body params)

View File

@ -50,8 +50,15 @@ none ----- do not display either code or results upon export"
(interactive)
(unless headers (error "org-babel can't process a source block without knowing the source code"))
(message "org-babel-exp processing...")
(let ((lang (car headers))
(params (org-babel-parse-header-arguments (mapconcat #'identity (cdr headers) " "))))
(let* ((lang (car headers))
(lang-headers (intern (concat "org-babel-default-header-args:" lang)))
(params (org-babel-merge-params
org-babel-default-header-args
(org-babel-params-from-properties)
(if (boundp lang-headers) (eval lang-headers) nil)
(org-babel-parse-header-arguments
(mapconcat #'identity (cdr headers) " ")))))
(message "exporting params are %S" params)
(org-babel-exp-do-export lang body params)))
(defun org-babel-exp-inline-src-blocks (start end)

View File

@ -70,7 +70,8 @@ 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"))
(defvar org-babel-default-header-args
'((:session . "none") (:results . "replace") (:exports . "code"))
"Default arguments to use when evaluating a source block.")
(defvar org-babel-default-inline-header-args '((:results . "silent") (:exports . "code"))
@ -115,7 +116,6 @@ then run `org-babel-pop-to-session'."
`org-babel-src-block-regexp' appropriately."
(unless (member interpreter org-babel-interpreters)
(setq org-babel-interpreters (cons interpreter org-babel-interpreters))
;; (add-to-list 'org-babel-session-defaults (cons interpreter (format "org-babel-%s" interpreter)))
(org-babel-set-interpreters 'org-babel-interpreters org-babel-interpreters)))
(defcustom org-babel-interpreters '()
@ -343,7 +343,8 @@ may be specified in the properties of the current outline entry."
(lang-headers (intern (concat "org-babel-default-header-args:" lang)))
(body (org-babel-clean-text-properties (match-string 4))))
(list lang
(with-temp-buffer ;; get src block body removing properties, protective commas, and indentation
;; get src block body removing properties, protective commas, and indentation
(with-temp-buffer
(save-match-data
(insert (org-babel-strip-protective-commas body))
(org-do-remove-indentation)
@ -662,7 +663,7 @@ parameters when merging lists."
("output" "value"))
results (split-string (cdr pair)))))
(:exports
(setq exports (e-merge '(("code" "results" "both"))
(setq exports (e-merge '(("code" "results" "both" "none"))
exports (split-string (cdr pair)))))
(:tangle
(setq tangle (e-merge '(("yes" "no"))