emacs-ess / ESS

Emacs Speaks Statistics: ESS
https://ess.r-project.org/
GNU General Public License v3.0
613 stars 160 forks source link

.ess.eval and .ess.help not working in the latest release ess14.09 #117

Closed ghost closed 9 years ago

ghost commented 9 years ago

I was able to run all the functions with ess-eval-function and see help till I updated ess today. Could you please fix this bug and tell me where to find the older working version in the meantime ?

Thanks Anusha

plantarum commented 9 years ago

I'm getting this too. I just updated to the latest version from github, and C-c c-v provides me with a list of completions, but as soon as I pick one I get the message 'Error: could not find function ".ess.help"'.

I can get .ess.help back with:

source("/path/to/ESS/etc/ESSR/R/.basic.R")

So I suspect somehow ESSR is not getting installed?

Best,

Tyler

mmaechler commented 9 years ago

What about using the officially released version of ESS ? http://ess.r-project.org/downloads/

It is only about 3 weeks old, well tested and definitely has no such problems. @Anushaa : It is your decision to work with an unreleased development version of ESS. If you do so, please do not complain here, but rather provide patches aka pull requests.

This is not for the average user, the released version of ESS is.

plantarum commented 9 years ago

Sorry Martin, I thought reporting bugs in the development version was a helpful thing to do. I did not mean this as a complaint.

gaborcsardi commented 9 years ago

@mmaechler: you can actually disable the issue tracker, and then people will not annoy you with bug reports. It is just one click in "Settings". They will still be able to send pull request.

vspinu commented 9 years ago

, I thought reporting bugs in the development version was a helpful thing to do. I did not mean this as a complaint.

This is an issue tracker (the only one that we have!) and you should complain here of course. The melpa/github version is the same as the officially released version, so you will get the same problems there.

It is not clear, why is this happening. Do you configure your R prompt? Could you please go to the source of ess--R-load-ESSR and instrument it C-u C-M-x. Then run R and step through the function with n. At some point the ".load.R" file should be issued. Something goes wrong with that. Please also post the stuff from *ESS* buffer.

Thanks.

plantarum commented 9 years ago

Ugh. I did all of that (edebug on ess--R-load-ESSR etc.), and then of course everything worked fine - C-c C-v offers me topics, and when I pick one it opens as expected. To check if I'm going crazy, I tried emacs -Q, followed by (require 'ess-site'), and then opened R and checked the help files. That works fine too. So perhaps I am going crazy.

This same issue seems to pop-up on me every once in a while, but given that I cannot reproduce it at the moment, it's probably something weird I've done locally. When I saw anushaa report the same issue I thought maybe there was something more general going on. In anycase, next time it happens I'll check ess--R-load-ESSR and see if I can figure out how I'm breaking it.

Sorry for the noise!

Tyler

ps. for the record, the requested *ESS* buffer:

(S): ess-s-versions-create making M-x defuns for

(R): ess-r-versions-create making M-x defuns for

(ess-setq-vars-LOCAL): language=S, dialect=R, buf=nil, comint..echoes=t, comint..sender=comint-simple-send (ess-mode-1): ess-language=S, ess-dialect=R buf=PCS.sim.tws.r (ess-mode-1.5): alist=((ess-local-customize-alist quote R-customize-alist) (ess-eldoc-function quote ess-R-eldoc-function) (ess-dialect . R) (ess-suffix . R) (ess-ac-sources quote (ac-source-R)) (ess-build-tags-command . rtags('%s', recursive = TRUE, pattern = '.RrSs?$',ofile = '%s')) (ess-traceback-command . local({cat(geterrmessage(), "---------------------------------- ", fill=TRUE);try(traceback(), silent=TRUE)}) ) (ess-call-stack-command . traceback(1) ) (ess-eval-command . .ess.eval("%s", FALSE, FALSE, file="%f") ) (ess-eval-visibly-command . .ess.eval("%s", TRUE, TRUE, 300, file="%f") ) (ess-eval-visibly-noecho-command . .ess.eval("%s", FALSE, TRUE, 300, file="%f") ) (ess-load-command . .ess.source("%s", FALSE, FALSE) ) (ess-load-visibly-command . .ess.source("%s", TRUE, TRUE, 300) ) (ess-load-visibly-noecho-command . .ess.source("%s", FALSE, TRUE, 300) ) (ess-dump-filename-template ess-replace-regexp-in-string S$ ess-suffix ess-dump-filename-template-proto) (ess-help-web-search-command quote ess-R-sos) (ess-mode-syntax-table . R-syntax-table) (ess-mode-editing-alist . R-editing-alist) (ess-change-sp-regexp . ess-R-change-sp-regexp) (ess-help-sec-regex . ess-help-R-sec-regex) (ess-help-sec-keys-alist . ess-help-R-sec-keys-alist) (ess-loop-timeout . ess-S-loop-timeout) (ess-cmd-delay . ess-R-cmd-delay) (ess-function-pattern . ess-R-function-pattern) (ess-object-name-db-file . ess-r-namedb.el) (ess-smart-operators . ess-R-smart-operators) (inferior-ess-program . inferior-R-program-name) (inferior-ess-objects-command . inferior-R-objects-command) (inferior-ess-font-lock-keywords quote inferior-R-font-lock-keywords) (inferior-ess-search-list-command . search() ) (inferior-ess-help-command . inferior-ess-r-help-command) (inferior-ess-help-filetype) (inferior-ess-exit-command . q()) (inferior-ess-exit-prompt . Save workspace image? [y/n/c]: ) (inferior-ess-start-file) (inferior-ess-start-args . ) (ess-error-regexp-alist . ess-R-error-regexp-alist) (ess-describe-object-at-point-commands quote ess-R-describe-object-at-point-commands) (ess-STERM . iESS) (ess-editor . R-editor) (ess-pager . R-pager) (prettify-symbols-alist quote ((<- . 8592) (<<- . 8606) (-> . 8594) (->> . 8608))) (ess-language . S) (inferior-ess-exit-command . q() ) (inferior-ess-language-start eval inferior-S-language-start) (comint-use-prompt-regexp . t) (comint-process-echoes . t) (inferior-ess-primary-prompt . > ) (inferior-ess-secondary-prompt . + ) (comment-start . #) (ess-imenu-generic-expression . ess-imenu-S-generic-expression) (comment-add . 1) (comment-start-skip . #+ _) (comment-use-syntax . t) (comment-column . 40) (ess-no-skip-regexp concat ^ *@| (default-value (quote ess-no-skip-regexp))) (inferior-ess-prompt . inferior-S-prompt) (ess-get-help-topics-function quote ess-get-S-help-topics-function) (ess-getwd-command . getwd() ) (ess-setwd-command . setwd('%s') ) (ess-funargs-command . .essfunargs("%s") ) (fill-nobreak-predicate quote ess-inside-string-p) (normal-auto-fill-function quote ess-do-auto-fill)) (ess-mode-1.6): editing-alist=((paragraph-start concat \s-$| page-delimiter) (paragraph-separate concat \s-_$| page-delimiter) (paragraph-ignore-fill-prefix . t) (require-final-newline . mode-require-final-newline) (indent-line-function quote ess-indent-line) (parse-sexp-ignore-comments . t) (ess-style . ess-default-style) (ess-mode-syntax-table . S-syntax-table) (add-log-current-defun-header-regexp . ^(.+)\s-+<-[
]_function) (ess-font-lock-keywords quote ess-R-font-lock-keywords) (ess-font-lock-defaults ess--extract-default-fl-keywords ess-R-font-lock-keywords) (font-lock-defaults quote (ess-font-lock-defaults nil nil ((46 . w) (95 . w))))) (ess-setq-vars-LOCAL): language=S, dialect=R, buf=nil, comint..echoes=t, comint..sender=comint-simple-send

Finished setting up ESS-mode. ess-request-a-process: {beginning} ... request-a-process: major mode ess-mode; current buff: PCS.sim.tws.r; ess-language: S, ess-dialect: R ..start-process-specific: lang:dialect= S:R, current-buf=PCS.sim.tws.r

(R): ess-dialect=R, buf=PCS.sim.tws.r, start-arg=nil current-prefix-arg=nil (inf-ess 1): lang=S, dialect=R, tmp-dialect=R, buf=PCS.sim.tws.r (inf-ess 1.1): procname=R temp-dialect=R, buf-name=R (inferior-ess) Method #3 start=/home/tws/research/students/danielle_fraser/r/ buf=R (ess-setq-vars-LOCAL): language=S, dialect=R, buf=nil, comint..echoes=t, comint..sender=comint-simple-send (inf-ess 2.1): ess-language=S, ess-dialect=R buf=R (ess-setq-vars-LOCAL): language=S, dialect=R, buf=nil, comint..echoes=t, comint..sender=inferior-ess-input-sender (i-ess 1): buf=R, lang=S, comint..echo=t, comint..sender=inferior-ess-input-sender, (i-ess end): buf=R, lang=S, comint..echo=t, comint..sender=inferior-ess-input-sender, (inferior-ess (post inf-ess): start-args=--no-readline --no-restore , comint-echoes=t Making Process...Buf R, :Proc R, :Prog R :Args= --no-readline --no-restore Start File=nil (inferior-ess: waiting for process to start (before hook) (inferior-ess 3): waiting for process after hook(R): inferior-ess-language-start=options(STERM='iESS', str.dendrogram.last="'", editor='emacsclient', show.error.locations=TRUE) ... request-a-process: buf=PCS.sim.tws.r load-ESSR cmd: local({ source('/usr/local/share/emacs/etc/ess/ESSR/R/.load.R', local=TRUE) #define load.ESSR load.ESSR('/usr/local/share/emacs/etc/ess/ESSR/R')})

(ess-get-help-topics-list R) ..(get-object-list R) ..--> (ess-get-modtime-list) (ess-search-list ... ) after 'search() ', point-max=221 (ess-get-modtime-list): created new alist of length 10 (length alist) : 10 have re-read pos=1: -> length 0 (ess-search-list ... ) after 'search() ', point-max=221 Processing RDS files ... (ess-setq-vars-LOCAL): language=S, dialect=R, buf=nil, comint..echoes=t, comint..sender=comint-simple-send (ess-help 'helpR' start .. |--> nil [searching t]

vspinu commented 9 years ago

Thanks Tyler for taking your time to look into it. When it happens next time could you please post the most recent paragraph of the *ESS* buffer. If there are any ESSR loading errors, there will be a message in that buffer.

These reports are a bit concerning as we indeed have made some changes to ESSR loading.

mmaechler commented 9 years ago

One more thing: There is now M-x R-initiialize-on-start (type M-x R-initi [TAB]) which re initializes the .ess... objects (and reattachaces "ESSR" to R's search()) in such a situation where these features stop working. This is a new feature in ESS 14.09 - because I found we needed it "in case", and I too have been making use of it a few times the last couple of weeks.

ghost commented 9 years ago

The above discussion resolves the issue.

I just want to add that when I got this problem, I did first check if am using an untested version but when I saw Vincent Goulet installation with ESS 14.09, inferred that this was meant for the "average user".
Even the link provided by @mmaechler is for ESS 14.09 which is what was giving error.

Please know that it takes time and effort to post an issue and I dont think many would do it without going through all checks they can think of and internet search for a solution.

Thanks .

mmaechler commented 9 years ago

Indeed, @Anushaa, you are right. I was overreacting. You did mention ESS 14.09 in the subject, but I was under the wrong impression that your problem was only with the development version of ESS. So: "Please apologize!" and "thank you!", and also Tyler (@plantarum) .

plantarum commented 9 years ago

It happened again this morning - tried to open a help window with C-c C-v, and I got a complaint about not finding .ess.help. I immediately switched to the ESS buffer, and copied the last paragraph (below). I then edebuged ess--R-load-ESSR, killed the R interactive buffer, and restarted it. Stepping through the code, I checked the paths as they came up, and everything looked correct, pointed at /usr/local/share/emacs/etc/ess/ESSR/R/, which is where the files were installed.

And then it worked!

So I un-edebugged ess--R-load-ESSR, killed the R buffer, and tried again. It still worked.

Next experiment, I killed my emacs entirely and started over. And it worked the first time, as expected - M-x R, C-c C-v and I get a help window, no complaints. Weird. So I opened ESS and took a look. The last two paragraphs from this buffer are pasted below. The first differences appear to be:

Working: (R): ess-dialect=nil, buf=scratch, start-arg=nil current-prefix-arg=nil (inf-ess 1): lang=nil, dialect=nil, tmp-dialect=R, buf=scratch

Not Working: (R): ess-dialect=R, buf=PCS.sim.r, start-arg=nil current-prefix-arg=nil (inf-ess 1): lang=S, dialect=R, tmp-dialect=R, buf=PCS.sim.r

Aha! Here's a clue - ess-dialect and starting buffer seem to be important. My next round of experiments involved trying to reproduce the error using emacs -Q and running M-x R from scratch or from an R code bufffer, trying to see what happens for different values of ess-dialect.

Sadly, I have been unable to reproduce the problem yet. Perhaps these clues will be helpful to you. Otherwise, I'll send more info when I have it.

Best,

Tyler

Last paragraph from ESS from broken session:

(R): ess-dialect=R, buf=PCS.sim.r, start-arg=nil current-prefix-arg=nil (inf-ess 1): lang=S, dialect=R, tmp-dialect=R, buf=PCS.sim.r (inf-ess 1.1): procname=R temp-dialect=R, buf-name=R (inferior-ess) Method #3 start=/home/tws/research/students/danielle_fraser/r/ buf=R (ess-setq-vars-LOCAL): language=S, dialect=R, buf=nil, comint..echoes=t, comint..sender=comint-simple-send (inf-ess 2.1): ess-language=S, ess-dialect=R buf=R (ess-setq-vars-LOCAL): language=S, dialect=R, buf=nil, comint..echoes=t, comint..sender=inferior-ess-input-sender (i-ess 1): buf=R, lang=S, comint..echo=t, comint..sender=inferior-ess-input-sender, (i-ess end): buf=R, lang=S, comint..echo=t, comint..sender=inferior-ess-input-sender, (inferior-ess (post inf-ess): start-args=--no-readline --no-restore , comint-echoes=t Making Process...Buf R, :Proc R, :Prog R :Args= --no-readline --no-restore Start File=nil (inferior-ess: waiting for process to start (before hook) (inferior-ess 3): waiting for process after hook(R): inferior-ess-language-start=options(STERM='iESS', str.dendrogram.last="'", editor='emacsclient', show.error.locations=TRUE) ... request-a-process: buf=PCS.sim.r (ess-get-help-topics-list R) ..(get-object-list R) ..--> (ess-get-modtime-list) (ess-search-list ... ) after 'search() ', point-max=195 (ess-get-modtime-list): created new alist of length 9 (length alist) : 9 have re-read pos=1: -> length 0 (ess-search-list ... ) after 'search() ', point-max=193 Processing RDS files ... (ess-get-help-topics-list R) .. (ess-search-list ... ) after 'search() ', point-max=391 Processing RDS files ... (ess-setq-vars-LOCAL): language=S, dialect=R, buf=nil, comint..echoes=t, comint..sender=comint-simple-send (ess-help 'helpR' start .. |--> t [searching nil] (ess-help: kill bogus buffer helpR ..

Last 2 paragraphs from ESS when it is working:

(R): ess-dialect=nil, buf=scratch, start-arg=nil current-prefix-arg=nil (inf-ess 1): lang=nil, dialect=nil, tmp-dialect=R, buf=scratch (inf-ess 1.1): procname=R temp-dialect=R, buf-name=R (inferior-ess) Method #3 start=/home/tws/research/rwd/ buf=R (ess-setq-vars-LOCAL): language=S, dialect=R, buf=nil, comint..echoes=t, comint..sender=comint-simple-send (inf-ess 2.1): ess-language=S, ess-dialect=R buf=R (ess-setq-vars-LOCAL): language=S, dialect=R, buf=nil, comint..echoes=t, comint..sender=inferior-ess-input-sender (i-ess 1): buf=R, lang=S, comint..echo=t, comint..sender=inferior-ess-input-sender, (i-ess end): buf=R, lang=S, comint..echo=t, comint..sender=inferior-ess-input-sender, (inferior-ess (post inf-ess): start-args=--no-readline --no-restore , comint-echoes=t Making Process...Buf R, :Proc R, :Prog R :Args= --no-readline --no-restore Start File=nil (inferior-ess: waiting for process to start (before hook) (inferior-ess 3): waiting for process after hook(R): inferior-ess-language-start=options(STERM='iESS', str.dendrogram.last="'", editor='emacsclient', show.error.locations=TRUE) load-ESSR cmd: local({ source('/usr/local/share/emacs/etc/ess/ESSR/R/.load.R', local=TRUE) #define load.ESSR load.ESSR('/usr/local/share/emacs/etc/ess/ESSR/R')})

(ess-get-help-topics-list R) ..(get-object-list R) ..--> (ess-get-modtime-list) (ess-search-list ... ) after 'search() ', point-max=221 (ess-get-modtime-list): created new alist of length 10 (length alist) : 10 have re-read pos=1: -> length 0 (ess-search-list ... ) after 'search() ', point-max=221 Processing RDS files ... (ess-setq-vars-LOCAL): language=S, dialect=R, buf=nil, comint..echoes=t, comint..sender=comint-simple-send (ess-help 'helpR' start .. |--> nil [searching t](ess-get-help-topics-list R) ..

vspinu commented 9 years ago

Thanks Tyler for all the work. The issue is non-deterministic. So it will be hard to hunt down. The broken version is missing load-ESSR:. Sadly, there are no other clues. This clearly has to do with the recent changes on ESSR loading. I will look at the code and will see if I can make it more robust.

Vitalie

Tyler on Thu, 09 Oct 2014 07:49:40 -0700 wrote:

Last paragraph from ESS from broken session:

Start File=nil (inferior-ess: waiting for process to start (before hook) (inferior-ess 3): waiting for process after hook(R): inferior-ess-language-start=options(STERM='iESS', str.dendrogram.last="'", editor='emacsclient', show.error.locations=TRUE) ... request-a-process: buf=PCS.sim.r

Last 2 paragraphs from ESS when it is working:

Start File=nil (inferior-ess: waiting for process to start (before hook) (inferior-ess 3): waiting for process after hook(R): inferior-ess-language-start=options(STERM='iESS', str.dendrogram.last="'", editor='emacsclient', show.error.locations=TRUE) load-ESSR cmd: local({ source('/usr/local/share/emacs/etc/ess/ESSR/R/.load.R', local=TRUE) #define load.ESSR load.ESSR('/usr/local/share/emacs/etc/ess/ESSR/R')})

chasberry commented 9 years ago

Vitalie,

When 14.09 was released, org-mode's `org-babel-R-initiate-session' (in ob-R.el) broke with symptoms that seemed similar. It looked like inputs sent to the inferior-ess process were arriving before ESSR got attached. Those problems were resolved by inserting

(ess-wait-for-process (get-process (or ess-local-process-name ess-current-process-name)))

in that function to let the start up processing run to completion before trying to send more inputs.

Maybe forcing a wait before each input in the startup would resolve the current issue. ??

Chuck

vspinu commented 9 years ago

The changes that have been introduced in 14.09 were intended to avoid ess-wait-for-process in the first place. That was necessary to allow starting R with gdb debugger.

Given the abundance of such non-deterministic error reports we will definitely have to reconsider that logic.

Vitalie

chasberry on Tue, 04 Nov 2014 18:23:44 -0800 wrote:

Vitalie, When 14.09 was released, org-mode's `org-babel-R-initiate-session' (in ob-R.el) broke with symptoms that seemed similar. It looked like inputs sent to the inferior-ess process were arriving before ESSR got attached. Those problems were resolved by inserting

(ess-wait-for-process (get-process (or ess-local-process-name ess-current-process-name)))

in that function to let the start up processing run to completion before trying to send more inputs.

Maybe forcing a wait before each input in the startup would resolve the current issue. ??

Chuck

— Reply to this email directly or view it on GitHub.

biocyberman commented 6 years ago

Thanks to @mmaechler Running R-initiialize-on-start made the documentation search to work again. Haven't checked if it still works when I restart emacs.