emacs-ess / ESS

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

The process mark gets moved causing incorrect input to be sent #1149

Open dapritchard opened 3 years ago

dapritchard commented 3 years ago

This is a problem that I've been observing for several months that I've been struggling to know how to describe in a meaningful way. The observable behavior is that sporadically I'll press enter in the inferior process R buffer or send a command to the R process through ess-eval-region-or-function-or-paragraph-and-step or similar and I'll get a bunch of crazy output that looks something like the following.

> > Error: unexpected '>' in ">"
> Error: unexpected '[[' in "[["
> Error: unexpected '<' in "<"
> > Error: unexpected '>' in ">"

What I think is happening is that somehow the process mark (by which I mean the mark that is returned by process-mark) is somehow getting moved to the wrong location (typically somewhere earlier in the process buffer). Then, when e.g. inferior-ess-send-input is evaluated, the text that is sent to the R process includes a bunch of text from earlier inputs and outputs that includes stuff like > 1 + 1 and [1] 2 and hence results in strange error messages like the one above.

It's entirely possible that this behavior is a bug in comint or some other interaction with another package that I am running (I use a fairly unmodified Doom Emacs configuration). But I thought I would go ahead and share this issue to see if others have any suggestions for how I might go about trying to track down the cause of the behavior.

lionel- commented 3 years ago

Just to be sure, you're using the last dev version?

I had been observing the same issue a few months ago. Didn't run into it since, but that may be because I switched from an overheating and throttling 2011 MB to an M1 laptop which is much faster.

Unfortunately I don't have any free time for working on ESS until August.

dapritchard commented 3 years ago

Thanks for the response regarding this difficulty. I also suspect that this is something going on on my end, and after digging through my configuration I think it's possible that due to a misunderstanding on my part of how the straight package manager works that I have been using outdated versions of the byte-compiled ESS files (from about 3 months ago). I've rebuilt the elc files and with any luck this will solve the problem. I can report back in a day or so regarding whether I've observed any more cases of this behavior.

dapritchard commented 3 years ago

Sadly, this behavior did show up again today. I will continue to dig into it and see what I can come up with. Any pointers/suggestions welcome.

dapritchard commented 3 years ago

I ended up upgrading Emacs installing and reinstalling all of my packages, and I'm thankful to report that this issue with the process mark being moved has resolved itself. I'm happy to close this issue unless anybody believes we should keep it around for some reason (I do see that it's marked as part of the 'next' milestone).