Hi. Sometime between emacs 23 and emacs 24 the behavior of display-buffer changed to show the buffer in the current window at times (emacs 23 always used a different window). As a (presumably unwanted) side-effect it is now possible for a gud user to lose the gud window as one interacts with gud. I often encounter this when I open a core dump in gud-gdb, then invoke "up" repeatedly to traverse the call stack. Eventually a source buffer takes over the gud window and I have to switch back to gud to keep navigating the stack. Trivial recipe: 1. Create any C program in /tmp/tst.c. Can be as simple as int main(void) { return 0; } 2. gcc -g -o tst tst.c 3. emacs -Q 4. C-x 3 (split window horizontally) 5. C-x C-f tst.c (open tst.c) 6. M-x gud-gdb, 'gdb --fullname /tmp/tst' (start up gud in the same window that's currently showing tst.c) 7. b main 8. r On my machine this switches to tst.c on top of the gud buffer, replacing gud in its window. With the attached patch this does not happen. This is similar, but not identical to bug http://debbugs.gnu.org/cgi/bugreport.cgi?bug=17675 The proposed fix in that bug does not handle the above recipe.