From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: pillule Newsgroups: gmane.emacs.bugs Subject: bug#47414: 26.1; [PATCH] compilation-goto-locus does not handle right display-buffer Date: Fri, 26 Mar 2021 16:57:41 +0000 Message-ID: <87im5d26pm.fsf@host.localdomain> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6319"; mail-complaints-to="usenet@ciao.gmane.io" To: 47414@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Mar 26 18:28:11 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lPqFm-0001V7-Ap for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 26 Mar 2021 18:28:10 +0100 Original-Received: from localhost ([::1]:52992 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lPqFl-0003nv-Cq for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 26 Mar 2021 13:28:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42472) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lPqFe-0003nZ-Iu for bug-gnu-emacs@gnu.org; Fri, 26 Mar 2021 13:28:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59038) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lPqFe-0000PD-8E for bug-gnu-emacs@gnu.org; Fri, 26 Mar 2021 13:28:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lPqFe-0001jk-3V for bug-gnu-emacs@gnu.org; Fri, 26 Mar 2021 13:28:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: pillule Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 26 Mar 2021 17:28:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 47414 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.16167796336605 (code B ref -1); Fri, 26 Mar 2021 17:28:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 26 Mar 2021 17:27:13 +0000 Original-Received: from localhost ([127.0.0.1]:42351 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lPqEp-0001iR-Iv for submit@debbugs.gnu.org; Fri, 26 Mar 2021 13:27:12 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:55240) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lPpma-0000yz-Nk for submit@debbugs.gnu.org; Fri, 26 Mar 2021 12:58:01 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36442) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lPpma-0007ao-Fr for bug-gnu-emacs@gnu.org; Fri, 26 Mar 2021 12:58:00 -0400 Original-Received: from mx1.riseup.net ([198.252.153.129]:33426) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lPpmX-0000QO-Q6 for bug-gnu-emacs@gnu.org; Fri, 26 Mar 2021 12:57:59 -0400 Original-Received: from fews2.riseup.net (fews2-pn.riseup.net [10.0.1.84]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client CN "*.riseup.net", Issuer "Sectigo RSA Domain Validation Secure Server CA" (not verified)) by mx1.riseup.net (Postfix) with ESMTPS id 4F6SpD4wfKzDq9V for ; Fri, 26 Mar 2021 09:57:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1616777876; bh=SFb62ASRZyrswV6SveZ114gkJXlIXoYAiWuWt5mgOvI=; h=From:To:Subject:Date:From; b=Arbv7RUD7uteUeT9XGATuW5r6o7o+xY20gZsiNr1wXp5tSTxEQgPqMDTJLK4z0g6b ZXIbJ/PPGJ+fsR1dgtRf9AhWXE+WutCBkovs1KYL0yViX7edLXsyurgk9EC9+B8b87 nwqoXUYN6sQDXzR/z0Yz/sDuKDTN42zGVi4zV5D4= X-Riseup-User-ID: 574EA20ABBDB698B679AC4F3F5DCCBCB6101377961AF6B3A39F618B50131FC38 Original-Received: from host (unknown [66.230.230.230]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by fews2.riseup.net (Postfix) with ESMTPSA id 4F6SpB5nCLz1yBc for ; Fri, 26 Mar 2021 09:57:54 -0700 (PDT) Received-SPF: pass client-ip=198.252.153.129; envelope-from=pillule@riseup.net; helo=mx1.riseup.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Fri, 26 Mar 2021 13:27:10 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:203050 Archived-At: --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=compile.el.patch Content-Description: patch for compilation-goto-locus diff -u --label /usr/share/emacs/28.0.50/lisp/progmodes/compile.el.gz --label /home/user/src/patches/compile.el.gz /tmp/jka-comekeJLn /tmp/jka-com8N603U --- /usr/share/emacs/28.0.50/lisp/progmodes/compile.el.gz +++ /home/user/src/patches/compile.el.gz @@ -2845,8 +2845,8 @@ (when (and (not pre-existing) w) (compilation-set-window-height w)) - (if from-compilation-buffer - ;; If the compilation buffer window was selected, + (if (or from-compilation-buffer (eq w (selected-window))) + ;; If the compilation buffer window is selected, ;; keep the compilation buffer in this window; ;; display the source in another window. (let ((pop-up-windows t)) Diff finished. Fri Mar 26 17:24:14 2021 --=-=-= Content-Type: text/plain; format=flowed Hello, I noticed that 1. if you apply a custom rule to display-buffer-alist for grep, occur or compilation buffers that automatically select its window when the buffer if displayed ; 2. call next-error or previous-error from an error-buffer, 3. compilation-goto-locus will call display-buffer for the compilation buffer 4. the selected-window have now changed, we are in the compilation window, and nonetheless compilation-goto-locus will call switch-to-buffer in this window instead of pop-to-buffer. This patch is a trivial check aknowledge if we are in the compilation window before choosing what display function to use, so users can customize the behavior of compilation windows via display-buffer-alist without breaking the error navigation functionnalities. In GNU Emacs 26.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.5) of 2021-01-31, modified by Debian built on x86-csail-01 Windowing system distributor 'The X.Org Foundation', version 11.0.12004000 System Description: Debian GNU/Linux 10 (buster) Recent messages: Checking 70 files in /usr/share/emacs/26.1/lisp/erc... Checking 34 files in /usr/share/emacs/26.1/lisp/emulation... Checking 176 files in /usr/share/emacs/26.1/lisp/emacs-lisp... Checking 24 files in /usr/share/emacs/26.1/lisp/cedet... Checking 57 files in /usr/share/emacs/26.1/lisp/calendar... Checking 87 files in /usr/share/emacs/26.1/lisp/calc... Checking 105 files in /usr/share/emacs/26.1/lisp/obsolete... Checking for load-path shadows...done Message modified; kill anyway? (y or n) y