summaryrefslogtreecommitdiff
path: root/lisp/cedet/ede/shell.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/cedet/ede/shell.el')
-rw-r--r--lisp/cedet/ede/shell.el13
1 files changed, 9 insertions, 4 deletions
diff --git a/lisp/cedet/ede/shell.el b/lisp/cedet/ede/shell.el
index 3d6eb194e42..d28977bd14f 100644
--- a/lisp/cedet/ede/shell.el
+++ b/lisp/cedet/ede/shell.el
@@ -42,10 +42,15 @@ COMMAND is a text string representing the thing to be run."
;; Show the new buffer.
(when (not (get-buffer-window buff))
(switch-to-buffer-other-window buff t))
- ;; Force a shell into the buffer.
- (shell buff)
- (while (eq (point-min) (point))
- (accept-process-output))
+ ;; Force a shell into the buffer, but only if the buffer
+ ;; doesn't already have a shell in it.
+ ;; Newer versions of `shell' pop the window forward.
+ (set-buffer buff)
+ (when (not (eq major-mode 'shell-mode))
+ (shell buff)
+ ;; Make sure the shell has started.
+ (while (eq (point-min) (point))
+ (accept-process-output)))
;; Change the default directory
(if (not (string= (file-name-as-directory (expand-file-name default-directory))
(file-name-as-directory (expand-file-name dd))))