[ESS] help("foo") opens web browser but ?foo doesn't

Marc Schwartz marc_schwartz at me.com
Wed Mar 13 17:10:38 CET 2013


OK, I have some more information here.

BTW, I agree with Henrik's logic on the use of HTML help, which is why I have had this setting in my .emacs for years.

CHM based help has not been supported in R since circa version 2.10.0, which was 2009. The current options are HTML, text and PDF. As far as I know from prior communications on the R lists, CHM based help has not been supported by MS for some time either, largely due to security concerns as I recall.

A grep search of the ESS 12.09-2 tarball tree found the following:

grep -Rn -e "chmhelp" *
lisp/ChangeLog:2683:	* ess-site.el (ess-microsoft-p): issue "options(chmhelp = FALSE)"
lisp/ess-r-gui.el:74:  "options(chmhelp=FALSE, htmlhelp=FALSE, help_type='text'); require(tcltk2)"
lisp/ess-site.el:691:        (ess-eval-linewise "options(chmhelp=FALSE, help_type=\"text\")"


I have not followed through the code, but must presume that some of the above is only executed on Windows, since I have seen none of it on OSX and don't recall seeing it on Linux prior to about 4 years ago when I switched.

Is there a reason that this behavior is seemingly Windows specific so as to override either the user specific or site-wide Rprofile settings, which I think is what Vitalie was hinting at in his reply.

Regards,

Marc


On Mar 13, 2013, at 10:13 AM, Henrik Singmann <henrik.singmann at psychologie.uni-freiburg.de> wrote:

> Hi Keith,
> 
> Great, your pointer solved the issue. I just added the following to my .emacs:
> 
> (defun my-R-execute-options ()
>    (ess-command "options(help_type = \"html\")\n"))
> (add-hook 'ess-R-post-run-hook 'my-R-execute-options)
> 
> The relevant post from Vitalie Spinu can be found here: https://stat.ethz.ch/pipermail/ess-help/2012-September/008204.html
> 
> Thanks a lot for everyone who helped and thanks for ESS,
> Henrik
> 
> Am 13.03.2013 15:46, schrieb Ponting, Keith (Keith):
>> It may not be relevant, but some time ago I customized ess-post-run-hook to remove a command rather like the one you are looking at.
>> (My environment is Windows Vista, using Vincent Goulet's excellent bundle.)
>> 
>> HTH,
>> 
>> Keith Ponting
>> Aurix Ltd, Malvern WR14 3SZ  UK
>> Any opinions are those of the author not the company.
>> 
>>> -----Original Message-----
>>> From: ess-help-bounces at r-project.org [mailto:ess-help-bounces at r-
>>> project.org] On Behalf Of Henrik Singmann
>>> Sent: 13 March 2013 14:41
>>> To: Marc Schwartz
>>> Cc: ess-help at stat.math.ethz.ch
>>> Subject: Re: [ESS] help("foo") opens web browser but ?foo doesn't
>>> 
>>> Unfortunately my problem is not related to this issue. My .Rprofile
>>> works (e.g., I can change stringsAsFactors to FALSE in the .Rprofile and
>>> see it in Emacs R).
>>> The problem is solely caused by the following command that is always run
>>> when ESS starts R and I have no idea how to overcome it or how to run
>>> something afterwards (unfortunately .Rprofile seems to be executed
>>> before this line):
>>> 
>>> options(chmhelp=FALSE, help_type="text")
>>> 
>>> Any help on how to change this start up command would be extremely
>>> awesome.
>>> 
>>> btw, thanks for your help so far Marc, really helped me to dig into the
>>> issue (albeit without solution yet).
>>> 
>>> Cheers,
>>> Henrik
>>> 
>>> 
>>> Am 13.03.2013 14:30, schrieb Marc Schwartz:
>>>> On Mar 13, 2013, at 7:57 AM, Henrik Singmann
>>> <henrik.singmann at psychologie.uni-freiburg.de> wrote:
>>>>> Am 13.03.2013 13:13, schrieb Marc Schwartz:
>>>>>> Different incantation in .emacs:
>>>>>> 
>>>>>> (setq inferior-ess-r-help-command "help(\"%s\",
>>>>>> help_type=\"html\")\n")
>>>>>> 
>>>>>> which works in both cases.
>>>>> Thanks, but unfortunately produces the exact same behavior on my
>>> machine: opens browser for help("foo") but Emacs buffer for ?foo.
>>>>> I realized it has to do with the options. When starting the R
>>> terminal from within emacs I get:
>>>>>>> options(chmhelp=FALSE, help_type="text")
>>>>>> options(STERM='iESS', str.dendrogram.last="'",
>>>>>> editor='emacsclient.exe', show.error.locations=TRUE)
>>>>> When running
>>>>> 
>>>>>> options(help_type="html")
>>>>> I get the desired behavior afterwards.
>>>>> 
>>>>> However, I am unable to change my R startup options for the desired
>>> behavior. My Rprofile.site does contain the correct options. If adding a
>>> .Rprofile to my home directory (where my .emacs is located) with this
>>> line it doesn't help either. Googling was also no help.
>>>>> So my question is: How do I customize my ESS startup options. Is
>>> there a variable for that?
>>>>> Thanks,
>>>>> 
>>>>> Henrik
>>>> 
>>>> Not being on Windows, there may be some subtleties here, especially
>>> with Win7. However, a search of the R e-mail list archives comes up with
>>> the following thread:
>>>>    http://tolstoy.newcastle.edu.au/R/e17/help/12/05/12352.html
>>>> 
>>>> which may be helpful in some fashion. There does appear to be some
>>> interaction with the relevant help setting in .Rprofile and the setting
>>> in .emacs relative to the behavior you are observing.
>>>> Creating a .Rprofile in your local user folder should work, as opposed
>>> to creating/editing a .Rprofile.site file, which would be for multiple
>>> users, unless that is your situation.
>>>> If you use a local user specific .Rprofile, be sure to fully exit from
>>> Emacs/ESS/R and then restart, lest the file not be re-loaded upon
>>> ESS/R's startup.
>>>> Regards,
>>>> 
>>>> Marc



More information about the ESS-help mailing list