summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2020-12-28 04:24:01 +0100
committerLars Ingebrigtsen <larsi@gnus.org>2020-12-28 04:24:01 +0100
commited30956099fff5025698c8ffdd9e876f207ed2af (patch)
tree5666960fc8284614da77d609dfcabfa14c10042b /lisp
parent2a64de5e982fb8b868b76626ac2e92ddfafc9ca5 (diff)
downloademacs-ed30956099fff5025698c8ffdd9e876f207ed2af.tar.gz
emacs-ed30956099fff5025698c8ffdd9e876f207ed2af.tar.bz2
emacs-ed30956099fff5025698c8ffdd9e876f207ed2af.zip
Make octave-send-region be asynchronous
* lisp/progmodes/octave.el (octave-send-region): Send things asynchronously to the inferior process (bug#24492).
Diffstat (limited to 'lisp')
-rw-r--r--lisp/progmodes/octave.el22
1 files changed, 3 insertions, 19 deletions
diff --git a/lisp/progmodes/octave.el b/lisp/progmodes/octave.el
index bda4e60c55c..f295917c0ad 100644
--- a/lisp/progmodes/octave.el
+++ b/lisp/progmodes/octave.el
@@ -1512,28 +1512,12 @@ current buffer file unless called with a prefix arg \\[universal-argument]."
(interactive "r")
(inferior-octave t)
(let ((proc inferior-octave-process)
- (string (buffer-substring-no-properties beg end))
- line)
+ (string (buffer-substring-no-properties beg end)))
(with-current-buffer inferior-octave-buffer
;; https://lists.gnu.org/r/emacs-devel/2013-10/msg00095.html
(compilation-forget-errors)
- (setq inferior-octave-output-list nil)
- (while (not (string-equal string ""))
- (if (string-match "\n" string)
- (setq line (substring string 0 (match-beginning 0))
- string (substring string (match-end 0)))
- (setq line string string ""))
- (setq inferior-octave-receive-in-progress t)
- (inferior-octave-send-list-and-digest (list (concat line "\n")))
- (while inferior-octave-receive-in-progress
- (accept-process-output proc))
- (insert-before-markers
- (mapconcat 'identity
- (append
- (if octave-send-echo-input (list line) (list ""))
- inferior-octave-output-list
- (list inferior-octave-output-string))
- "\n")))))
+ (insert-before-markers string "\n")
+ (comint-send-string proc (concat string "\n"))))
(if octave-send-show-buffer
(display-buffer inferior-octave-buffer)))