GNU bug report logs - #20034
25.0.50; [PATCH] gud never displays a source buffer over the gud window

Previous Next

Package: emacs;

Reported by: Dima Kogan <dima <at> secretsauce.net>

Date: Sun, 8 Mar 2015 02:00:02 UTC

Severity: normal

Tags: patch

Found in version 25.0.50

Done: Dima Kogan <dima <at> secretsauce.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Dima Kogan <dima <at> secretsauce.net>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#20034: closed (25.0.50; [PATCH] gud never displays a source
 buffer over the gud window)
Date: Wed, 18 Mar 2015 07:43:04 +0000
[Message part 1 (text/plain, inline)]
Your message dated Wed, 18 Mar 2015 00:41:42 -0700
with message-id <87h9ti3g64.fsf <at> secretsauce.net>
and subject line Fixed
has caused the debbugs.gnu.org bug report #20034,
regarding 25.0.50; [PATCH] gud never displays a source buffer over the gud window
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
20034: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=20034
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Dima Kogan <dima <at> secretsauce.net>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.0.50;
 [PATCH] gud never displays a source buffer over the gud window
Date: Sat, 07 Mar 2015 17:59:01 -0800
[Message part 3 (text/plain, inline)]
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.


[0001-gud-never-displays-a-source-buffer-over-the-gud-wind.patch (text/x-diff, inline)]
From d3b42eb74be145969dd829aeedcb7ceac629de03 Mon Sep 17 00:00:00 2001
From: Dima Kogan <dima <at> secretsauce.net>
Date: Sat, 7 Mar 2015 17:37:20 -0800
Subject: [PATCH] gud never displays a source buffer over the gud window

---
 lisp/progmodes/gud.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index 42c5b20..ac830e7 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -2813,7 +2813,7 @@ Obeying it means displaying in another window the specified file and line."
 	    (gud-find-file true-file)))
 	 (window (and buffer
 		      (or (get-buffer-window buffer)
-			  (display-buffer buffer))))
+			  (display-buffer buffer '(nil (inhibit-same-window . t))))))
 	 (pos))
     (when buffer
       (with-current-buffer buffer
-- 
2.1.4

[Message part 5 (message/rfc822, inline)]
From: Dima Kogan <dima <at> secretsauce.net>
To: 17675-done <at> debbugs.gnu.org, 19901-done <at> debbugs.gnu.org,
 20034-done <at> debbugs.gnu.org
Subject: Fixed
Date: Wed, 18 Mar 2015 00:41:42 -0700
Fixed with this commit:

http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=fd93edbb1cabfdf0c732dbb0c6892a515b406a65


This bug report was last modified 10 years and 72 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.