Actually I think I have a simpler version of this question now. I have this function:
(defun render-one (file) (with-temp-buffer (insert-file file) (org-export-as-html nil nil nil 'string t))) With the last line being the important bit. If I open a file, foo.org, that has the #+BEING_SRC bit that I want to export, and put this line in the buffer and evaluate it: (org-export-as-html nil nil nil 'string t) then the result I get is correct -- the html that I want is embedded in the resulting string. But if instead I evaluate (render-one "~/foo.org") using the function above which should (I assume) do the same thing, it does not work. Instead, the html code I want is wrapped in <pre> tags and angle brackets changed to html entities. So, it seems that something about running the export function in my code above makes it ignore my :results html setting in the code block. Is this a security thing? Is there a variable that I need to let-bind in my function or something? Thanks for any help.