Skip to content

Commit

Permalink
Ask user to disable background evaluations in case of interrupt
Browse files Browse the repository at this point in the history
  • Loading branch information
lionel- committed Apr 15, 2023
1 parent be4bf81 commit 71b0e36
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions doc/newfeat.texi
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
Changes and New Features in 19.04 (unreleased):
@itemize @bullet

@item ESS[R]: When a background command is interrupted with C-g,
ESS now asks the user if they want to disable background evaluations
altogether. This is a resiliency measure against cases where background
evals cause cascading errors or hangs.

@item ESS[R]: Background commands now propagate errors to Emacs.

@item ESS[R]: Background commands can now be disabled by process instad of globally.
Expand Down
7 changes: 6 additions & 1 deletion lisp/ess-inf.el
Original file line number Diff line number Diff line change
Expand Up @@ -1463,8 +1463,13 @@ wrapping the code into:
(goto-char (point-max))
(ess--interrupt proc)))
;; Can be `t` when early exit is caused e.g. by a throw instead of
;; an error or a quit
;; an error or a quit. This happens in tests and within
;; `while-no-input'.
(unless (eq early-exit t)
(when (and (eq (car early-exit) 'quit)
(y-or-n-p (concat "Background background command interrupted with a user quit.\n"
"Would you like to disable background evaluations in this process?")))
(process-put proc 'bg-eval-disabled t))
(signal (car early-exit) (cdr early-exit))))

;; (ess-process-get 'ess-format-command-alist)
Expand Down

0 comments on commit 71b0e36

Please sign in to comment.