unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#20034: 25.0.50; [PATCH] gud never displays a source buffer over the gud window
@ 2015-03-08  1:59 Dima Kogan
  2015-03-08 10:03 ` martin rudalics
  0 siblings, 1 reply; 8+ messages in thread
From: Dima Kogan @ 2015-03-08  1:59 UTC (permalink / raw)
  To: 20034

[-- Attachment #1: Type: text/plain, Size: 1193 bytes --]

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.



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gud-never-displays-a-source-buffer-over-the-gud-wind.patch --]
[-- Type: text/x-diff, Size: 816 bytes --]

From d3b42eb74be145969dd829aeedcb7ceac629de03 Mon Sep 17 00:00:00 2001
From: Dima Kogan <dima@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


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* bug#20034: 25.0.50; [PATCH] gud never displays a source buffer over the gud window
  2015-03-08  1:59 bug#20034: 25.0.50; [PATCH] gud never displays a source buffer over the gud window Dima Kogan
@ 2015-03-08 10:03 ` martin rudalics
  2015-03-09  1:25   ` Dima Kogan
  0 siblings, 1 reply; 8+ messages in thread
From: martin rudalics @ 2015-03-08 10:03 UTC (permalink / raw)
  To: Dima Kogan, 20034

 > 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).

No.  `display-buffer' displays the buffer in the selected window just as
often as before the changes you mention.

 > 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.

Would your fix handle Bug#17675 as well?  And maybe some of the related
bugs in this area (see Bug#19901, for a recent example)?  There also was
a proposal to only "softly" dedicate some gud window to its buffer.  See
the thread entitled "Use of dedicated windows in gdb-mi.el".

martin





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#20034: 25.0.50; [PATCH] gud never displays a source buffer over the gud window
  2015-03-08 10:03 ` martin rudalics
@ 2015-03-09  1:25   ` Dima Kogan
  2015-03-09 10:37     ` martin rudalics
  0 siblings, 1 reply; 8+ messages in thread
From: Dima Kogan @ 2015-03-09  1:25 UTC (permalink / raw)
  To: martin rudalics; +Cc: 20034

[-- Attachment #1: Type: text/plain, Size: 1146 bytes --]

martin rudalics <rudalics@gmx.at> writes:

>  > 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.
>
> Would your fix handle Bug#17675 as well?  And maybe some of the related
> bugs in this area (see Bug#19901, for a recent example)?

Hi. The patch fixes 17676. 19901 is a slightly different problem, and
the attached patch fixes that as well.


> There also was a proposal to only "softly" dedicate some gud window to
> its buffer. See the thread entitled "Use of dedicated windows in
> gdb-mi.el".

I'm not concerned about gdb-mi here; just the old-style gud. I've seen
the new display-buffer behavior similarly affect the behavior of some
other things, like xcscope.el for instance (I'll handle that once this
change is OKed). I feel like the attached patch is the default behavior
I want most of the time, but this is probably different for each user.

Thanks



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gud-never-displays-a-source-buffer-over-the-gud-wind.patch --]
[-- Type: text/x-diff, Size: 816 bytes --]

From 41bc170051c5541d5379aed97a634ca3ed094682 Mon Sep 17 00:00:00 2001
From: Dima Kogan <dima@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 a12bdd9..f6dadeb 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


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* bug#20034: 25.0.50; [PATCH] gud never displays a source buffer over the gud window
  2015-03-09  1:25   ` Dima Kogan
@ 2015-03-09 10:37     ` martin rudalics
  2015-03-09 16:01       ` Dima Kogan
  0 siblings, 1 reply; 8+ messages in thread
From: martin rudalics @ 2015-03-09 10:37 UTC (permalink / raw)
  To: Dima Kogan; +Cc: 20034

 >> Would your fix handle Bug#17675 as well?  And maybe some of the related
 >> bugs in this area (see Bug#19901, for a recent example)?
 >
 > Hi. The patch fixes 17676.

17675, hopefully.

 > 19901 is a slightly different problem, and
 > the attached patch fixes that as well.

Maybe people who reported problems with their gud-/gdb interface could
try whether the patch fixes them.

martin





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#20034: 25.0.50; [PATCH] gud never displays a source buffer over the gud window
  2015-03-09 10:37     ` martin rudalics
@ 2015-03-09 16:01       ` Dima Kogan
  2015-03-10  8:09         ` martin rudalics
  0 siblings, 1 reply; 8+ messages in thread
From: Dima Kogan @ 2015-03-09 16:01 UTC (permalink / raw)
  To: martin rudalics; +Cc: 20034

[-- Attachment #1: Type: text/plain, Size: 339 bytes --]

In the last email I attached the older patch by mistake. Correct patch
attached this time. It fixes this, 17675 and 19901 I believe.


martin rudalics <rudalics@gmx.at> writes:

> Maybe people who reported problems with their gud-/gdb interface could
> try whether the patch fixes them.

I sent requests to the tracker of 17675 and 19901


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gud-never-displays-a-source-buffer-over-the-gud-wind.patch --]
[-- Type: text/x-diff, Size: 932 bytes --]

From ed24aed33bd27ddd66b7288fb3999eaa619a0c27 Mon Sep 17 00:00:00 2001
From: Dima Kogan <dima@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 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index a12bdd9..ea6f53c 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -2813,8 +2813,8 @@ 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))))
-	 (pos))
+			  (display-buffer buffer '(display-buffer-use-some-window (inhibit-same-window . t))))))
+         (pos))
     (when buffer
       (with-current-buffer buffer
 	(unless (or (verify-visited-file-modtime buffer) gud-keep-buffer)
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* bug#20034: 25.0.50; [PATCH] gud never displays a source buffer over the gud window
  2015-03-09 16:01       ` Dima Kogan
@ 2015-03-10  8:09         ` martin rudalics
  2015-03-16 19:32           ` Dima Kogan
  0 siblings, 1 reply; 8+ messages in thread
From: martin rudalics @ 2015-03-10  8:09 UTC (permalink / raw)
  To: Dima Kogan; +Cc: 20034

>> Maybe people who reported problems with their gud-/gdb interface could
>> try whether the patch fixes them.
>
> I sent requests to the tracker of 17675 and 19901

Thank you.

martin







^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#20034: 25.0.50; [PATCH] gud never displays a source buffer over the gud window
  2015-03-10  8:09         ` martin rudalics
@ 2015-03-16 19:32           ` Dima Kogan
  2015-03-17 10:25             ` martin rudalics
  0 siblings, 1 reply; 8+ messages in thread
From: Dima Kogan @ 2015-03-16 19:32 UTC (permalink / raw)
  To: martin rudalics; +Cc: 20034

martin rudalics <rudalics@gmx.at> writes:

>>> Maybe people who reported problems with their gud-/gdb interface could
>>> try whether the patch fixes them.
>>
>> I sent requests to the tracker of 17675 and 19901

Reporters of those bugs haven't replied for a week. I did test the
latest patch earlier, and it appeared to address both of those bugs as
well as mine. Do we need to keep waiting for those reporters before
taking the patch?

Thanks

dima





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#20034: 25.0.50; [PATCH] gud never displays a source buffer over the gud window
  2015-03-16 19:32           ` Dima Kogan
@ 2015-03-17 10:25             ` martin rudalics
  0 siblings, 0 replies; 8+ messages in thread
From: martin rudalics @ 2015-03-17 10:25 UTC (permalink / raw)
  To: Dima Kogan; +Cc: 20034

 > Reporters of those bugs haven't replied for a week. I did test the
 > latest patch earlier, and it appeared to address both of those bugs as
 > well as mine. Do we need to keep waiting for those reporters before
 > taking the patch?

No.  Please install your change and close the bugs (referencing the
commit).  If the patch doesn't work for them, people can always reopen
these bugs.

Thanks, martin





^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-03-17 10:25 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-08  1:59 bug#20034: 25.0.50; [PATCH] gud never displays a source buffer over the gud window Dima Kogan
2015-03-08 10:03 ` martin rudalics
2015-03-09  1:25   ` Dima Kogan
2015-03-09 10:37     ` martin rudalics
2015-03-09 16:01       ` Dima Kogan
2015-03-10  8:09         ` martin rudalics
2015-03-16 19:32           ` Dima Kogan
2015-03-17 10:25             ` martin rudalics

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).