From 298b9ecc2a34d13a360a30eaf2df875747efe9b4 Mon Sep 17 00:00:00 2001 From: blais Date: Thu, 29 Mar 2007 02:24:10 +0000 Subject: emacs support: added S5 preview (submitted to me by Jeff Rush) git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@5039 929543f6-e4f2-0310-98a6-ba3bd3dd1d04 --- tools/editors/emacs/rst.el | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'tools') diff --git a/tools/editors/emacs/rst.el b/tools/editors/emacs/rst.el index e702420a9..69ed23a9a 100644 --- a/tools/editors/emacs/rst.el +++ b/tools/editors/emacs/rst.el @@ -256,6 +256,7 @@ ("C" . rst-compile-alt-toolset) ("x" . rst-compile-pseudo-region) ("q" . rst-compile-pdf-preview) + ("Q" . rst-compile-slides-preview) )) (define-key rst-prefix-map (car m) (cdr m))) @@ -3315,6 +3316,20 @@ of the entire buffer, if the region is not selected." ;; output. )) +(defvar rst-slides-program "firefox" + "Program used to preview S5 slides.") + +(defun rst-compile-slides-preview () + "Convert the document to an S5 slide presentation and launch a preview program." + (interactive) + (let* ((tmp-filename "/tmp/slides.html") + (command (format "rst2s5.py %s %s && %s %s" + buffer-file-name tmp-filename + rst-slides-program tmp-filename))) + (start-process-shell-command "rst-slides-preview" nil command) + ;; Note: you could also use (compile command) to view the compilation + ;; output. + )) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -- cgit v1.2.1