[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: Bastien
Subject: Re: [O] Emacs lisp code export difference between `org-export-region-as-html' and `org-export-as-html'
Date: Tue, 25 Sep 2012 11:13:06 +0200
User-agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.2.50 (gnu/linux)


thorne <address@hidden> writes:

> On Mon, Sep 24, 2012 at 3:53 PM, thorne <address@hidden> wrote:
>>      (defun render-one (file)
>>        (with-temp-buffer
>>          (insert-file file)
>>          (org-export-as-html nil nil nil 'string t)))
> Well, I still don't know why it behaves the way I've described, but it
> works the way I want if instead of the above function, I use:
> (defun render-one (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)))
> -- using find-file and messing with the buffer stuff by hand, instead
> of using `with-temp-buffer' and `insert-file', which later strikes me
> as neater, and possibly faster (I am using it in batch to process
> multiple files) but the other way works, so that's fine.  Thanks.

Just out of curiosity, did it work for you the way I suggested?

find-file will load the appropriate mode, hence no need for (org-mode)
in your latest function.  


reply via email to

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