-
Notifications
You must be signed in to change notification settings - Fork 160
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
New R processes are not shown anymore #1074
Comments
Well, for me the problem comes from commit 0ee7582 (everything's fine with previous commits).
I understand the problem raised (and solved) by commit 0ee7582, but is this really the intended behavior? And in this case, what are the appropriate (new) instructions to customize |
Thanks. I do wonder whether we should just apply the following. It means you couldn't do the normal eg C-c C-c commands without the R process always being shown, but I get the sense pretty much everyone wants it to be shown anyway. diff --git a/lisp/ess-inf.el b/lisp/ess-inf.el
index f425cc02..4dbcfc7b 100644
--- a/lisp/ess-inf.el
+++ b/lisp/ess-inf.el
@@ -812,7 +812,8 @@ to `ess-completing-read'."
(ess--with-no-pop-to-buffer
(ess-start-process-specific ess-language ess-dialect))
(caar ess-process-name-list))))))
- (unless noswitch
+ (if noswitch
+ (display-buffer (ess-get-process-buffer proc))
(pop-to-buffer (ess-get-process-buffer proc)))
proc))
|
Alternatively, we could be a little less opinionated and just ensure we show the R buffer if we've started a new process with something like: diff --git a/lisp/ess-inf.el b/lisp/ess-inf.el
index f425cc02..51553eaf 100644
--- a/lisp/ess-inf.el
+++ b/lisp/ess-inf.el
@@ -812,6 +812,7 @@ to `ess-completing-read'."
(ess--with-no-pop-to-buffer
(ess-start-process-specific ess-language ess-dialect))
(caar ess-process-name-list))))))
+ (when auto-started? (display-buffer (ess-get-process-buffer proc)))
(unless noswitch
(pop-to-buffer (ess-get-process-buffer proc)))
proc)) |
Thanks, this is okay for me. :-) This fix would do the trick... at least for a first part. Actually, I found the reason for the bug The reproduce the bug, create a file minimal init file (package-initialize)
(eval-when-compile
(require 'use-package))
(use-package helm
:ensure t
:config
(helm-mode 1))
(use-package ess
:ensure t
:init
(require 'ess-site)) Then, open emacs with |
I've encountered the helm variant of this issue ( My emacs debugging skills are quite crude, but I think I've isolated the issue. Ultimately, when launching a new R process, we call However, since the commit discussed above, all of this is running inside of the Here's a fairly minimal example that illustrates the problem (it doesn't immediately error out, but for some reasons throws me into the debugger and you can't see the prompt pop up).
If I set the variable |
I have an idea for a way to fix this (without breaking what 0ee7582 was trying to accomplish), but it seems like my specific issue (helm + ESS breaks launching new inferior R shells) is maybe different than what this issue is originally about (i.e., "New R processes are not shown anymore"). Should I open a new issue specifically for helm + ESS and make a PR against that, or work against this existing issue? |
Thanks @dankessler ! |
Hi all, I'm experiencing the same problem and the workaround from @dankessler definitely works for now. If there's a more elegant solution, I would definitely love to hear it! Even if it involves opening a new issue, or implementing a fix for the next version of ESS. Big thanks to all of you! |
Given that this issue severely interferes with the user flow I am fixing it with the second @jabranham's proposal. Relevant commits/issues: 21cb413 fixed #987 but introduced two-window issue #1067 which was fixed by 0ee7582 but introduced this issue. To be frank I lost track of all the nuances that the new display-buffer aware mechanism had to deal with. @jabranham @lionel- would you mind putting together a list of requirements which the current implementation has to conform to? With the purpose of adding a comprehensive set of tests. |
I was planning to if no one else was going to do it before release. That is low in my priority list though. I don't use display-buffer for processes myself. |
This was done for the benefit of multi select with M-M-m [1], this could also be implemented with Help using =,= [2] but helm breaks ESS [3] so that's not an option. References: [1]: abo-abo/swiper#1191 [2]: emacs-helm/helm#2063 [3]: emacs-ess/ESS#1074
This was done for the benefit of multi select with M-M-m [1], this could also be implemented with Help using =,= [2] but helm breaks ESS [3] so that's not an option. References: [1]: abo-abo/swiper#1191 [2]: emacs-helm/helm#2063 [3]: emacs-ess/ESS#1074
I am encountering this error while using 4fefd0f. I encounter the error regardless of the value of the (setq ess-ask-for-ess-directory nil) ;if you don't want to be prompted each time you start an interactive R session
(setq ess-startup-directory "~/")
As I'm using Spacemacs, here is my .spacemacs, in case any part of my configuration is influencing how Helm or ESS are being loaded and used apart from the |
@bryce-carson I recently migrated to spacemacs myself, too. I assume what you mean by encountering the error is illustrated by
This happens to me, also. My current workflow is to instead first start the inferior shell with For whatever reason, I didn't migrate the "set Out of curiosity, I tried adding |
I'll do this in a day or so. For now, I've switched back to Ivy, rather than Helm, as I need to make progress on my Shiny app for a meeting this Friday. I'll investigate my configuration further when I have the time. |
The uncommented Lastly, manually evaluating I'll investigate my .spacemacs. As for this issue, do you think that it is possible 983c54b & 9f81477 haven't corrected it fully? I'd love to contribute more, but I'm only at |
I am using:
And can confirm that this problem still persists: Maybe this merits a second look, @vspinu? If I start beforehand an ESS session with |
@nettoyoussef could you maybe start anew issue for this with a back trace and steps to reproduce? It's a lot of stuff here, probably no longer relevant. |
When R is started "implicitly" (e.g., with `C-RET` on a line of code in an `R` buffer not associated with a session), the invocation of R gets wrapped in the `ess--with-no-pop-to-buffer` macro, which binds the `display-buffer-ovverriding-action` such that no buffers cannot be displayed. Although presumably well-intentioned, this has the unfortunate side-effect of screwing things up for helm users, since when/if `ess` tries to prompt the user for a directory, helm steps in and tries to display a new buffer in which the user can make the choice, but its efforts are thwarted by the wrapper. This gives the `Wrong type argument: window-live-p, nil` error of emacs-ess#1074 because helm expects to get a (handle to a) buffer but instead gets `nil` when its attempts are squashed. This commit fixes things in a hacky way but hopefully sufficiently surgical manner: it expands the `let` form that wraps `ess-prompt-for-directory` to rebind `display-buffer-overriding-action` to nil, which undoes (only for the purposes of prompting for a directory) the attempts of the `ess--with-no-pop-to-buffer` macro to prevent this kind of behavior. The thread for emacs-ess#1074 is long and involved, but discussion relevant to this commit is in [this comment](emacs-ess#1074 (comment)).
When R is started "implicitly" (e.g., with `C-RET` on a line of code in an `R` buffer not associated with a session), the invocation of R gets wrapped in the `ess--with-no-pop-to-buffer` macro, which binds the `display-buffer-ovverriding-action` such that no buffers cannot be displayed. Although presumably well-intentioned, this has the unfortunate side-effect of screwing things up for helm users, since when/if `ess` tries to prompt the user for a directory, helm steps in and tries to display a new buffer in which the user can make the choice, but its efforts are thwarted by the wrapper. This gives the `Wrong type argument: window-live-p, nil` error of emacs-ess#1074 because helm expects to get a (handle to a) buffer but instead gets `nil` when its attempts are squashed. This commit fixes things in a hacky way but hopefully sufficiently surgical manner: it expands the `let` form that wraps `ess-prompt-for-directory` to rebind `display-buffer-overriding-action` to nil, which undoes (only for the purposes of prompting for a directory) the attempts of the `ess--with-no-pop-to-buffer` macro to prevent this kind of behavior. The thread for emacs-ess#1074 is long and involved, but discussion relevant to this commit is in [this comment](emacs-ess#1074 (comment)).
Hi everyone,
Since the last update, I get
Wrong type argument: window-live-p, nil
when trying to eval some code withC-c C-c
on a source file with no active session.Pretty easy to reproduce:
source.R
file with the contentx <- 2
C-c C-c
or whatever.This works again if the R session is created manually with
M-x R
.The text was updated successfully, but these errors were encountered: