summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Welsh Duggan <mwd@md5i.com>2014-11-23 18:34:28 -0500
committerNoam Postavsky <npostavs@gmail.com>2018-05-23 07:53:58 -0400
commit0d224e82411d9471f03fc339890d6a2952b5e239 (patch)
tree375ea1cf19b04f0bfb1d3a49713efd8c4a3973b3
parent302e500087fd4cc1c5f37ec87c98e828b22aaa05 (diff)
downloademacs-0d224e82411d9471f03fc339890d6a2952b5e239.tar.gz
Avoid messing up buffer list when starting gud (Bug#22374)
* lisp/progmodes/gud.el (gud-common-init): Use `display-buffer' instead of `switch-to-buffer'.
-rw-r--r--lisp/progmodes/gud.el7
1 files changed, 6 insertions, 1 deletions
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index de398350bd2..6826674a942 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -2605,7 +2605,12 @@ comint mode, which see."
file-subst)))
(filepart (and file-word (concat "-" (file-name-nondirectory file))))
(existing-buffer (get-buffer (concat "*gud" filepart "*"))))
- (switch-to-buffer (concat "*gud" filepart "*"))
+ (select-window
+ (display-buffer
+ (get-buffer-create (concat "*gud" filepart "*"))
+ '(display-buffer-reuse-window
+ display-buffer-in-previous-window
+ display-buffer-same-window display-buffer-pop-up-window)))
(when (and existing-buffer (get-buffer-process existing-buffer))
(error "This program is already being debugged"))
;; Set the dir, in case the buffer already existed with a different dir.