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#30674: 27.0.50; flymake-mode should set next-error-function and (probably) next-error-last-buffer Date: Tue, 13 Mar 2018 02:43:56 +0200 Message-ID: <618839ea-9fcb-70c2-4152-b0b5d2327083@yandex.ru> References: <15327428-85fd-5b2e-1878-2b5b3b538375@yandex.ru> <87a7vkrelc.fsf@mail.linkov.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1520901799 26907 195.159.176.226 (13 Mar 2018 00:43:19 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 13 Mar 2018 00:43:19 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Thunderbird/59.0 Cc: 30674@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Mar 13 01:43:15 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 1evY26-0006uB-Vc for geb-bug-gnu-emacs@m.gmane.org; Tue, 13 Mar 2018 01:43:15 +0100 Original-Received: from localhost ([::1]:36371 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1evY49-0006dL-R4 for geb-bug-gnu-emacs@m.gmane.org; Mon, 12 Mar 2018 20:45:21 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33393) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1evY3v-0006Zs-Oo for bug-gnu-emacs@gnu.org; Mon, 12 Mar 2018 20:45:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1evY3q-0001t6-Rs for bug-gnu-emacs@gnu.org; Mon, 12 Mar 2018 20:45:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:49951) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1evY3q-0001su-Md for bug-gnu-emacs@gnu.org; Mon, 12 Mar 2018 20:45:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1evY3q-0000tP-5m for bug-gnu-emacs@gnu.org; Mon, 12 Mar 2018 20:45: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, 13 Mar 2018 00:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30674 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 30674-submit@debbugs.gnu.org id=B30674.15209018493332 (code B ref 30674); Tue, 13 Mar 2018 00:45:02 +0000 Original-Received: (at 30674) by debbugs.gnu.org; 13 Mar 2018 00:44:09 +0000 Original-Received: from localhost ([127.0.0.1]:57845 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1evY2y-0000rf-PP for submit@debbugs.gnu.org; Mon, 12 Mar 2018 20:44:09 -0400 Original-Received: from mail-wr0-f175.google.com ([209.85.128.175]:43893) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1evY2x-0000rI-D2 for 30674@debbugs.gnu.org; Mon, 12 Mar 2018 20:44:07 -0400 Original-Received: by mail-wr0-f175.google.com with SMTP id o1so6057203wro.10 for <30674@debbugs.gnu.org>; Mon, 12 Mar 2018 17:44:07 -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=idEAR41g1QLsDQStb3/kHHEeRrdYo9fbUxzUqENkrXM=; b=Pd0d8fw8Hnm/yz6WT4B7W/OtFsZDuK4qLNN+zPZ3m+YjHKYKsiVLS1nFxg7qK0zYXI kDAxIY+/p5jTFbWhJtyJ+6ykPbXPBoXZvSZX7dtjKMh0CqjO6+ufpOS3+jHeAZInG5/P C8pmyd9EKFp2Hd7RdAOjN29qgw+HWAaTsWJdDDyiVbvNyS0HEp0Cm63GrZmU32/J5in0 PSHtRHkJnZr2hdfLc79bhMGcXjFMGpUubxmMsL+NENlTky8Ug2OkusqL/PBmjFoFBqsK ZnjgwIXaX8HW47ySacASNlbdXRdsqkjln5urse5ECNipEhM4NrHLTHc7dG7d7+hKhGrd oqeQ== 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=idEAR41g1QLsDQStb3/kHHEeRrdYo9fbUxzUqENkrXM=; b=BNwmHVj2jGpGapFoIwNqXWzGQjJH8H0uC1rHZSUNil0Lsk1k546tADqAEChtDMLZGm Qsw9c82zGmrIm5jt9ax6MBEkyB//z3FXCo4QhFGn4EqtRQNhXHAQAjdrvMmU612JXReF /NvpvnJbIxqP3iS0qUE/5iWnwxXGgHAjRN/hq/9voJiRt6GWJV25UYDJJ+YxNyn9IRRU 4bRYyKYk9fRltWv/HtkBeg7D6D88NEq6Py+8gKgfxl+k8wU1h+WhJeoqXuUuf+jcExYo loybDeGxsRSoYWw/yMW7C97efyQuiS9bpbrKGN0YLqsqQ/GqC1+uOHIwF3IqLbYWAV6C 8D2w== X-Gm-Message-State: AElRT7H9qZZZVKek8WlFhgfBpsAVlkI1/Ugpiu30+DjgMN9Tb3KDV1kE MRPK3hi2IchRAqowaPGUhIZ0A5cY X-Google-Smtp-Source: AG47ELvxQrO3RnlmWNhe1Kvx7zscHh1BOnn9sXyZCBw92orZDfyzSPUgvE7Ze1wQX5BCeqt8dMpOIQ== X-Received: by 10.223.134.170 with SMTP id 39mr7346894wrx.221.1520901840883; Mon, 12 Mar 2018 17:44:00 -0700 (PDT) Original-Received: from [192.168.1.3] ([185.105.174.23]) by smtp.googlemail.com with ESMTPSA id y1sm7715623wrh.80.2018.03.12.17.43.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Mar 2018 17:43:59 -0700 (PDT) In-Reply-To: <87a7vkrelc.fsf@mail.linkov.net> 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:144168 Archived-At: On 3/7/18 12:33 AM, Juri Linkov wrote: > I think it would be a natural fit into the next-error framework. How to > solve conflicts with other sources of next-error is an open question. > For example, after running ‘occur’ on the flymake-mode enabled buffer > next-error should continue navigating ‘occur’ hits. Right. That creates tradeoffs, which in turn push against the flexibility of next-error-find-buffer-function: it's going to more than aesthetic choice now. So I wonder which particular scheme, or schemes, people actually prefer. Or which they'd understand more quickly, just by experimenting (that might be the best default). > I guess to cancel > such navigation is possible in at least three ways: doing window-quit > on the *Occur* buffer, For this, next-error-find-buffer-function should be set to #'next-error-buffer-on-selected-frame. Or will we have a separate predicate function for whether to use the "local" next-error-function? > or using next-error-select-buffer selecting > the current buffer (instead of the *Occur* buffer), That might be too tedious, having to do that for every buffer-with-local-errors you switch to and try to edit (and fix errors/warnings in). However, if we special-case the nil value of next-error-last-buffer, it might not be so tedious: you switch away from the last Occur/Grep/etc buffer with one invocation, and go on editing multiple files. This is where buffer-local (or window-local) values of next-error-last-buffer might bring undesirable behavior: if one of those multiple files was another navigation target from an Occur/Grep/etc navigation, or if we switch to a window that was the target (in the window-local case), the user will need another next-error-select-buffer invocation, and they won't know that until their next-error call brings them somewhere unexpected (and only winner-mode will help undo that). There can be other approaches, such as when there's no visible global-next-error-capable buffers, and the current one is next-error-capable, use it, as long as there are local errors in the given direction, and then switch over to the global navigation. > or re-running flymake > on the buffer. That might be annoying: it runs every time a buffer is saved (and even right after it's visited if flymake-start-on-flymake-mode is non-nil). But hey, it can also be a fine approach, as long as flymake-start-on-flymake-mode is nil. Recalling that the first idea is to only use a global navigation as long as its buffer is visible, let's imagine that it's also so in this case. Grep tries very hard to stay visible. So, we run Grep, jump from it to a source file, start editing. Flymake runs, shows some warnings. If the user fixes them all, maybe switch back to the global navigation automatically; if not, select Grep's window and manually navigate to the next error in the list using one of its "buttons" (which also sets next-error-last-buffer). And if the navigation buffer is not visible, the user can call next-error-select-buffer anyway. This can work well, as long as the user understands what's going on.