2

I work a lot these-days with org-reveal to create presentations for some of my classes.

Each time to see what I've changed and how it would look, I need to manually export using C-e R R. Is there a way to auto export the current org file to a reveal html file of the same name when I save manually?

If the manual save methods is to difficult, I wouldn't mind automatically exporting every X minutes.

  • Please do not sign off posts with "Best" or "Thanks" or your name/initial. – Dan Aug 27 '16 at 13:47
2

You can adapt this, which does the same for LaTeX. I don't active this globally, but occasionally turn it on for a buffer. It should probably be improved to only operate on the local buffer.

** Export to LaTeX when saving
#+BEGIN_SRC emacs-lisp :results none
(defun kdm/org-save-and-export ()
  (interactive)
  (if (eq major-mode 'org-mode)
    (org-latex-export-to-latex)))
(add-hook 'after-save-hook 'kdm/org-save-and-export nil t)
#+END_SRC
  • that sounds great, but from what i understand that will work on any currently opened org buffer when i save right? can this be adjusted to only work as you said on the current buffer? – zeltak Aug 30 '16 at 14:06
  • I think the options to add-hook make it buffer-local. – mankoff Jan 28 '18 at 9:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.