emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 0d224e8 3/4: Avoid messing up buffer list when star


From: Noam Postavsky
Subject: [Emacs-diffs] master 0d224e8 3/4: Avoid messing up buffer list when starting gud (Bug#22374)
Date: Wed, 23 May 2018 19:08:53 -0400 (EDT)

branch: master
commit 0d224e82411d9471f03fc339890d6a2952b5e239
Author: Michael Welsh Duggan <address@hidden>
Commit: Noam Postavsky <address@hidden>

    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'.
---
 lisp/progmodes/gud.el | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index de39835..6826674 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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]