[ESS] ESS and Sweave

Seb spluque at gmail.com
Sat Apr 24 00:48:26 CEST 2010


On Fri, 23 Apr 2010 17:43:45 -0500,
Seb <spluque at gmail.com> wrote:

> Right, forgot that attachments get removed!  Here it is inline:

Argh, inline attachments also seem to get removed.  So once again pasted
in here:


Index: lisp/ess-swv.el
===================================================================
--- lisp/ess-swv.el	(revision 4299)
+++ lisp/ess-swv.el	(working copy)
@@ -165,7 +165,10 @@
 	 (latex-filename (concat namestem ".tex"))
 	 (tex-buf (get-buffer-create " *ESS-tex-output*"))
 	 (pdfviewer (ess-get-pdf-viewer))
-	 (pdf-status))
+	 (pdf-status)
+	 (win-cmdstr (format "start \"%s\" \"%s.pdf\""
+			     pdfviewer namestem ".pdf\""))
+	 (cmdstr (format "%s %s.pdf &" pdfviewer namestem)))
     ;;(shell-command (concat "pdflatex " latex-filename))
     (message "Running pdfLaTeX on '%s' ..." latex-filename)
     (switch-to-buffer tex-buf)
@@ -174,10 +177,10 @@
     (if (not (= 0 pdf-status))
 	(message "** OOPS: error in 'pdflatex' (%d)!" pdf-status)
       ;; else: pdflatex probably ok
-      (shell-command (concat
-	(if (and ess-microsoft-p (w32-shell-dos-semantics))
-	    "start \"" pdfviewer "\" \"" namestem ".pdf\""
-	          "\"" pdfviewer "\" \"" namestem ".pdf\" &"))))
+      (shell-command
+       (concat (if (and ess-microsoft-p (w32-shell-dos-semantics))
+		   win-cmdstr
+		 cmdstr))))
     (switch-to-buffer buf)
     (display-buffer tex-buf)))
 



-- 
Seb



More information about the ESS-help mailing list