[R] help.start in R-1.7.0 with Netscape 7.0.

Rolf Turner rolf at math.unb.ca
Mon Apr 21 23:07:53 CEST 2003

No avuncular advice has been forthcoming from the list about
my problem with getting html-help, but I've been fiddling around
with it myself and have had a certain amount of insight.  (???)

The source of the problem seems to be the way that the variable
isLocal is defined in browseURL():

	isLocal <- length(grep("^(localhost|):",
                          Sys.getenv("DISPLAY"))) > 0

This seems to make isLocal FALSE in any context in which I work.

For instance, I am currently sitting at an NCD Xwindows terminal,
logged into host ``erdos''.  If I execute

	> Sys.getenv("DISPLAY")

I get

the string of digits being the IP address of the terminal.  Not
a "^(localhost|):" in sight.

I thought to rectify this --- in a kludgy and perhaps dangerous
way --- by creating for myself a local version of browseURL()
in which isLocal is always TRUE.  But a funny thing happened:

I ***still*** got the annoying phenomenon of Netscape's trying
to open a new browser window (and wanting a new ``profile'')
every time I asked for help on another function.

To investigate a bit, I created a local version of help() in
which I could stick some browser() calls to find out the values
of certain variables.  Blow me down, but didn't things now
work just fine!  Took out the browser() calls; things still
worked.  Removed the local help() --- back to not working.

Even more mysterious to me is the fact that if I just put in
a local help(), by doing

	> help <- help

then things don't work.  But (ah-ha!) the way I created my local copy
of help() was to make a local ascii file of the code of help() (with
a ``help <- '' added at the beginning) and then source this file.
When this procedure is followed, things ***do*** work!

This applies even though

	> all.equal(help,get("help",pos=grep("base",search()))

yields TRUE, so that nothing has actually changed in my local copy.

So help() doesn't find the local copy of browseURL() unless there is
also a local copy of help() --- and that local copy needs to have
been created by sourcing a text file!!!  This doesn't make any sense
to me.  It verges on the mystical.  What on earth is going on?

More to the point is there any way that I can persuade help()
that ``isLocal'' should be taken to be TRUE?

I don't follow the rationale of ``isLocal'' anyhow.  If I'm sitting
at machine melvin, but am typing away into a window that is connected
to host clyde, and I start R in that window, then help.start() will
invoke the Netscape that lives on clyde.  (Steps must of course have
been taken to permit clyde to open a Netscape window on melvin's
display, but that's all done in the normal course of events.)  Hence
the Netscape that gets fired up will look for the *.html help files
on clyde and everything will work just as if I were sitting at
clyde's console.  So why would ``isLocal'' ***ever*** need to be


					Rolf Turner

More information about the R-help mailing list