summaryrefslogtreecommitdiff
path: root/lisp/ess-inf.el
diff options
context:
space:
mode:
authorLionel Henry <lionel.hry@gmail.com>2021-11-11 11:13:46 +0100
committerLionel Henry <lionel.hry@gmail.com>2021-11-11 11:14:30 +0100
commitf37b0a8bc03de5f2b8b171dd0509ff5c1ddc263f (patch)
treec1f040371b94ee2a97e621c49ae0260fc35bfd9d /lisp/ess-inf.el
parent569dca1f4ff939a93c7be97c34577666d9af8b3a (diff)
Handle multiline outputs in `ess-string-command`
Follow-up to ada06f09fcd5ff82cb389b7e8b0cd4b47e68fcdc See #922
Diffstat (limited to 'lisp/ess-inf.el')
-rw-r--r--lisp/ess-inf.el10
1 files changed, 2 insertions, 8 deletions
diff --git a/lisp/ess-inf.el b/lisp/ess-inf.el
index 58ac06f..f9ca44b 100644
--- a/lisp/ess-inf.el
+++ b/lisp/ess-inf.el
@@ -1456,14 +1456,8 @@ Example (ess-boolean-command \"2>1\n\")"
(defun ess-string-command (com &optional buf wait)
"Returns the output of COM as a string."
- (let ((prompt inferior-ess-prompt))
- (with-current-buffer (ess-command com buf nil nil wait)
- (goto-char (point-min))
- ;; remove leading prompt
- (when (and prompt (re-search-forward (concat "^" prompt) (point-at-eol) t))
- (delete-region (point-min) (match-end 0)))
- (ess-kill-last-line)
- (buffer-substring (point-min) (point-max)))))
+ (with-current-buffer (ess-command com buf nil nil wait)
+ (buffer-substring (point-min) (point-max))))
(defun ess-async-command (com &optional buf proc callback interrupt-callback)
"Asynchronous version of `ess-command'.