[ESS] help files with R
Stephen Eglen
S.J.Eglen at damtp.cam.ac.uk
Tue Aug 2 16:52:22 CEST 2005
Sundar Dorai-Raj writes:
> Hi,
>
> This one has got me stumped, but I believe it's an ESS issue. Try the
> following:
>
> 1. Start R
> M-x R
> 2. create the following function
> consolidateHelp <- function(package = NULL) { package }
> 3. execute the function
> > consolidateHelp("lm")
> This opens a new frame with the help file for ?lm.
> 4. Now change the name to
> helpConsolidate <- function(package = NULL) { package }
> 5. execute the function
> > consolidateHelp("lm")
> [1] "lm"
>
> The consildateHelp function creates the following two lines in the ESS
> buffer:
>
> (ess-setq-vars-LOCAL): language=S, dialect=R, buf=nil,
> comint..echoes=nil, comint..sender=comint-simple-send
> (ess-help-bogus-buffer-p *help[R](lm)*) |--> nil [searching t]
>
> Any clues?
>
> version info:
> R-2.1.1pat
> Windows XP
> ess 5.2.8
> Xemacs 21.4 (patch 13)
>
> I also tested this on Linux using ess 5.2.4 (haven't upgraded yet) with
> the same problem. Also, this is not an issue in either rterm or rgui.
>
> BTW, for now, I'll just change the name of the function.
I think what you are seeing is a side effect of our efforts to catch
?lm
so that if a user types that at the command line within an *R* buffer,
the help frame is shown.
;;> <PD writes>:
;;> Also, invoking help() from the command line may lead to confusing
;;> output, somewhat worse with R than with S. You're not really supposed
;;> to do that (use C-c C-v to invoke ess-display-help-on-object), but it's
;;> an obvious newcomer's mistake.
;;>
;;> (I wonder: could the elisp-code not quite easily recognize help
;;> calls (at least in the ?xxx form) and do the right thing automagically?)
;;>
;;> As promised, here is a quick hack:
;; ___hack much improved by MM___ , both help(.) and ?... now work
;; FIXME: Note that '??' nicely works in *R*, but
;; 'type ? topic' doesn't use ess-help {but display in *R*}
(defconst inferior-R-1-input-help (format "help *(%s)" ess-help-arg-regexp))
(defconst inferior-R-2-input-help (format "^ *\\? *%s" ess-help-arg-regexp))
(defconst inferior-R-page (format "^ *page *(%s)" ess-help-arg-regexp))
So, maybe the first regexp could be tightened to match help only at a
start boundary (Martin - is that something like \bhelp ?)
Stephen
More information about the ESS-help
mailing list