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'.
This commit is contained in:
parent
302e500087
commit
0d224e8241
1 changed files with 6 additions and 1 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Reference in a new issue