Closed kingofkung closed 3 years ago
What version of ESS are you running? If it's from a recentish MELPA, inferior-ess-own-frame
is obsolete, you should try something like:
(add-to-list 'display-buffer-alist
'("*R"
(display-buffer-reuse-window display-buffer-pop-up-frame)))
I am running version 18.10.2, and I replaced inferior-ess-own-frame
with what you had above in my .init.el file. The result was the same; running R via C-c C-c on a line of my script buffer opened R in a new frame, but the new frame immediately returned to the buffer with the script.
I found this on the site below the quote, and I think it's related.
the erroneous behaviour you describe happens only the first time one types C-c C-z (
ess-switch-to-inferior-or-script-buffer
) in aness-r-mode buffer
, i.e. before the corresponding inferior R process buffer has been created.This is because
ess-force-buffer-current
callsess-request-a-process
with a non-nil noswitch argument when an inferior process does not already exist.
ess-request-a-process
, in turn, does the following as its last step:(if noswitch (pop-to-buffer (current-buffer)) ;; VS: this is weird, but is necessary (pop-to-buffer (buffer-name (process-buffer (get-process proc)))))
This call to
(pop-to-buffer (current-buffer))
is wrong and is what causes youress-r-mode
buffer to appear a second time in the new frame. It was added in the following commit from 2012: https://github.com/emacs-ess/ESS/commit/b29ea8f934f7c08a512c73f14e914bca7229b3c1
Sounds like this is probably the same as #987 which is solved by #989
Duplicate of #987.
Hello, When I attempt to run R, opening it by
ess-eval-region-or-function-or-paragraph-and-step VIS
on an R script in its own buffer and frame, it creates a second frame and opens R in that frame, as expected by my use of(setq inferior-ess-own-frame t)
in .init.el file in .emacs.d However, it then proceeds to return the frame it just opened to run R to the buffer with the r script, and I've included what I saw in the ESS buffer below.