From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Trevor Spiteri Newsgroups: gmane.emacs.bugs Subject: bug#40919: 27.0.91; next-error-select-buffer does not always behave as documented Date: Wed, 29 Apr 2020 02:13:22 +0200 Message-ID: References: <53913bd9-2bdc-0f70-f7b4-744283e0512f@ieee.org> <87d07rmb6j.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="32174"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 Cc: 40919@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Apr 29 02:17:39 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jTaPy-0008GZ-Ip for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 29 Apr 2020 02:17:38 +0200 Original-Received: from localhost ([::1]:54824 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jTaPx-0006Zc-IP for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 28 Apr 2020 20:17:37 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38224) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jTaOm-0006NL-8r for bug-gnu-emacs@gnu.org; Tue, 28 Apr 2020 20:17:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jTaMU-0001EQ-Py for bug-gnu-emacs@gnu.org; Tue, 28 Apr 2020 20:16:24 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58634) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jTaMU-0001EL-Dh for bug-gnu-emacs@gnu.org; Tue, 28 Apr 2020 20:14:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jTaMU-00011o-8k for bug-gnu-emacs@gnu.org; Tue, 28 Apr 2020 20:14:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Trevor Spiteri Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 29 Apr 2020 00:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40919 X-GNU-PR-Package: emacs Original-Received: via spool by 40919-submit@debbugs.gnu.org id=B40919.15881192133902 (code B ref 40919); Wed, 29 Apr 2020 00:14:02 +0000 Original-Received: (at 40919) by debbugs.gnu.org; 29 Apr 2020 00:13:33 +0000 Original-Received: from localhost ([127.0.0.1]:41947 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jTaM0-00010r-O6 for submit@debbugs.gnu.org; Tue, 28 Apr 2020 20:13:33 -0400 Original-Received: from mail-wr1-f52.google.com ([209.85.221.52]:34606) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jTaLy-00010f-MO for 40919@debbugs.gnu.org; Tue, 28 Apr 2020 20:13:31 -0400 Original-Received: by mail-wr1-f52.google.com with SMTP id j1so439273wrt.1 for <40919@debbugs.gnu.org>; Tue, 28 Apr 2020 17:13:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ieee.org; s=google; h=to:cc:references:from:autocrypt:subject:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=2fxCjzE2urFjMNNh8giXqJF3eUpKSTeoaUvcUTtuL6E=; b=biQ+ZOB3+51uD23aRQlghHV4w3QuAl82ZKLwubT84kGapOVcO6GZQwmLkE6B5l4Krk Ok+fN8UciVrebJrT9vhaJZhfOis7mczUzDup/0o8d/1MZ8clmE5OC1pVd9CDyiOEBVRq ExAaumJVOyfbV1DCGtgMTZsDhHt8axKpTEJhc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:references:from:autocrypt:subject :message-id:date:user-agent:mime-version:in-reply-to :content-transfer-encoding:content-language; bh=2fxCjzE2urFjMNNh8giXqJF3eUpKSTeoaUvcUTtuL6E=; b=TCwCLZNCubvYldDwquXgXzM41EkIy1mCaW0XDddsIJsJatt6aeJXQIbw1wXI7kQgAE ykA4fJZrMjIUg/YM7tEEaTxTq8CFXpq3My+1lfbntshms2EDwUq1cZHVjAJDODa5Kgl9 CUeW2Dim8DyDQ7u/yW3msrqk5mYEqJpjJ1ATVhPc3gfsgoVbB/7qb28GOb6rEAK+xb/2 Au9EuweCmJ7BW0XFHlltU8tfAeqZWSD/BAI/dQLQYxbWTx1C9U5ipl2bwVVoIIHPEHWj 9635ZbGxT+i7iIPwXBv9q0Tw3L7xoPpOqAfPrL747YfFd9x1nFgS+FaIPTdilXsSJxlr AKhQ== X-Gm-Message-State: AGi0PuYDwVB6Uoj1eEHY5m86CFMxcVZXvaBenFRWwpWk5OHDfqxpc5rc LpnN/6JdoXvUlv9hTlZlfzYB9Z/sHQc7ww== X-Google-Smtp-Source: APiQypIpwTQ94xyCdqTxDCOYy+/jltahGjB67SL9FehB7wd9twO0qhxp9hNgq8XHZUTYOq3q0RLhUQ== X-Received: by 2002:a5d:6887:: with SMTP id h7mr35877329wru.365.1588119204312; Tue, 28 Apr 2020 17:13:24 -0700 (PDT) Original-Received: from [192.168.1.104] ([85.232.212.161]) by smtp.gmail.com with ESMTPSA id p190sm5444143wmp.38.2020.04.28.17.13.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 28 Apr 2020 17:13:23 -0700 (PDT) Autocrypt: addr=tspiteri@ieee.org; prefer-encrypt=mutual; keydata= mQINBFcxvj8BEADgjJ0VPjUDQHNOO8+zw4txojpVRUbw3q4o3EaxHBSn3Nzl8qtp+OOzDe6n M4YQK6/ocBSJc+w3rFQzjmHxcCaJW8XJTaV27ot9r/wS6ucz34xFM6PJp2iIVT5SI5h1htIv ywJ9JlC+BiVN8X3QAvBJeQEGx48HNv+oYR/6mLvh/3cuyABBcmmsMBmG6ACpLJ6COhOXkl4r XB+gmVvt72HWy+zYyF/m1aMxQFakrAVWP3uslReCPR66bKiS9Hm77IyGGE5LOhccda0nFy5I kHqibst646jTQAu1EcpQZrnRXq7JOEOToM3Aj8GRI+T9+rKr1rf2RA7zdm0D9reUV+iPOEaI jFa4XT43BddM8mlV5pSQft2qoB3cTNHo1uJz8cQWTlmwcJiUEPVi5+5EtuDz/ovxSRIepNl4 zEHO5NNIqt2AZNLr+49UwWSmNi5NVfDxjXswCmFfUBFev14nxVz7jaPWUtD+htzkIUAoidlM a7tkeboP6j1UonX/ELwRTnWctpich8GCVaV+AaTViNpiJFw/wR3jN3rjE2AN5dgSgLEroInS M+U3a21c0pGarETx/JlpteZjWxvMMtdDr0MeLqVvSMxErvBB+0JhqkK9uAoAj8hCe6mweDao qIyUwPewbDD9Gcgxzd2ljbPcw1kOP8hFEjn+WWOcYY+rVu6+jQARAQABtCJUcmV2b3IgU3Bp dGVyaSA8dHNwaXRlcmlAaWVlZS5vcmc+iQJXBBMBCABBAhsjBQsJCAcCBhUICQoLAgQWAgMB Ah4BAheAAhkBFiEEG4 In-Reply-To: <87d07rmb6j.fsf@mail.linkov.net> Content-Language: en-US X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Received-From: 209.51.188.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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:179262 Archived-At: >> The next-error-select-buffer documentation states that =E2=80=9Cthe se= lected >> buffer becomes the source of locations for the subsequent invocation o= f >> =E2=80=98next-error=E2=80=99 or =E2=80=98previous-error=E2=80=99.=E2=80= =9D However, it is not the case for the >> following: >> >> 1. Go in a fresh next-error capable buffer (not *grep*). >> 2. Grep for something. >> 3. M-x next-error-select-buffer *grep* >> 4. M-x next-error >> >> The buffer of 1 (not *grep*) is the source of locations instead of >> the expected *grep*. >> >> This is because although next-error-select-buffer sets the variable >> next-error-last-buffer, it is not used in this case: When next-error >> calls next-error-find-buffer, next-error-buffer has no buffer-local >> value yet, so condition 2. in next-error-find-buffer (that >> next-error-buffer has no buffer-local value and the current buffer is = a >> next-error capable buffer) is true, and the function never even checks= >> next-error-last-buffer. > Thanks for the report. Do you think the problem is in implementation, > or only in documentation? IOW, do you think its behavior is correct, > but the documentation should be fixed to describe more clearly what > next-error was intended to do in this situation? I think the error is in the implementation. In fact I added a later comment to the bug report. > And I just realized, this is also a regression from Emacs 26 if step 3 > is skipped, as step 2 itself also sets next-error-last-buffer . As a use case, let's say I'm in a buffer that has next-error capabilities because of say flycheck, and I grep or compile; I want to start going through the new errors immediately. That is why compilation-start finishes=C2=A0 with (setq next-error-last-buffer outbuf= ) and that's how Emacs 26 works (without step 3 as next-error-select-buffer is new). In Emacs 27 not only does that break, but even using the new function has no effect.