[ESS] problems with ess-command

Vitalie S. spinuvit.list at gmail.com
Fri Feb 11 12:20:40 CET 2011


Dear ESS developers,

Calling ess-command with long command which do not output anything like

(ess-command "my_func<-function(..) { .. long function body..}\n")

would result in a hang.

This, because ess-command waits for inferior-ess-primary-prompt of the
form "\\([A-Z][][A-Za-z0-9.]*\\)?> " and does not allow for

 + + + + + + + + + + + > >

 which is the prompt resulted from the above command.

Setting inferior-ess-primary-prompt to
 "\\([A-Z][][A-Za-z0-9.]*\\)?\\(+ \\)*> " helps here.


A bit more severe problem is that ess-command detects the prompt
prematurely.

For instance 

(ess-command "my_func<-function(..) { .. long function
body..};str(iris)\n")

would result in str(iris) being printed directly to *R* buffer.

The above apparently happens because emacs splits the process output into
pieces and first outputs:

+ + + + > + + +

which is detected by ess-command as a valid prompt and the rest is
printed to *R* buffer.

The above behavior could be solved by anchoring the prompt expression to
the end of line in the ess-command.

This relates to my yesterday post on how to make the prompt check more
reliable in general, which proposed to check for the prompt at the
end of process output, directly in the process filter.

If anyone is interested in all these I can spend some more time on
developing (hopefully) a more reliable alternative to ess-inf.el
functionality.

Best regards,
Vitalie.



More information about the ESS-help mailing list