Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESS 15.09: M-x SAS can only run one line at a time without hanging #249

Closed
rsparapa opened this issue Sep 30, 2015 · 9 comments
Closed

ESS 15.09: M-x SAS can only run one line at a time without hanging #249

rsparapa opened this issue Sep 30, 2015 · 9 comments

Comments

@rsparapa
Copy link
Contributor

This is definitely a bug since M-x ess-sas-interactive (which is based on the same
underpinnings) successfully submits regions, paragraphs, etc. Bug also exists in 15.03
so it has been around for awhile apparently.

@mslaught
Copy link

mslaught commented Nov 9, 2015

Does anyone know if there has been a fix for this? A linux server I work on recently had ESS upgraded from 5.3.11 to 15.03.1 and this is now a problem for me. I use SAS interactively a lot and now I can only submit one line at a time instead of being able to use C-c C-p. It's destroying my life.

@vspinu
Copy link
Member

vspinu commented Nov 9, 2015

Could you please provide a backtrace on C-g? I will try to figure it out without having SAS installed.

Rodney, can I use some other process to emulate SAS' behavior? It's all batch, no interactive right? I should be able to fix this without even having SAS installed.

@rsparapa
Copy link
Contributor Author

rsparapa commented Nov 9, 2015

On Mon, 2015-11-09 at 10:12 -0800, Vitalie Spinu wrote:

Rodney, can I use some other process to emulate SAS' behavior? It's
all batch, no interactive right? I should be able to fix this without
even having SAS installed.

No, interactive SAS is the problem (batch works fine). Maybe you
could use R to fake it.

@vspinu
Copy link
Member

vspinu commented Nov 10, 2015

Then it's almost surely a prompt regex issue. What is SAS prompt?

@rsparapa
Copy link
Contributor Author

On Tue, 2015-11-10 at 13:29 -0800, Vitalie Spinu wrote:

Then it's almost surely a prompt regex issue. What is SAS prompt?

Hi Vitalie:

I was thinking the same thing. However, I just tried it and it works
now! I don't know if something has changed in 15.09-1 to make this
work or what is going on. But, to answer your question, SAS prompt is
just line number, i.e. in SAS.log you see these appear at the
beginning of the lines you have submitted from your .sas program...

1
2
3
etc.

For example, here is something I just ran successfully (SAS.log)...
1
2 %put I read the first line; *this works -- prints to the log;
I read the first line
3 libname temp '.'; *this works too -- gives me a "successfully defined"
3 ! message;
NOTE: Libref TEMP refers to the same physical library as PWD.
NOTE: Libref TEMP was successfully assigned as follows:

And correspondingly, in the SAS:~ buffer I see (notice that it adds
plus signs occationally for continuation I guess)...
%put I read the first line; *this works -- prints to the log;
libname temp '.'; *this works too -- gives me a "successfully defined" message;

data temp2;

  • set temp.temp1;
    run;

Rodney

@rsparapa
Copy link
Contributor Author

Maybe this is more of a misfeature than a bug. If you do (setq ess-eval-visibly 'nowait),
then it works. Should we make any changes to the code? If not, then we should change the documentation?

@vspinu
Copy link
Member

vspinu commented Nov 12, 2015

It's likely the regexp bug. With visual evaluation ESS waits for the prompt and doesn't find it. It should be strightforward to step through ess-eval-linewise and see what's going on.

@rsparapa
Copy link
Contributor Author

On Thu, 2015-11-12 at 07:47 -0800, Vitalie Spinu wrote:

It's likely the regexp bug. With visual evaluation ESS waits for the
prompt and doesn't find it. It should be strightforward to step
through ess-eval-linewise and see what's going on.

How do you that? I can't seem to find where M-x SAS even calls
ess-eval-linewise. Anyways, I see that M-x ess-sas-interactive simply
does (setq ess-eval-visibly-p nil) which is an alias for
ess-eval-visibly; so that is why ess-sas-interactive always works.

Wouldn't that be the easiest thing to do for M-x SAS too? I don't
think SAS has a prompt anyways. The line numbers come from stderr so
they are not a prompt. Or, could we have just called
ess-eval-linewise with the 5th arg WAIT-LAST-PROMPT set to t?

@vspinu
Copy link
Member

vspinu commented Nov 12, 2015

How do you that? I can't seem to find where M-x SAS even calls ess-eval-linewise.

It's not SAS that calls it but the eval commands like ess-eval-line-and-step. In order to edebug a function instrument it with C-u C-M-x and step through with edebugger when it's involved next time.

I don't think SAS has a prompt anyways.

Ok. So if there is no prompt then there is no choice but to set (setq ess-eval-visibly nil) everywhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants