From mboxrd@z Thu Jan 1 00:00:00 1970 From: thorne Subject: Re: 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 Message-ID: References: <87d31a5uu5.fsf@bzg.ath.cx> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from eggs.gnu.org ([208.118.235.92]:46300) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TGm33-0000uz-1o for emacs-orgmode@gnu.org; Wed, 26 Sep 2012 03:28:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TGm2z-0005LM-1y for emacs-orgmode@gnu.org; Wed, 26 Sep 2012 03:28:44 -0400 Received: from mail-lb0-f169.google.com ([209.85.217.169]:50252) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TGm2y-0005LE-R3 for emacs-orgmode@gnu.org; Wed, 26 Sep 2012 03:28:40 -0400 Received: by lbok6 with SMTP id k6so1327080lbo.0 for ; Wed, 26 Sep 2012 00:28:39 -0700 (PDT) In-Reply-To: <87d31a5uu5.fsf@bzg.ath.cx> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org 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 "<>" #+END_SRC Now, slightly reformatted for clarity, M-x ielm -- *** Welcome to IELM *** Type (describe-mode) for help. ELISP> (defun render-with-find-file (file) (save-excursion (let ((buffer (set-buffer (find-file file)))) (setq rtn (org-export-as-html nil nil nil 'string t)) (kill-buffer buffer) rtn))) ==> render-with-find-file ELISP> (defun render-with-temp-buffer (file) (with-temp-buffer (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") ==> #("
\n<>\n
\n\n\n" 0 40 (fontified nil))