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#20489: 25.0.50; next-error-find-buffer chooses non-current buffer without good reason Date: Wed, 28 Feb 2018 23:25:02 +0200 Organization: LINKOV.NET Message-ID: <87efl46c41.fsf@mail.linkov.net> References: <86wq0q602w.fsf@yandex.ru> <877ev36pmr.fsf@mail.linkov.net> <87sha1nbjy.fsf@mail.linkov.net> <23fd061a-9b83-742a-6083-6d2f090b8f22@yandex.ru> <81d36dbe-f563-187a-ec16-df4b051ae204@yandex.ru> <87efl6smxb.fsf@mail.linkov.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1519854257 20791 195.159.176.226 (28 Feb 2018 21:44:17 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 28 Feb 2018 21:44:17 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) Cc: 20489@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Feb 28 22:44:13 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 1er9WH-0004x0-Cz for geb-bug-gnu-emacs@m.gmane.org; Wed, 28 Feb 2018 22:44:13 +0100 Original-Received: from localhost ([::1]:47192 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1er9YJ-0003uX-Rp for geb-bug-gnu-emacs@m.gmane.org; Wed, 28 Feb 2018 16:46:19 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52991) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1er9Y7-0003tv-QX for bug-gnu-emacs@gnu.org; Wed, 28 Feb 2018 16:46:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1er9Y3-0007It-2W for bug-gnu-emacs@gnu.org; Wed, 28 Feb 2018 16:46:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:58284) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1er9Y2-0007IM-PD for bug-gnu-emacs@gnu.org; Wed, 28 Feb 2018 16:46:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1er9Y2-0007Gm-F5 for bug-gnu-emacs@gnu.org; Wed, 28 Feb 2018 16:46:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 28 Feb 2018 21:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20489 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 20489-submit@debbugs.gnu.org id=B20489.151985434227896 (code B ref 20489); Wed, 28 Feb 2018 21:46:02 +0000 Original-Received: (at 20489) by debbugs.gnu.org; 28 Feb 2018 21:45:42 +0000 Original-Received: from localhost ([127.0.0.1]:37944 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1er9Xh-0007Fr-EF for submit@debbugs.gnu.org; Wed, 28 Feb 2018 16:45:41 -0500 Original-Received: from sub3.mail.dreamhost.com ([69.163.253.7]:38336 helo=homiemail-a15.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1er9Xd-0007Fg-QZ for 20489@debbugs.gnu.org; Wed, 28 Feb 2018 16:45:38 -0500 Original-Received: from homiemail-a15.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a15.g.dreamhost.com (Postfix) with ESMTP id 488E076C06B; Wed, 28 Feb 2018 13:45:37 -0800 (PST) Original-Received: from localhost.linkov.net (m91-129-98-215.cust.tele2.ee [91.129.98.215]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by homiemail-a15.g.dreamhost.com (Postfix) with ESMTPSA id 6B66F76C065; Wed, 28 Feb 2018 13:45:36 -0800 (PST) In-Reply-To: (Dmitry Gutov's message of "Wed, 28 Feb 2018 04:13:54 +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:143768 Archived-At: > This way, someone would also be able to implement window-local navigati= on > relationship instead of buffer-local (you've mentioned this option befo= re). In addition to code sent in the previous message that should select the r= ight next-error capable buffer from the navigated buffer (e.g. on typing =E2=80= =98next-error=E2=80=99), for window-local navigation we also need to select the last used window (= e.g. typing RET on the list of matches), so all navigation will be in the same= window. (defun display-buffer-in-next-error-last-window (buffer alist) "Return a window used to display the last next-error buffer." (let* ((window (car (delq nil (mapcar (lambda (w) (when (and (local-variable-p 'next-error-la= st-buffer (window-buffer= w)) (eq (current-buffer) (buffer-local-value 'next-error-last-buffer (window-buffer w)))) w)) (window-list-1 nil 'nomini)))))) (when (window-live-p window) window (prog1 (window--display-buffer buffer window 'reuse alist) (unless (cdr (assq 'inhibit-switch-frame alist)) (window--maybe-raise-frame (window-frame window))))))) (push '("\\`\\*\\(compilation\\|grep\\|Occur\\)\\*\\'" display-buffer-in-next-error-last-window (inhibit-same-window . t)) display-buffer-from-alist) But this requires a feature that is not yet implemented, namely a customization like =E2=80=98display-buffer-from-alist=E2=80=99 to match= the source buffer name (that was the current buffer before navigation) instead of the target buffer (the buffer to display) like =E2=80=98display-buffer= -alist=E2=80=99 currently specifies.