-
Notifications
You must be signed in to change notification settings - Fork 5
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
Echoed input not responding to comint-process-echoes or ess-eval-visibly #1
Comments
This could be because the output is not exactly the same as input. |
I don't think so, because if I start Stata in an Emacs shell, it duplicates output until I set comint-process-echoes to t, and then it behaves properly. I am currently working on the hypothesis that it has to with the prompt regexps, which seem to be the only things that differ across standard comint (e.g., Stata in a shell), Stata in inferior-ess and R in inferior-ess. I need to do some more exploration. |
I've looked at this a bit more carefully. I have found that if I have "fixed" this by editing However, I hesitate to suggest this as a fix as I don't know the codebase very well: am I missing some negative consequences of this change? (defun inferior-ess-input-sender (proc string)
(inferior-ess--interrupt-subjob-maybe proc)
(let ((comint-input-filter-functions nil)) ; comint runs them, don't run twice.
(if comint-process-echoes
(ess-eval-linewise string t nil ess-eval-empty) ;; change
(ess-send-string proc string)))) |
No worries, I still feel lost in the ESS internals after many years of working on various parts of it. I don't understand the relationship between eval visibility and process echoes. I think we shouldn't make any change until we have a global view of what is going on though, which is difficult in part because of all the moving parts, and in part because ESS is generic across REPLs and modes. I'm surprised to see that for R, the value of These issues are probably related to Since changes to the input sender will affect R, we will need unit tests covering the various cases. |
"It seems that ess-eval-linewise inserts the input in the buffer, STATA echoes another copy, and then comint only deletes a single one?" Exactly. Grepping the lisp sub-directory, it seems that only R-mode and S-mode explicitly do anything to |
Continuing the discussion from #10 (comment). If |
Is it not the opposite? If the inferior process doesn't echo the input, ESS needs to insert it. If it does (and ESS knows via |
I don't think so, there is no need to insert anything in the general case because the user input is already in the process buffer. I don't understand:
I may be completely wrong about how any of this works. |
I'm confused by the variety of ways ESS evaluates code (in the inferior-process buffer, linewise from the source file, block evaluation, However, do we understand the same of |
That's my understanding as well. I think I think you may be right that we should turn on the |
OK, a trial with (defun inferior-ess-input-sender (proc string)
(inferior-ess--interrupt-subjob-maybe proc)
(let ((comint-input-filter-functions nil)) ; comint runs them, don't run twice.
(ess-eval-linewise string comint-process-echoes nil ess-eval-empty))) seems to behave well in R and Stata buffers (with |
Encouraging.
Did you mean If not can you also do some experiments to see how this interacts with |
I see I will experiment with |
Adding |
Commands are duplicated in the output. Setting comint-process-echoes to t, or changing ess-eval-visibly seems to have no effect.
In an XFCE-terminal, Stata doesn't duplicate output. In an Emacs shell, it does, but it responds to comint-process-echoes. In ESS it duplicates but does not respond to comint-process-echoes.
The text was updated successfully, but these errors were encountered: