On 14/05/2020 5:46 a.m., Gábor Csárdi wrote:
On Thu, May 14, 2020 at 10:27 AM Duncan Murdoch
<murdoch.dun...@gmail.com> wrote:

On 14/05/2020 3:30 a.m., Georgi Boshnakov wrote:
The issue is not with Rstudio per se but that in devtools' development mode  
help() is modified to show the Rd files in the source directory, as one would 
expect, but doesn't load the RdMacros. So, the issue appears when one is 
development mode.

Yes, the error appears to be in the pkgload::load_rd_macros() function
here:
https://github.com/r-lib/pkgload/blob/1b1adc39628671f2ea4256f0bebcdb76e1f89f45/R/dev-help.r#L47.

It doesn't look at the DESCRIPTION file to see if there's an RdMacros entry.

Isn't that what tools::loadPkgRdMacros() does there? I believe so.

I think I've tracked it down correctly this time.

The problem appears to be in RStudio code called by pkgload::print.dev_Topic. That function correctly loads the macros, but has this code:

    if (rstudioapi::hasFun("previewRd")) {
      rstudioapi::callFun("previewRd", x$path)
      return(invisible())
    }

(This is here: https://github.com/r-lib/pkgload/blob/1b1adc39628671f2ea4256f0bebcdb76e1f89f45/R/dev-help.r#L68 .)

This never passes the macros to the preview code built in to RStudio. The function in RStudio is here: https://github.com/rstudio/rstudio/blob/2596a760603e06251cce829f236f57c5eff048c9/src/cpp/r/R/Api.R#L101 . It only accepts one argument, rather than the two that are needed.

Duncan Murdoch

______________________________________________
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel

Reply via email to