From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#32607: 27.0.50; pop-to-buffer in next-error-no-select Date: Mon, 03 Sep 2018 01:43:02 +0300 Organization: LINKOV.NET Message-ID: <87efebjzbd.fsf@mail.linkov.net> References: <87a7p0alxv.fsf@mail.linkov.net> <5B8B8DCE.4070704@gmx.at> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1535928894 29155 195.159.176.226 (2 Sep 2018 22:54:54 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 2 Sep 2018 22:54:54 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) Cc: 32607@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Sep 03 00:54:50 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1fwbGb-0007R9-Ne for geb-bug-gnu-emacs@m.gmane.org; Mon, 03 Sep 2018 00:54:50 +0200 Original-Received: from localhost ([::1]:42712 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fwbIi-0007iz-2s for geb-bug-gnu-emacs@m.gmane.org; Sun, 02 Sep 2018 18:57:00 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:49147) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fwbIW-0007YR-N3 for bug-gnu-emacs@gnu.org; Sun, 02 Sep 2018 18:56:51 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fwbBz-0001c1-9C for bug-gnu-emacs@gnu.org; Sun, 02 Sep 2018 18:50:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:38434) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fwbBz-0001bv-4c for bug-gnu-emacs@gnu.org; Sun, 02 Sep 2018 18:50:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fwbBz-0003by-16 for bug-gnu-emacs@gnu.org; Sun, 02 Sep 2018 18:50:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 02 Sep 2018 22:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32607 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 32607-submit@debbugs.gnu.org id=B32607.153592859513843 (code B ref 32607); Sun, 02 Sep 2018 22:50:02 +0000 Original-Received: (at 32607) by debbugs.gnu.org; 2 Sep 2018 22:49:55 +0000 Original-Received: from localhost ([127.0.0.1]:43449 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fwbBr-0003bD-BA for submit@debbugs.gnu.org; Sun, 02 Sep 2018 18:49:55 -0400 Original-Received: from pop.dreamhost.com ([64.90.62.162]:36902 helo=pdx1-sub0-mail-a9.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fwbBq-0003b6-Nl for 32607@debbugs.gnu.org; Sun, 02 Sep 2018 18:49:54 -0400 Original-Received: from pdx1-sub0-mail-a9.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a9.g.dreamhost.com (Postfix) with ESMTP id 3A0947E09C; Sun, 2 Sep 2018 15:49:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=eXe6isMBEv8S4iiB+B37N2Mn4nU=; b= EhHY++NT6g9P44IOs948ZIZF2dWj7BsLSGrY/X7wpItUPNglav75nh19e/tari9i wNRI/1dfOE5Awt0TLcFb4m2HdBCMSLewHJC5Z2GwDBZAh1hcWSQ6/Moji/DUaTH1 PTRcYcNGIkSKEI7yu/19O6RegwSOHZS9alasXwwnYFY= Original-Received: from localhost.linkov.net (m91-129-101-104.cust.tele2.ee [91.129.101.104]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a9.g.dreamhost.com (Postfix) with ESMTPSA id 8FD767E9E0; Sun, 2 Sep 2018 15:49:52 -0700 (PDT) In-Reply-To: <5B8B8DCE.4070704@gmx.at> (martin rudalics's message of "Sun, 02 Sep 2018 09:14:22 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:149979 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable >> Suppose we have such customization: >> >> (setq display-buffer-alist '(("\\`\\*grep\\*\\'" display-buffer-sam= e-window))) >> >> Now after running grep with a non-empty output in =E2=80=98emacs -Q=E2= =80=99, >> typing =E2=80=98C-o=E2=80=99 (compilation-display-error) will display = two identical >> buffers instead of displaying the buffer with the found grep hit. >> >> The problem is with pop-to-buffer in next-error-no-select. >> I wonder what is an idiomatic way to ensure a buffer is already >> displayed in some window, to not display the same buffer >> in other window? > > I'm not quite sure I understand: Is there a reason you did not supply > 'display-buffer-reuse-window' in the above customization? Because it's an idiomatic way to tell the Emacs window manager to display the *grep* buffer in the same window (an old way to do the same was using same-window-buffer-names and same-window-regexps) when manually running M-x grep. But it fails when using C-o from the already displayed *grep*. I think next-error-no-select should override the user setting with display-buffer-overriding-action because the purpose of pop-to-buffer in next-error-no-select is to ensure the *grep* buffer is displayed somewher= e: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=next-error-no-select.1.patch diff --git a/lisp/simple.el b/lisp/simple.el index 0ccf2f1d22..df7d86a835 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -385,7 +385,8 @@ next-error-no-select (interactive "p") (let ((next-error-highlight next-error-highlight-no-select)) (next-error n)) - (pop-to-buffer next-error-last-buffer)) + (let ((display-buffer-overriding-action '(display-buffer-reuse-window))) + (pop-to-buffer next-error-last-buffer))) (defun previous-error-no-select (&optional n) "Move point to the previous error in the `next-error' buffer and highlight match. --=-=-=--