From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dima Kogan Newsgroups: gmane.emacs.bugs Subject: bug#20034: 25.0.50; [PATCH] gud never displays a source buffer over the gud window Date: Sat, 07 Mar 2015 17:59:01 -0800 Message-ID: <87sidgp7ve.fsf@secretsauce.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1425780025 17213 80.91.229.3 (8 Mar 2015 02:00:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 8 Mar 2015 02:00:25 +0000 (UTC) To: 20034@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Mar 08 03:00:13 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YUQVn-0007wa-Mv for geb-bug-gnu-emacs@m.gmane.org; Sun, 08 Mar 2015 03:00:12 +0100 Original-Received: from localhost ([::1]:37231 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YUQVm-0005oo-O3 for geb-bug-gnu-emacs@m.gmane.org; Sat, 07 Mar 2015 21:00:10 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33072) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YUQVi-0005l3-Ny for bug-gnu-emacs@gnu.org; Sat, 07 Mar 2015 21:00:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YUQVf-0007bR-He for bug-gnu-emacs@gnu.org; Sat, 07 Mar 2015 21:00:06 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:40413) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YUQVf-0007bD-ER for bug-gnu-emacs@gnu.org; Sat, 07 Mar 2015 21:00:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YUQVf-0007zF-4L for bug-gnu-emacs@gnu.org; Sat, 07 Mar 2015 21:00:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dima Kogan Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 08 Mar 2015 02:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 20034 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.142577995930613 (code B ref -1); Sun, 08 Mar 2015 02:00:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 8 Mar 2015 01:59:19 +0000 Original-Received: from localhost ([127.0.0.1]:38981 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YUQUw-0007xe-Iq for submit@debbugs.gnu.org; Sat, 07 Mar 2015 20:59:19 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:59458) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YUQUu-0007xR-Cq for submit@debbugs.gnu.org; Sat, 07 Mar 2015 20:59:17 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YUQUn-0007Pp-Pc for submit@debbugs.gnu.org; Sat, 07 Mar 2015 20:59:11 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:49666) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YUQUn-0007Pk-MC for submit@debbugs.gnu.org; Sat, 07 Mar 2015 20:59:09 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:32936) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YUQUm-0005hr-Lq for bug-gnu-emacs@gnu.org; Sat, 07 Mar 2015 20:59:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YUQUj-0007P3-Fw for bug-gnu-emacs@gnu.org; Sat, 07 Mar 2015 20:59:08 -0500 Original-Received: from out2-smtp.messagingengine.com ([66.111.4.26]:58815) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YUQUj-0007Oj-7h for bug-gnu-emacs@gnu.org; Sat, 07 Mar 2015 20:59:05 -0500 Original-Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id BE67C203C8 for ; Sat, 7 Mar 2015 20:59:00 -0500 (EST) Original-Received: from frontend2 ([10.202.2.161]) by compute3.internal (MEProxy); Sat, 07 Mar 2015 20:59:02 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=secretsauce.net; h=x-sasl-enc:from:to:subject:date:message-id:mime-version :content-type; s=mesmtp; bh=jhqXbsGXYX6fQ8+gyeMqOuurzvk=; b=n/Sw oyfSCgWqXQdNGCeCYXHewCI7R+InKwg8j5/8eb8P3/ej7UtmA1cmtXoKcJ7Qos/R zhB2WheSTDpl77qISsPJXDpmCn71Cy/eo4l1U07g+4TsEdRXV8yGQjK3l8ScdXAj 9Bywq9QrtUeSUNQ03blo/4RkEU/sbk3I9s1OOKU= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=x-sasl-enc:from:to:subject:date :message-id:mime-version:content-type; s=smtpout; bh=jhqXbsGXYX6 fQ8+gyeMqOuurzvk=; b=fCAAsS304Ecjv5dnzeWtKASzsRz9bUpnWiVyf6vY/Fh Bty4Skn15SaHAD3CzFjg7b66ro6f44YO52K4jtJUNRKbRS2d62LJ2kdycnaiizxP IsHbkCZUPWD++g7C59rwveuwDkF3j1FwKJAytWmQDCeek/LNJsDMXavTf9hdeWjg = X-Sasl-enc: n+ghNRUCPy3rhgZheQKB04BLyBx0+H3PHv0rsw67Ql6E 1425779941 Original-Received: from shorty.local (unknown [69.204.115.227]) by mail.messagingengine.com (Postfix) with ESMTPA id E3FF9680085 for ; Sat, 7 Mar 2015 20:59:01 -0500 (EST) Original-Received: from localhost ([::1] helo=shorty) by shorty.local with esmtp (Exim 4.84) (envelope-from ) id 1YUQUf-0007lE-Br for bug-gnu-emacs@gnu.org; Sat, 07 Mar 2015 17:59:01 -0800 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:100249 Archived-At: --=-=-= Content-Type: text/plain 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. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-gud-never-displays-a-source-buffer-over-the-gud-wind.patch >From d3b42eb74be145969dd829aeedcb7ceac629de03 Mon Sep 17 00:00:00 2001 From: Dima Kogan 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 --=-=-=--