From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#28864: 25.3.50; next-error-no-select does select Date: Tue, 31 Oct 2017 02:02:05 +0200 Message-ID: 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; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1509408205 32210 195.159.176.226 (31 Oct 2017 00:03:25 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 31 Oct 2017 00:03:25 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:56.0) Gecko/20100101 Thunderbird/56.0 Cc: 28864@debbugs.gnu.org, Noam Postavsky , Tino Calancha To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Oct 31 01:03:21 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 1e9K1O-00070t-IT for geb-bug-gnu-emacs@m.gmane.org; Tue, 31 Oct 2017 01:03:10 +0100 Original-Received: from localhost ([::1]:43110 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e9K1W-0005Iz-0T for geb-bug-gnu-emacs@m.gmane.org; Mon, 30 Oct 2017 20:03:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37231) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e9K1K-0005Io-0d for bug-gnu-emacs@gnu.org; Mon, 30 Oct 2017 20:03:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e9K1G-0001Iy-RA for bug-gnu-emacs@gnu.org; Mon, 30 Oct 2017 20:03:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:34251) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e9K1G-0001Ir-Mj for bug-gnu-emacs@gnu.org; Mon, 30 Oct 2017 20:03:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1e9K1G-0006Hp-DL for bug-gnu-emacs@gnu.org; Mon, 30 Oct 2017 20:03:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 31 Oct 2017 00:03: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.150940813924110 (code B ref 28864); Tue, 31 Oct 2017 00:03:02 +0000 Original-Received: (at 28864) by debbugs.gnu.org; 31 Oct 2017 00:02:19 +0000 Original-Received: from localhost ([127.0.0.1]:42932 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e9K0Z-0006Go-9v for submit@debbugs.gnu.org; Mon, 30 Oct 2017 20:02:19 -0400 Original-Received: from mail-wm0-f44.google.com ([74.125.82.44]:53722) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e9K0U-0006GK-6D for 28864@debbugs.gnu.org; Mon, 30 Oct 2017 20:02:14 -0400 Original-Received: by mail-wm0-f44.google.com with SMTP id r196so19716906wmf.2 for <28864@debbugs.gnu.org>; Mon, 30 Oct 2017 17:02:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=eUMskYRKwrlGCN+LR52LCHRdesP8S5ewcl06xUWem4k=; b=A05XMzqCaZpLWpx3JLyCMsOxi0clq38dfpiOZX+5fDUSjWHrtfdCjzuAP1AsnK5QgM QIXK3wYNfnM+v5MXFAmVoq5IcTqq2xx9ffGP7zwd6HprYGjB5AXpjeND3VglglxlUyQ6 zb67PUag+0rJKK1ngKQgCOgP6UwbGXQH8eNvPVJHjhv7Uzgo4GWj399eD33JVJ4rVwwm ojARtCjEwb/k5Ca8NNaHBG9YJYEBOfhEICO8sPHIlyEl8wVkKGGd53XuYXmUPBY8RG5e g8HHBtLKGbgnVLwWZtLELVbB8EFJLZE4W6yOvHAFChdovyF5fN8e2fyvCGKASf3h76V2 n/xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=eUMskYRKwrlGCN+LR52LCHRdesP8S5ewcl06xUWem4k=; b=Jd6SzkIKJOxqKz1KNn5NzehXiBOhwrc7qzFPeFF6Ih6r3JuKme3ZMYtSx3kLZwcoru IcjREQNDdQ4J/csVReZs2+Xkq4YRYaF8u+PtrER3mJ7XqZDncjBc7kQGHaMQcG5+LC9l PqVHfW23cL3TKfGQs/cxd/WsAIybiq9Bzh9CuUk/n3YsS6G7xCB8TzrgqID6Fi6a9Aqb xqzMFFyEUGYB8m0kqXvatDfenuM9fMDVgkS5K0kL/BWK9qP4JTIgAybBfbezN0uvOBrh M0fOEbCp4hEZGTVuIzMzCXtW+RcNxZkEKFWdbsD6jL64zq7JKqme3RDHMLG4NtNbffaG SezQ== X-Gm-Message-State: AMCzsaVSbvw9TiMhCwRzzvaO0PyxngJkqoT2XnzBFGAldJH6o/Tx7RYa CM8QSaTQ3pf6m9MWuZuhxp0= X-Google-Smtp-Source: ABhQp+TD+HKEINIs3cTbLhwndP1se7M6iXGj59O07UrEQUQg2pRj2qpnyYtitTT5IMT2gmG0QFxQTQ== X-Received: by 10.28.35.9 with SMTP id j9mr253674wmj.109.1509408128456; Mon, 30 Oct 2017 17:02:08 -0700 (PDT) Original-Received: from [192.168.1.3] ([185.105.174.193]) by smtp.googlemail.com with ESMTPSA id j125sm980505wmf.24.2017.10.30.17.02.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 Oct 2017 17:02:07 -0700 (PDT) In-Reply-To: <87tvyg72z1.fsf@localhost> Content-Language: en-US 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:139231 Archived-At: On 10/30/17 11:14 PM, Juri Linkov wrote: >>> We need the global value as well to get the last next-error buffer >>> when there is no buffer-local value yet in the current buffer. >> >> Doesn't sound very elegant: we accumulate hidden state as the time passes, >> and the user calls 'next-error' with compilations, grep, and so on. But >> this is better than nothing, of course. >> >> Does it also mean that the effect of next-error-select-buffer will also be >> buffer-local? > > Yes, next-error-select-buffer sets both buffer-local and global values, > exactly like in next-error. Then the aforementioned concern stands for it as well. > 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. In general, next-error can jump between windows, so window-local is not a good fit for my mental model. >> 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). > + (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. > +(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?