When I have two frames open with different R sessions in each, such as
+------------+------------+ +------------------+
| # file.R | | | |
| 1+4 | | | > 1+2 |
| | | | [1] 3 |
| | > 1+1 | | > |
| | [1] 2 | +------------------+
| | > | | 3 *R:2* |
+------------+------------+ +------------------+
| 1 file.R | 2 *R:1* |
+------------+------------+
When I'm in window 1 and eval a line or region into *R:2*
, emacs replaces window 2's *R:1*
with *R:2*
, so I now have it open in both frame-1-window-2 and frame-2-window-3.
+------------+------------+ +------------------+
| # file.R | | | [1] 3 |
| 1+4 | > 1+2 | | > 1+4 |
| | [1] 3 | | [1] 5 |
| | > 1+4 | | > |
| | [1] 5 | +------------------+
| | > | | 3 *R:2* |
+------------+------------+ +------------------+
| 1 file.R | 2 *R:2* |
+------------+------------+
And I have to manually change window 2 back to *R:1*
.
Since the *R:2*
buffer is visible in frame 2, is there a way to prevent emacs from changing window 2? I believe that there is logic where if sourced code produces output and the buffer is not visible, then it is made visible. I think the issue here is that it is not visible in the current frame.