emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: thorne <ego111@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: Emacs lisp code export difference between `org-export-region-as-html' and `org-export-as-html'
Date: Mon, 24 Sep 2012 15:53:00 -0600	[thread overview]
Message-ID: <CALrBS=MJdC5Xqpt_WiA20qE==rBxeZv84nnabW6coHRHBbmf0A@mail.gmail.com> (raw)
In-Reply-To: <CALrBS=PYPPcPw2oqu6cmtii79MEMr1Nv42M1PzF_DC4VtCgPqw@mail.gmail.com>

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.

  reply	other threads:[~2012-09-24 21:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-24  6:34 Emacs lisp code export difference between `org-export-region-as-html' and `org-export-as-html' thorne
2012-09-24 21:53 ` thorne [this message]
2012-09-25  1:24   ` Bastien
2012-09-25  6:05   ` thorne
2012-09-25  9:13     ` Bastien
2012-09-26  7:28       ` thorne

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CALrBS=MJdC5Xqpt_WiA20qE==rBxeZv84nnabW6coHRHBbmf0A@mail.gmail.com' \
    --to=ego111@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).