[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Emacs lisp code export difference between `org-export-region-as-

From: thorne
Subject: Re: [O] Emacs lisp code export difference between `org-export-region-as-html' and `org-export-as-html'
Date: Wed, 26 Sep 2012 01:28:39 -0600

In case anyone might be interested in this, here is what I think is a
minimal example.  As I said, I am fine with it for my purposes, but
since the behaviour seems inconsistent (from my possibly limited
perspective) I thought I ought to at least specify as clearly as
possible what is going on:

First, with emacs -Q, and with a file called ~/tmp/foo.org

It's contents are only this:

#+BEGIN_SRC emacs-lisp :exports results :results html

Now, slightly reformatted for clarity, M-x ielm --

*** Welcome to IELM ***  Type (describe-mode) for help.
ELISP> (defun render-with-find-file (file)
                  (let ((buffer (set-buffer (find-file file))))
                    (setq rtn (org-export-as-html nil nil nil 'string t))
                    (kill-buffer buffer)

==> render-with-find-file

ELISP> (defun render-with-temp-buffer (file)
                  (insert-file file)
                  (org-mode)   ; doesn't actually seem to have any effect
                  (org-export-as-html nil nil nil 'string t)))

==> render-with-temp-buffer

ELISP> (render-with-find-file "~/tmp/foo.org")

==> #("<>\n\n" 0 2
         (org-native-text t original-indentation 0 org-protected t
fontified nil)
         2 3
         (fontified nil)
         3 4
         (fontified nil))

ELISP> (render-with-temp-buffer "~/tmp/foo.org")

==> #("<pre class=\"example\">\n&lt;&gt;\n</pre>\n\n\n" 0 40
        (fontified nil))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]