[ESS] default pdf viewer for `ess-swv-PDF'

Martin Maechler maechler at stat.math.ethz.ch
Mon May 7 17:06:28 CEST 2007


>>>>> "RoSp" == Rodney Sparapani <rsparapa at mcw.edu>
>>>>>     on Mon, 07 May 2007 09:12:40 -0500 writes:

    RoSp> Martin Maechler wrote:
    >> unfortunately not yet.
    >> I know that you and others have wished for this for a while,
    >> and I had intended to provide it for 5.3.4, but did not get to
    >> that.
    >> 
    >> Let's aim to have it for 5.3.5 ....
    >> I'm trying to set up something which uses new variables
    >> ess-pref-pdfviewer and ess-pref-psviewer. 
    >> 
    >> For pdf it would try to use
    >> 1) ess-pref-pdfviewer  -- if defined (is not by default)
    >> 
    >> 2) getOption("pdfviewer") - if that's a valid file 
    >> 
    >> 3) revert to the current list of proposed defaults.
    >> 
    >> Can I send you updated
    >> ess-cust.el and ess-swv.el  and you try ?
    >> 
    >> Regards, 
    >> Martin

    RoSp> Hi Martin:

    RoSp> It seems like we are constantly re-inventing the wheel since
    RoSp> alot of this stuff was written to view graphs in ESS[SAS] too.

I see, good point.... 
(but why would that reside in ess-sas*.el  when it was
 more generally useful? )

    RoSp> But, I think I found out the way to handle it in a friendly
    RoSp> way for Unix (no idea for Windows):

    RoSp> (require 'mailcap)
    RoSp> (mailcap-mime-info "application/pdf")

    RoSp> The last function returns a string that can be used to launch
    RoSp> the viewer which gets it information from /etc/mailcap and
    RoSp> ~/.mailcap

Well, for me (on Linux, Emacs 21.x) it returns a pretty bad error :

  Debugger entered--Lisp error: (void-function mm-char-int)

    mm-char-int(1)
    ietf-drums-token-to-list("^A-  ^K<escape-sequence-edited-by-Martin>")
    mail-header-parse-content-type("application/pdf")
    mailcap-mime-info("application/pdf")
    eval((mailcap-mime-info "application/pdf"))

But I agree that it would be really nice to make use of  mailcap
in that way.
Though I'd still want our code to make use of R's
       options("pdfviewer")
if that was set, and to allow the user to customize the default
viewer, in a similar way as the current (development!) ESS code
does.

Martin




More information about the ESS-help mailing list