From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stephen Leake Newsgroups: gmane.emacs.devel Subject: Re: patch gud-gdb to respect other-frame-window? Date: Mon, 30 Jul 2018 01:56:26 -0500 Message-ID: <86in4xqkit.fsf@stephe-leake.org> References: <86muuaq7m8.fsf@stephe-leake.org> <83fu02q797.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1532933680 2404 195.159.176.226 (30 Jul 2018 06:54:40 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 30 Jul 2018 06:54:40 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (windows-nt) To: emacs-devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jul 30 08:54:36 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fk24h-0000VV-1X for ged-emacs-devel@m.gmane.org; Mon, 30 Jul 2018 08:54:35 +0200 Original-Received: from localhost ([::1]:50828 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fk26n-0002bA-Ma for ged-emacs-devel@m.gmane.org; Mon, 30 Jul 2018 02:56:45 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47287) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fk26d-0002b5-VY for emacs-devel@gnu.org; Mon, 30 Jul 2018 02:56:36 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fk26Z-0002Ob-4D for emacs-devel@gnu.org; Mon, 30 Jul 2018 02:56:36 -0400 Original-Received: from smtp97.iad3b.emailsrvr.com ([146.20.161.97]:36223) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fk26Y-0002NN-Uk for emacs-devel@gnu.org; Mon, 30 Jul 2018 02:56:31 -0400 Original-Received: from smtp13.relay.iad3b.emailsrvr.com (localhost [127.0.0.1]) by smtp13.relay.iad3b.emailsrvr.com (SMTP Server) with ESMTP id 2E56D6009B for ; Mon, 30 Jul 2018 02:56:29 -0400 (EDT) X-Auth-ID: board-president@tomahawk-creek-hoa.com Original-Received: by smtp13.relay.iad3b.emailsrvr.com (Authenticated sender: board-president-AT-tomahawk-creek-hoa.com) with ESMTPSA id EDD8560074 for ; Mon, 30 Jul 2018 02:56:28 -0400 (EDT) X-Sender-Id: board-president@tomahawk-creek-hoa.com Original-Received: from Takver4 (76-218-37-33.lightspeed.kscymo.sbcglobal.net [76.218.37.33]) (using TLSv1.2 with cipher AES256-GCM-SHA384) by 0.0.0.0:25 (trex/5.7.12); Mon, 30 Jul 2018 02:56:29 -0400 In-Reply-To: <83fu02q797.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 29 Jul 2018 20:30:44 +0300") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 146.20.161.97 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:227972 Archived-At: Eli Zaretskii writes: >> From: Stephen Leake >> Date: Sun, 29 Jul 2018 12:22:55 -0500 >> >> diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el >> index 6826674a94..1b5cf46231 100644 >> --- a/lisp/progmodes/gud.el >> +++ b/lisp/progmodes/gud.el >> @@ -2608,9 +2608,11 @@ gud-common-init >> (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))) >> + (if (featurep 'other-frame-window) >> + '(display-buffer-same-window) >> + '(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. >> >> A similar pattern can be used for other commands that do not currently >> respect other-frame-window. >> >> Ok to commit to master? > > Isn't there a more elegant way of doing this, without asking about a > feature explicitly? Never mind; I realized I can set 'display-buffer-overriding-action' to 'display-buffer-same-window in my ~/.emacs; that overrides this code, and still lets other-frame-window do its thing. So this patch, and others like it, it unecessary. I'll add this to the documentation in other-frame-window. -- -- Stephe