Re: [Rd] two help problems in R-2.0.0 for Windows (PR#7269)

2004-10-09 Thread Prof Brian Ripley
On Fri, 8 Oct 2004 [EMAIL PROTECTED] wrote:

> Prof Brian Ripley wrote:
> 
> > On Thu, 7 Oct 2004 [EMAIL PROTECTED] wrote:
> > 
> > 
> >>Well, for htmlhelp, there is another error. The browser (e.g. Mozilla 
> >>1.7.3) tries to open "T:\R\library\stats\html/Normal.html" and has 
> >>problems with different kinds of slashes (/ vs. \).
> > 
> > 
> > I can't reproduce that.  I get forward slashes only. Can you track down 
> > where the \ are coming from?
> 
> 
> Brian,
> 
> you are right, in the object "file", there are only forward slashes.
> Looks like Mozilla (1.7.3) cannot interpret 
> "T:/R/library/stats/html/Normal.html" and it changes the string in its 
> navigation bar to: "T:\R\library\stats\html/Normal.html"
> 
> Specifying "file:///T:/R/library/stats/html/Normal.html" works, but the 
> "file:///" part seems to be required if using forward slashes.
> 
> Note that the fix to use
> chartr("/", "\\", file)
> is also used in help.start(). I guess there was a reason to include it.

One reason was not to confuse human readers, who get a message containing 
the file path.

It seemed strange that Mozilla 1.7.3 fails whereas Firefox succeeds (and 
even IE6 succeeds).  So I installed Mozilla to find out, and it does work 
for me (Windows XP SP2).  So it's something to do with your system vs 
mine, not different browsers.

I think I need to do some more extensive tests to decide if the right fix 
is to use a filespec with \ or a file:// URL.  One problem about the 
latter is that some browser used to require : replaced by | -- I think it 
was Netscape4 but I don't know if it is relevant.


> >>  options(chmhelp=FALSE, htmlhelp=TRUE)
> >>  ?dnorm  # does not work!
> >>
> >>
> >>This can be fixed by changing line 4 in
> >>.../src/library/utils/R/windows/help.R
> >>as follows:
> >>
> >>-browseURL(file)
> >>+browseURL(chartr("/", "\\", file))
> >>
> >>
> >>
> >>
> >>AArgh, I've never used non-text help pages in the developer releases 
> >>... and obviously nobody else ...
> > 
> > 
> > Well, I have and Firefox works properly, for example.  I've not used
> > Mozilla recently as Firefox seems rather better.  I also checked, and IE6
> > works too.  Do you have a browser set (options(browser=)), or are you
> > relying on file associations?
> 
> The latter.
> 
> > Since this is to be a file:// URL, I believe forward slashes are correct, 
> > but we are at the mercy of Windows browser providers.
> 
> See above. The line
>  browseURL(paste("file://", file, sep="/"))
> works for me.
> 
> Uwe
> 
> 
> > Brian
> >
> 
> __
> [EMAIL PROTECTED] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
> 
> 

-- 
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] two help problems in R-2.0.0 for Windows (PR#7269)

2004-10-08 Thread ligges
Prof Brian Ripley wrote:

> On Thu, 7 Oct 2004 [EMAIL PROTECTED] wrote:
> 
> 
>>Well, for htmlhelp, there is another error. The browser (e.g. Mozilla 
>>1.7.3) tries to open "T:\R\library\stats\html/Normal.html" and has 
>>problems with different kinds of slashes (/ vs. \).
> 
> 
> I can't reproduce that.  I get forward slashes only. Can you track down 
> where the \ are coming from?


Brian,

you are right, in the object "file", there are only forward slashes.
Looks like Mozilla (1.7.3) cannot interpret 
"T:/R/library/stats/html/Normal.html" and it changes the string in its 
navigation bar to: "T:\R\library\stats\html/Normal.html"

Specifying "file:///T:/R/library/stats/html/Normal.html" works, but the 
"file:///" part seems to be required if using forward slashes.

Note that the fix to use
chartr("/", "\\", file)
is also used in help.start(). I guess there was a reason to include it.


>>  options(chmhelp=FALSE, htmlhelp=TRUE)
>>  ?dnorm  # does not work!
>>
>>
>>This can be fixed by changing line 4 in
>>.../src/library/utils/R/windows/help.R
>>as follows:
>>
>>-browseURL(file)
>>+browseURL(chartr("/", "\\", file))
>>
>>
>>
>>
>>AArgh, I've never used non-text help pages in the developer releases 
>>... and obviously nobody else ...
> 
> 
> Well, I have and Firefox works properly, for example.  I've not used
> Mozilla recently as Firefox seems rather better.  I also checked, and IE6
> works too.  Do you have a browser set (options(browser=)), or are you
> relying on file associations?

The latter.

> Since this is to be a file:// URL, I believe forward slashes are correct, 
> but we are at the mercy of Windows browser providers.

See above. The line
 browseURL(paste("file://", file, sep="/"))
works for me.

Uwe


> Brian
>

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] two help problems in R-2.0.0 for Windows (PR#7269)

2004-10-07 Thread Prof Brian Ripley
On Thu, 7 Oct 2004 [EMAIL PROTECTED] wrote:

> Well, for htmlhelp, there is another error. The browser (e.g. Mozilla 
> 1.7.3) tries to open "T:\R\library\stats\html/Normal.html" and has 
> problems with different kinds of slashes (/ vs. \).

I can't reproduce that.  I get forward slashes only. Can you track down 
where the \ are coming from?

>   options(chmhelp=FALSE, htmlhelp=TRUE)
>   ?dnorm  # does not work!
> 
> 
> This can be fixed by changing line 4 in
> .../src/library/utils/R/windows/help.R
> as follows:
> 
> -browseURL(file)
> +browseURL(chartr("/", "\\", file))
> 
> 
> 
> 
> AArgh, I've never used non-text help pages in the developer releases 
> ... and obviously nobody else ...

Well, I have and Firefox works properly, for example.  I've not used
Mozilla recently as Firefox seems rather better.  I also checked, and IE6
works too.  Do you have a browser set (options(browser=)), or are you
relying on file associations?

Since this is to be a file:// URL, I believe forward slashes are correct, 
but we are at the mercy of Windows browser providers.

Brian

-- 
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] two help problems in R-2.0.0 for Windows (PR#7269)

2004-10-07 Thread ligges
R-2.0.0, WinNT / WinXP:

  options(chmhelp=TRUE)
  ?dnorm  # does not work!
  ?Normal # works!

Looks like calling compiled html help does not work for aliases, but 
only for the title of help pages...

And a quick fix without changing the design is to change lines
136-137 in .../src/library/utils/R/help.R as follows:

-err <- .C("Rchtml", hlpfile, topic,
-err = integer(1), PACKAGE = "")$err

+err <- .C("Rchtml", hlpfile, rev(strsplit(file, "/")[[1]])[1],
+err = integer(1), PACKAGE = "")$err

but I think it is a problem by design and the name of the help pages 
should be returned by help() as well (not only implicitly).





Well, for htmlhelp, there is another error. The browser (e.g. Mozilla 
1.7.3) tries to open "T:\R\library\stats\html/Normal.html" and has 
problems with different kinds of slashes (/ vs. \).

  options(chmhelp=FALSE, htmlhelp=TRUE)
  ?dnorm  # does not work!


This can be fixed by changing line 4 in
.../src/library/utils/R/windows/help.R
as follows:

-browseURL(file)
+browseURL(chartr("/", "\\", file))




AArgh, I've never used non-text help pages in the developer releases 
... and obviously nobody else ...

Uwe Ligges

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel