5

Currently I have set options(help_type="text") and getOption("help_type") returns "text". Not sure why but R still opens a new browser window or tab when I type ?par in the inferior ESS (iESS) buffer. If I explicitly evaluate help(par,help_type="text"), the contents of the help page is printed in the iESS buffer. I thought there was a way to have the contents open in a its own separate Emacs buffer -- was I mistaken?

hatmatrix
  • 42,883
  • 45
  • 137
  • 231
  • 1
    on my emacs, there is a line which says the following: .help.ESS <- help - does this line appear when you start ESS. Also, what system are you running emacs on, and what version of emacs and ESS are you using? also what is the value of inferior-ess-help-command? – richiemorrisroe Aug 23 '11 at 11:16
  • Thanks -- `.help.ESS <- help` does appear, and the value of `inferior-ess-help-command` is `"utils::help(\"%s\", help_type=\"html\")\n"` on Emacs 24 on OS X... – hatmatrix Aug 23 '11 at 13:23
  • 1
    if you customise inferior-ess-help-command (using the customize menu) to "text", then you should get the help files in a new buffer. – richiemorrisroe Aug 23 '11 at 13:27
  • `(setq inferior-ess-help-command "utils::help(\"%s\")\n")` apparently does not help either – hatmatrix Aug 23 '11 at 13:27
  • Thanks -- I had another variable, `inferior-ess-r-help-command` defined in my configuration files and this was being assigned to the global value of my `inferior-ess-help-command` variable. Must have been carried over from an older installation. – hatmatrix Aug 23 '11 at 13:38
  • Problem solved -- set value of `inferior-ess-help-command` to `"utils::help(\"%s\")\n"` -- if you post it as an answer I can mark it and close the question? – hatmatrix Aug 23 '11 at 13:39

2 Answers2

4

If (as we discovered in the comments) you set inferior-ess-help-command to "utils::help(\"%s\")\n", then the problem was resolved.

It appeared to have been caused by another inferior-ess-help-command in the configuration file.

Its always a good idea to start emacs with the -nw options if you experience weird problems like this.

richiemorrisroe
  • 9,307
  • 3
  • 22
  • 20
2

In your .emacs file, include one of these two statements.

The first should open each ?foo request in it's own frame/buffer

;;;;; create a new frame for each help instance
(setq ess-help-own-frame t)

This second version has a single buffer for all help pages you call up

;;;;; If you want all help buffers to go into one frame do
(setq ess-help-own-frame 'one)
Gavin Simpson
  • 170,508
  • 25
  • 396
  • 453
  • Hm, didn't quite do it... now opens new frame with empty help buffer but still opens help file browser... – hatmatrix Aug 23 '11 at 13:23
  • Ah, OK, I see now - you were mixing two questions, or at least that was what I thought. The above only work for text help, so you need to solve that (which @richiemorrisroe seems to have done) - the above might be useful if you want to customise how Emacs/ESS handles the text help. – Gavin Simpson Aug 23 '11 at 13:49
  • Guess I was... the two being how to 1) make iESS use help_type="text" rather than "html" and 2) how to open it in an Emacs buffer. Actually at this moment I like the default behavior of the help file opening in another window, but will keep your solution in mind if I want it to open in a separate frame -- thanks. – hatmatrix Aug 23 '11 at 14:56