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#28864: 25.3.50; next-error-no-select does select Date: Tue, 31 Oct 2017 23:56:30 +0200 Organization: LINKOV.NET Message-ID: <87o9onc775.fsf@localhost> References: <87bml72qck.fsf@gmail.com> <4045abe7-1acb-314b-b9ac-72b62db30570@yandex.ru> <87sheh270d.fsf@gmail.com> <6f3b7c2c-31af-8eb2-8f13-a9ba17d3d8e6@yandex.ru> <87mv4m5lok.fsf@gmail.com> <87d15h5f97.fsf@gmail.com> <874lqreyj5.fsf@localhost> <7f67cb1c-062f-44fa-ba8e-9ac0cab220a3@yandex.ru> <87po9del14.fsf@localhost> <5c524170-7ba7-8279-41b5-b4286c2980f0@yandex.ru> <87tvyomh37.fsf@localhost> <7821c28e-3bf5-0bab-46ab-23f3a02566a8@yandex.ru> <87po97vuoh.fsf@localhost> <87778f88-a6e6-06d5-f5ad-8a46d73144cc@yandex.ru> <87efplk4vu.fsf@localhost> <87tvyg72z1.fsf@localhost> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1509487109 992 195.159.176.226 (31 Oct 2017 21:58:29 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 31 Oct 2017 21:58:29 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (x86_64-pc-linux-gnu) Cc: 28864@debbugs.gnu.org, Noam Postavsky , Tino Calancha To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Oct 31 22:58:23 2017 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 1e9eY7-0007UO-1B for geb-bug-gnu-emacs@m.gmane.org; Tue, 31 Oct 2017 22:58:19 +0100 Original-Received: from localhost ([::1]:47494 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e9eY7-0007LY-TV for geb-bug-gnu-emacs@m.gmane.org; Tue, 31 Oct 2017 17:58:19 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45384) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e9eXu-0007LT-Ue for bug-gnu-emacs@gnu.org; Tue, 31 Oct 2017 17:58:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e9eXq-0008Oe-Qc for bug-gnu-emacs@gnu.org; Tue, 31 Oct 2017 17:58:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:36010) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e9eXq-0008O9-MH for bug-gnu-emacs@gnu.org; Tue, 31 Oct 2017 17:58:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1e9eXq-0008NB-9G for bug-gnu-emacs@gnu.org; Tue, 31 Oct 2017 17:58:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 31 Oct 2017 21:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28864 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 28864-submit@debbugs.gnu.org id=B28864.150948705132146 (code B ref 28864); Tue, 31 Oct 2017 21:58:02 +0000 Original-Received: (at 28864) by debbugs.gnu.org; 31 Oct 2017 21:57:31 +0000 Original-Received: from localhost ([127.0.0.1]:44691 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e9eXL-0008MQ-8d for submit@debbugs.gnu.org; Tue, 31 Oct 2017 17:57:31 -0400 Original-Received: from sub3.mail.dreamhost.com ([69.163.253.7]:43069 helo=homiemail-a22.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e9eXJ-0008MG-6n for 28864@debbugs.gnu.org; Tue, 31 Oct 2017 17:57:29 -0400 Original-Received: from homiemail-a22.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a22.g.dreamhost.com (Postfix) with ESMTP id 52049114067; Tue, 31 Oct 2017 14:57:27 -0700 (PDT) Original-Received: from localhost.linkov.net (m77-218-46-155.cust.tele2.ee [77.218.46.155]) (Authenticated sender: jurta@jurta.org) by homiemail-a22.g.dreamhost.com (Postfix) with ESMTPA id D137F114066; Tue, 31 Oct 2017 14:57:25 -0700 (PDT) In-Reply-To: (Dmitry Gutov's message of "Tue, 31 Oct 2017 02:02:05 +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:139293 Archived-At: >> We could also add an alternative function based on window-local values. >> At least, when I tried this code, it works as expected: > > Cool. Not something I've ever asked for, but could be helpful for > some people. I'm thinking about adding 3 customizable options for next-error-find-buffer-function: 1. buffer-local - new default 2. window-local - useful for one window per each navigation buffer 3. frame-local - old implicit default now separated into its own function > In general, next-error can jump between windows, so window-local is not > a good fit for my mental model. It's bad when next-error unpredictably jumps between windows. I hope we could find a way to fix this erratic behavior. >>> So we ignore the next-error-last-buffer change during a call to >>> next-error-last-function, but not in any other circumstances? Like visiting >>> a ChangeLog file manually. Maybe that's okay... >> >> Oh, sorry, there was a typo: it should be (with-current-buffer next-error-buffer >> Fixed in the next version of the patch below. > > Thanks. But if we already ignore the change to next-error-last-buffer > during a call to next-error-function, that should fix the currently > discussed bug, right? Maybe even the similar behavior with next-error, too? > > Do we need the buffer-local-ity changes to next-error-last-buffer for that? > Because if we do, that's okay, let's commit it and everything, but > otherwise I'd rather wait and look for a more elegant approach (for other > issues aside from this one). In the last previous patch, next-error visits next-error-find-buffer, calls next-error-function that possibly navigates to another buffer, then sets both global and buffer-local of next-error-last-buffer. This seems quite logical. And it works in all my tests. >> + (message "Showing %s error from %s" >> + (cond (reset "first") >> + ((< (prefix-numeric-value arg) 0) "previous") >> + (t "next")) > > Can arg be 0? Do we have a word for that? We might use it below, too. We could use "current" for 0. Could you also find a value for "last"? >> +(defun next-error-internal () >> + "Visit the source code corresponding to the `next-error' message at point." >> + (let ((next-error-buffer (current-buffer))) >> ;; we know here that next-error-function is a valid symbol we can funcall >> - (with-current-buffer next-error-last-buffer >> - (funcall next-error-function (prefix-numeric-value arg) reset) >> + (with-current-buffer next-error-buffer >> + (funcall next-error-function 0 nil) >> + ;; next-error-function might change the value of >> + ;; next-error-last-buffer, so set it later >> + (setq next-error-last-buffer next-error-buffer) >> + (setq-default next-error-last-buffer next-error-last-buffer) >> (when next-error-recenter >> (recenter next-error-recenter)) >> + (message "Showing another error from %s" next-error-last-buffer) > > Is it really "another"? Or maybe it's "current", "last" or "closest" error? Maybe just "Showing error from %s"? Or simply "Error from %s". Then we could simplify the above messages as well: "%s error from %s" for e.g. "Next error from %s", "Previous error from %s", ...