Skip to content

Commit

Permalink
Support user-defined prompts in availability check
Browse files Browse the repository at this point in the history
  • Loading branch information
lionel- committed Mar 31, 2021
1 parent cb0e3c7 commit 410d90d
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions lisp/ess-inf.el
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,7 @@ defined. If no project directory has been found, use
(when-let ((proc (or proc (and ess-local-process-name
(get-process ess-local-process-name)))))
(unless (process-get proc 'busy)
(or (ess-debug-active-p proc) ; don't send empty lines in debugger
(when-let ((last-check (process-get proc 'last-availability-check)))
(or (when-let ((last-check (process-get proc 'last-availability-check)))
(time-less-p (process-get proc 'last-eval) last-check))
(progn
;; Send an empty string and waiting a bit to make sure we are not busy.
Expand All @@ -393,9 +392,7 @@ Return non-nil if the process is in a ready (not busy) state."
(let ((ready (string-match-p (concat "\\(" inferior-ess-primary-prompt "\\)\\'") string)))
(process-put proc 'busy-end? (and ready (process-get proc 'busy)))
;; When "\n" inserted from inferior-ess-available-p, delete the prompt.
(when (and ready
(process-get proc 'availability-check)
(string-match-p (concat "^" inferior-ess-primary-prompt "\\'") string))
(when (and ready (process-get proc 'availability-check))
(process-put proc 'suppress-next-output? t))
(process-put proc 'availability-check nil)
(when ready
Expand Down

0 comments on commit 410d90d

Please sign in to comment.