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, 07 Mar 2018 23:11:49 +0200 Organization: LINKOV.NET Message-ID: <87po4fy4iy.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> <87zi3s7r16.fsf@mail.linkov.net> <87vae8u8h2.fsf@mail.linkov.net> <2098d801-3877-d404-f66e-debefc0916b6@yandex.ru> 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 1520458517 4742 195.159.176.226 (7 Mar 2018 21:35:17 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 7 Mar 2018 21:35: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 Mar 07 22:35: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 1etgiN-0000GP-2R for geb-bug-gnu-emacs@m.gmane.org; Wed, 07 Mar 2018 22:35:11 +0100 Original-Received: from localhost ([::1]:35730 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etgkP-0001uj-M3 for geb-bug-gnu-emacs@m.gmane.org; Wed, 07 Mar 2018 16:37:17 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35073) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etgkE-0001tO-MB for bug-gnu-emacs@gnu.org; Wed, 07 Mar 2018 16:37:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1etgkB-0006Gs-4F for bug-gnu-emacs@gnu.org; Wed, 07 Mar 2018 16:37:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:42045) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1etgkB-0006Go-0V for bug-gnu-emacs@gnu.org; Wed, 07 Mar 2018 16:37:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1etgkA-00049R-P6 for bug-gnu-emacs@gnu.org; Wed, 07 Mar 2018 16:37: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, 07 Mar 2018 21:37: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.152045857615884 (code B ref 20489); Wed, 07 Mar 2018 21:37:02 +0000 Original-Received: (at 20489) by debbugs.gnu.org; 7 Mar 2018 21:36:16 +0000 Original-Received: from localhost ([127.0.0.1]:49941 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1etgjQ-000481-5j for submit@debbugs.gnu.org; Wed, 07 Mar 2018 16:36:16 -0500 Original-Received: from sub3.mail.dreamhost.com ([69.163.253.7]:44430 helo=homiemail-a18.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1etgjO-00047n-PF for 20489@debbugs.gnu.org; Wed, 07 Mar 2018 16:36:15 -0500 Original-Received: from homiemail-a18.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a18.g.dreamhost.com (Postfix) with ESMTP id 4242A258068; Wed, 7 Mar 2018 13:36:14 -0800 (PST) Original-Received: from localhost.linkov.net (m91-129-110-147.cust.tele2.ee [91.129.110.147]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by homiemail-a18.g.dreamhost.com (Postfix) with ESMTPSA id 6AAC1258066; Wed, 7 Mar 2018 13:36:13 -0800 (PST) In-Reply-To: <2098d801-3877-d404-f66e-debefc0916b6@yandex.ru> (Dmitry Gutov's message of "Wed, 7 Mar 2018 16:11:25 +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:143997 Archived-At: >>>> Please clarify what do you have in mind. In what place in code such >>>> function could be called? >>> >>> Any place that contains >>> >>> (setq next-error-last-buffer buffer) >>> (setq-default next-error-last-buffer buffer) >>> >>> now, would instead call >>> >>> (funcall next-error-save-last-buffer-function target-buf target-wi= n) >> >> But isn't it possible to do this in next-error-hook? >> It's called by run-hooks in the same place in next-error. > > For one thing, next-error-select-buffer doesn't call next-error-hook. > > And there are other such places (e.g. like you were saying > xref--xref-buffer-mode should set next-error-last-buffer similarly). 3. And hooks are intended only for user customization. > Aside from that, why would we want to obscure this piece of logic behin= d > a hook? Instead of a hook I think it would be fine to define an =E2=80=9Cadvisabl= e=E2=80=9D function like Stefan asked to do for next-error-find-buffer-function to be able to put advices on it.