summaryrefslogtreecommitdiff
path: root/lisp/progmodes/octave-inf.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/progmodes/octave-inf.el')
-rw-r--r--lisp/progmodes/octave-inf.el7
1 files changed, 7 insertions, 0 deletions
diff --git a/lisp/progmodes/octave-inf.el b/lisp/progmodes/octave-inf.el
index 4f0875bbf99..67b5b108fa5 100644
--- a/lisp/progmodes/octave-inf.el
+++ b/lisp/progmodes/octave-inf.el
@@ -220,6 +220,13 @@ startup file, `~/.emacs-octave'."
(concat (mapconcat
'identity inferior-octave-output-list "\n")
"\n"))))
+
+ ;; An empty secondary prompt, as e.g. obtained by '--braindead',
+ ;; means trouble.
+ (inferior-octave-send-list-and-digest (list "PS2\n"))
+ (if (string-match "^PS2 = *$" (car inferior-octave-output-list))
+ (inferior-octave-send-list-and-digest (list "PS2 = \"> \"\n")))
+
;; O.k., now we are ready for the Inferior Octave startup commands.
(let* (commands
(program (file-name-nondirectory inferior-octave-program))