[ESS] patch to ess-swv.el
Leo
sdl.web at gmail.com
Sat Nov 25 23:02:09 CET 2006
On Saturday, 25 Nov 2006, Martin Maechler wrote:
>>>>>> "Leo" == sdl web <sdl.web at gmail.com>
>>>>>> on Fri, 24 Nov 2006 21:39:14 +0000 writes:
>
> Leo> Dear all,
>
> Leo> The following patch will enable ess-swv to look for a
> Leo> usable PS viewer and PDF viewer.
>
> Thank you,
> that indeed looks very sensible.
>
> By which criteria did you chose the order of the programs that
> are tried?
> I'd like to add a comment there mentioning your rationale.
>
I put the traditional program first, a typical one in gnome and one in
KDE and finally some popular propietary ones.
> Regards, and thanks again,
> Martin
>
>>> --- ess-swv.el.orig 2006-11-24 21:28:24.000000000 +0000
>>> +++ ess-swv.el 2006-11-24 21:27:27.000000000 +0000
>>> @@ -143,21 +143,30 @@
>>>
>>> (defun ess-makePS ()
>>> "Create a postscript file from a dvi file (name based on the current
>>> -Sweave file buffer name) and display it with gv."
>>> +Sweave file buffer name) and display it."
>>> (interactive)
>>> (let* ((namestem (substring (buffer-name) 0 (search ".Rnw" (buffer-name))))
>>> - (dvi-filename (concat namestem ".dvi")))
>>> + (dvi-filename (concat namestem ".dvi"))
>>> + (psviewer (file-name-nondirectory
>>> + (or (executable-find "gv")
>>> + (executable-find "evince")
>>> + (executable-find "kghostview")))))
>>> (shell-command (concat "dvips -o temp.ps " dvi-filename))
>>> - (shell-command "gv temp.ps & ")))
>>> + (shell-command (concat psviewer " temp.ps & "))))
>>>
>>>
>>> (defun ess-makePDF ()
>>> - "Create a PDF file and display it with acroread."
>>> + "Create a PDF file and display it."
>>> (interactive)
>>> (let* ((namestem (substring (buffer-name) 0 (search ".Rnw" (buffer-name))))
>>> - (tex-filename (concat namestem ".tex")))
>>> + (tex-filename (concat namestem ".tex"))
>>> + (pdfviewer (file-name-nondirectory
>>> + (or (executable-find "evince")
>>> + (executable-find "kpdf")
>>> + (executable-find "xpdf")
>>> + (executable-find "acroread")))))
>>> (shell-command (concat "pdflatex " tex-filename))
>>> - (shell-command (concat "acroread " namestem ".pdf &"))))
>>> + (shell-command (concat pdfviewer " " namestem ".pdf &"))))
>>>
>>> (defun ess-insert-Sexpr ()
>>> "Insert Sexpr{} into the buffer at point."
>>>
>>> --
>>> Leo
--
Leo
More information about the ESS-help
mailing list