babel: now removing existing results when exporting "code" or "none"

Thanks to Russell Adams for pointing this out

* contrib/babel/lisp/org-babel-exp.el (org-babel-exp-do-export):
  Removing existing results on export.
This commit is contained in:
Eric Schulte 2010-06-07 13:20:22 -07:00
parent 134de59fd7
commit aa794b50b9
1 changed files with 4 additions and 3 deletions

View File

@ -122,10 +122,11 @@ options are taken from `org-babel-default-header-args'."
"Return a string containing the exported content of the current
code block respecting the value of the :exports header argument."
(flet ((silently () (when (cdr (assoc :session (third info)))
(org-babel-exp-results info type 'silent))))
(org-babel-exp-results info type 'silent)))
(clean () (org-babel-remove-result info)))
(case (intern (or (cdr (assoc :exports (third info))) "code"))
('none (silently) "")
('code (silently) (org-babel-exp-code info type))
('none (silently) (clean) "")
('code (silently) (clean) (org-babel-exp-code info type))
('results (org-babel-exp-results info type))
('both (concat (org-babel-exp-code info type)
"\n\n"