aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ingebrigtsen2020-12-28 04:24:01 +0100
committerLars Ingebrigtsen2020-12-28 04:24:01 +0100
commited30956099fff5025698c8ffdd9e876f207ed2af (patch)
tree5666960fc8284614da77d609dfcabfa14c10042b
parent2a64de5e982fb8b868b76626ac2e92ddfafc9ca5 (diff)
downloademacs-ed30956099fff5025698c8ffdd9e876f207ed2af.tar.gz
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).
-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]."
1512 (interactive "r") 1512 (interactive "r")
1513 (inferior-octave t) 1513 (inferior-octave t)
1514 (let ((proc inferior-octave-process) 1514 (let ((proc inferior-octave-process)
1515 (string (buffer-substring-no-properties beg end)) 1515 (string (buffer-substring-no-properties beg end)))
1516 line)
1517 (with-current-buffer inferior-octave-buffer 1516 (with-current-buffer inferior-octave-buffer
1518 ;; https://lists.gnu.org/r/emacs-devel/2013-10/msg00095.html 1517 ;; https://lists.gnu.org/r/emacs-devel/2013-10/msg00095.html
1519 (compilation-forget-errors) 1518 (compilation-forget-errors)
1520 (setq inferior-octave-output-list nil) 1519 (insert-before-markers string "\n")
1521 (while (not (string-equal string "")) 1520 (comint-send-string proc (concat string "\n"))))
1522 (if (string-match "\n" string)
1523 (setq line (substring string 0 (match-beginning 0))
1524 string (substring string (match-end 0)))
1525 (setq line string string ""))
1526 (setq inferior-octave-receive-in-progress t)
1527 (inferior-octave-send-list-and-digest (list (concat line "\n")))
1528 (while inferior-octave-receive-in-progress
1529 (accept-process-output proc))
1530 (insert-before-markers
1531 (mapconcat 'identity
1532 (append
1533 (if octave-send-echo-input (list line) (list ""))
1534 inferior-octave-output-list
1535 (list inferior-octave-output-string))
1536 "\n")))))
1537 (if octave-send-show-buffer 1521 (if octave-send-show-buffer
1538 (display-buffer inferior-octave-buffer))) 1522 (display-buffer inferior-octave-buffer)))
1539 1523