I would like to programmatically mimic the org mode sequence
C-c C-e h o to export a buffer to HTML and open the web browser.
- I have a written a shell-command (in my code snippet below, this command is remplaced by the simple
"more"command) that processes the current buffer file (the
- the shell command (here "more") generates an org mode compatible output and stores it in
- my problem: I want to export this
new_bufferinto an html file and open the browser (like the manual
C-c C-e h osequence).
- then I kill the temporary new_buffer
-> I do not know how to do that. For the moment I use
org-html-export-as-html, however this function simply exports the created
new_buffer into a new
*Org HTML Export* buffer.
What I have done so far (with my brittle emacs-lisp knowledge):
(defun generate_html() (interactive) (let ((new_buffer (generate-new-buffer (concat (buffer-file-name) ".org")))) (shell-command (concat "more " (buffer-file-name)) new_buffer) (org-html-export-as-html ) ;; <-- what to do here to mimic C-c C-e h o ? (kill-buffer new_buffer)))