From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!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: Sun, 24 Jan 2016 23:10:30 +0200 Organization: LINKOV.NET Message-ID: <87oacaiszd.fsf@mail.linkov.net> References: <86wq0q602w.fsf@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1453669939 3205 80.91.229.3 (24 Jan 2016 21:12:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 24 Jan 2016 21:12:19 +0000 (UTC) Cc: 20489@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jan 24 22:12:11 2016 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 1aNRxC-0006sf-Bp for geb-bug-gnu-emacs@m.gmane.org; Sun, 24 Jan 2016 22:12:10 +0100 Original-Received: from localhost ([::1]:33417 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aNRxB-0008Rs-JC for geb-bug-gnu-emacs@m.gmane.org; Sun, 24 Jan 2016 16:12:09 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57790) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aNRx7-0008QK-OE for bug-gnu-emacs@gnu.org; Sun, 24 Jan 2016 16:12:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aNRx4-00017m-IT for bug-gnu-emacs@gnu.org; Sun, 24 Jan 2016 16:12:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:46972) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aNRx4-00017i-Ed for bug-gnu-emacs@gnu.org; Sun, 24 Jan 2016 16:12:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aNRx4-0001L7-8B for bug-gnu-emacs@gnu.org; Sun, 24 Jan 2016 16:12: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: Sun, 24 Jan 2016 21:12: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.14536698885089 (code B ref 20489); Sun, 24 Jan 2016 21:12:02 +0000 Original-Received: (at 20489) by debbugs.gnu.org; 24 Jan 2016 21:11:28 +0000 Original-Received: from localhost ([127.0.0.1]:35189 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aNRwW-0001K1-Bh for submit@debbugs.gnu.org; Sun, 24 Jan 2016 16:11:28 -0500 Original-Received: from sub3.mail.dreamhost.com ([69.163.253.7]:39997 helo=homiemail-a17.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aNRwU-0001Js-EL for 20489@debbugs.gnu.org; Sun, 24 Jan 2016 16:11:26 -0500 Original-Received: from homiemail-a17.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a17.g.dreamhost.com (Postfix) with ESMTP id BDA682B206A; Sun, 24 Jan 2016 13:11:24 -0800 (PST) Original-Received: from localhost.linkov.net (62.65.217.179.cable.starman.ee [62.65.217.179]) (Authenticated sender: jurta@jurta.org) by homiemail-a17.g.dreamhost.com (Postfix) with ESMTPA id EF00C2B2065; Sun, 24 Jan 2016 13:11:23 -0800 (PST) In-Reply-To: <86wq0q602w.fsf@yandex.ru> (Dmitry Gutov's message of "Sun, 03 May 2015 02:17:43 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (x86_64-pc-linux-gnu) 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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:111940 Archived-At: > - If a buffer visible in the current frame has next-error-function set, > *and* if there's only one such buffer, use it. > > - If next-error-last-buffer has it set, use that. > > Othewise, if both of the above fail, > > - If the current buffer has next-error-function set, use it. > > Apparently, this peculiarity has been there for 10.5 years now, > introduced in 03e75c7e0 by Juri Linkov. But there's no bug reference, nor > a link to a discussion. Sorry, I missed this bug report and regret that it caused you to revert xref's next-error-function integration. The link to the discussion is here: http://lists.gnu.org/archive/html/emacs-devel/2004-05/msg00614.html where you can see the case that we need to support. Now that we have window-local variables, it's possible to support this case in a proper way. Instead of checking if a buffer visible in the current frame, we should check the window-local value of next-error-last-buffer. Thus invoking next-error in the window with the source buffer will continue navigation using the right value of next-error-last-buffer that navigated to its previous occurrence. Thus, the steps will be the following: 1. If window-local next-error-last-buffer is an acceptable buffer, use that. 2. If next-error-last-buffer is an acceptable buffer, use that. 3. If the current buffer is acceptable, choose it. 4. Look for any acceptable buffer. 5. Use the current buffer as a last resort if it qualifies, even despite AVOID-CURRENT. 6. Give up.