
ess-tracebug - issue #6
ess-display-help-on-object does not work with ess-tracebug enabled
What steps will reproduce the problem? 1. Enable ess-tracebug 2. Move the point to an object name you want help on 3. Run ess-display-help-on-object using M-x ess-display-help-on-object or C-c C-v
What is the expected output? What do you see instead? Emacs should display help on the object name at point. Instead, a long vector of function names is printed on the R console
Please provide any additional information below. Disabling ess-tracebug fixes the problem immediately.
Comment #1
Posted on Jul 21, 2011 by Quick WombatI can not reproduce this on windows and linux machines. It never happened actually. And I am using C-c C-v hundreds of times a day. I suspect it's something specific to your installation or your use. Could you please give the versions of emacs and ess you are using. Also have you used X-windoed emacs to report this bug?
To have a clear picture of what is going on, can you please do the following:
M-x toggle-debugg-on-error
and then C-c C-v. Please send me the content of the debbuger.
Also
M-: (setq ess-verbose t)
Execute C-c C-v and then go to the ESS' and tell me what you see at the end. It should be something like:
*ddeclient-p: ess-loc-proc-name is 'R'(ess-command2 .help.ESS("foo", help_type="text") ..) .. waiting for ess process {ess-command2} .. .. ok{ess-command2}
Also make sure you use the latest version of ess-tracebug (currently revision 85).
Thanks for your reports.
Comment #2
Posted on Jul 21, 2011 by Grumpy CatI'm using Emacs 23.3.1 and ESS 5.13 under Gnome. I used the ess-tracebug version from the Google code webpage, but to be sure I got the latest version from SVN. SVN said it's revision 85, however in ess-tracebug.el it says "Version: 0.2 (svn 80)".
Doing M-x toggle-debugg-on-error and then C-c C-v gave me this:
Debugger entered--Lisp error: (error "ESS process not ready. Finish your command before trying again.") signal(error ("ESS process not ready. Finish your command before trying again.")) error("ESS process not ready. Finish your command before trying again.") ess-error("ESS process not ready. Finish your command before trying again.") (if (or (process-get sprocess ...) no-prompt-check) nil (ess-error "ESS process not ready. Finish your command before trying again.")) (unless (or (process-get sprocess ...) no-prompt-check) (ess-error "ESS process not ready. Finish your command before trying again.")) (save-excursion (ess-if-verbose-write (format "(ess-command2 %s ..)" com)) (unless (or ... no-prompt-check) (ess-error "ESS process not ready. Finish your command before trying again.")) (setq oldpf (process-filter sprocess)) (setq oldpb (process-buffer sprocess)) (setq oldpm (marker-position ...)) (unwind-protect (progn ... ... ... ...) (set-process-buffer sprocess oldpb) (set-process-filter sprocess oldpf) (set-marker ... oldpm oldpb))) (if (ess-ddeclient-p) (ess-command-ddeclient com buf sleep) (save-excursion (ess-if-verbose-write ...) (unless ... ...) (setq oldpf ...) (setq oldpb ...) (setq oldpm ...) (unwind-protect ... ... ... ...))) (let* ((sprocess ...) do-sleep end-of-output oldpb oldpf oldpm) (if (ess-ddeclient-p) (ess-command-ddeclient com buf sleep) (save-excursion ... ... ... ... ... ...))) ess-command("names(.readRDS(\"/usr/lib/R/library/graphics/help/aliases.rds\"))\n" # sleep nil) ess-get-words-from-vector("names(.readRDS(\"/usr/lib/R/library/graphics/help/aliases.rds\"))\n") #[(a-file) "\301!\205\f
And this is what I get in the ESS after setting ess-verbose to t and C-c C-v:
..(ess-get-help-topics-list R) ..ess-get-words*(searchpaths() ).. (ess-command2 searchpaths() ..) .. waiting for ess process {ess-command2} .. .. ok{ess-command2} [ok] .. |-> (length words)= 10 ess-get-words*(names(.readRDS("/usr/lib/R/library/stats/help/aliases.rds")) ).. (ess-command2 names(.readRDS("/usr/lib/R/library/stats/help/aliases.rds")) ..) .. waiting for ess process {ess-command2} .. Waited for 30 seconds. Process is bussy or waits for user input. .. ok{ess-command2} [ok] .. |-> (length words)= 172 ess-get-words*(names(.readRDS("/usr/lib/R/library/graphics/help/aliases.rds")) ).. (ess-command2 names(.readRDS("/usr/lib/R/library/graphics/help/aliases.rds")) ..)
Comment #3
Posted on Jul 21, 2011 by Grumpy CatForgot to add: yes, I'm using Emacs in X mode.
Comment #4
Posted on Jul 21, 2011 by Quick WombatCompletely puzzled by this behavior. Cannot reproduce any single piece of it. Default ESS is commands are virtually identical to my versions here.
Can you please try from R prompt:
names(.readRDS("/usr/lib/R/library/stats/help/aliases.rds"))
and see if there is anything weird, particularly if you R does not return the last prompt ">" after execution.
Also try evaluating each of the following commands in emacs (M-: or directly in scratch with C-x e):
(ess-command "names(.readRDS(\"/usr/lib/R/library/stats/help/aliases.rds\"))\n") (ess-get-words-from-vector "names(.readRDS(\"/usr/lib/R/library/stats/help/aliases.rds\"))\n")
The only explanation I can think of is what you are not using the default R prompt ">". What is the value of 'inferior-ess-primary-prompt' in your R buffer? Ess and ess-tracebug are relying on it in some critical parts.
This is where your system is stuck.
Comment #5
Posted on Jul 22, 2011 by Grumpy CatI don't see anything weird after
names(.readRDS("/usr/lib/R/library/stats/help/aliases.rds"))
The prompt is there. The output to the R console is a character vector of length 769 with function names.
The result of
(ess-command "names(.readRDS(\"/usr/lib/R/library/stats/help/aliases.rds\"))\n")
is "nil".
The result of
(ess-get-words-from-vector "names(.readRDS(\"/usr/lib/R/library/stats/help/aliases.rds\"))\n")
is
("stats-package" ".checkMFClasses" ".getXlevels" ".MFclass" "acf" "acf2AR" "add.scope" "add1" "add1.default" "add1.glm" "add1.lm" "addmargins" ...)
inferior-ess-primary-prompt is "\([A-Z][][A-Za-z0-9.]*\)?> "
Comment #6
Posted on Jul 22, 2011 by Quick Wombat(No comment was entered for this change.)
Comment #7
Posted on Jul 30, 2011 by Quick WombatHi there,
I am really stuck with this bug. As already said, can't reproduce it either way. So I am closing as unreproducible.
For time being, if your problem is still there please set
(setq ess-tracebug-enhance-ess-command nil)
before you start ess-tracebug. This will prohibit ess-tracebug from replacing the original ess-command. I've added this variable just now.
I will keep an open eye on this issue and if anyone else also reports it, that would mean that it's not your weird local problem. So I will investigate it further.
Comment #8
Posted on Aug 25, 2011 by Quick WombatOk I got it, it's an elusive bug in emacs 23.2.1 under linux. It occurs because 'accept-process-output' is not waiting for the time specified by SECONDS arguments and returns immediately under some peculiar conditions which I cannot reproduce explicitly.
Now it's solved.
Thanks for your reports. Ess-tracebug is much better now.
Vitalie.
Comment #9
Posted on Aug 26, 2011 by Grumpy CatI can confirm that it works now, thanks!
Status: Fixed
Labels:
Type-Defect
Priority-Medium