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: Thu, 30 Apr 2020 00:40:35 +0200 Message-ID: <66f63b16-307a-919c-1d25-60ff63f92ae6@ieee.org> References: <53913bd9-2bdc-0f70-f7b4-744283e0512f@ieee.org> <87d07rmb6j.fsf@mail.linkov.net> <87zhau5bfw.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="120327"; 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 Thu Apr 30 00:41:12 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 1jTvOC-000VBw-75 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 30 Apr 2020 00:41:12 +0200 Original-Received: from localhost ([::1]:36726 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jTvOB-00030X-8L for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 29 Apr 2020 18:41:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38938) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jTvO3-00030H-Lm for bug-gnu-emacs@gnu.org; Wed, 29 Apr 2020 18:41:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jTvO2-0003kd-Ud for bug-gnu-emacs@gnu.org; Wed, 29 Apr 2020 18:41:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33302) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jTvO2-0003it-I8 for bug-gnu-emacs@gnu.org; Wed, 29 Apr 2020 18:41:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jTvO2-00017o-DV for bug-gnu-emacs@gnu.org; Wed, 29 Apr 2020 18:41: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 22:41: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.15882000464295 (code B ref 40919); Wed, 29 Apr 2020 22:41:02 +0000 Original-Received: (at 40919) by debbugs.gnu.org; 29 Apr 2020 22:40:46 +0000 Original-Received: from localhost ([127.0.0.1]:44848 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jTvNl-00017D-Nl for submit@debbugs.gnu.org; Wed, 29 Apr 2020 18:40:46 -0400 Original-Received: from mail-wr1-f41.google.com ([209.85.221.41]:33422) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jTvNj-00016z-MB for 40919@debbugs.gnu.org; Wed, 29 Apr 2020 18:40:44 -0400 Original-Received: by mail-wr1-f41.google.com with SMTP id s10so4546519wrr.0 for <40919@debbugs.gnu.org>; Wed, 29 Apr 2020 15:40:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ieee.org; s=google; h=subject:to:cc:references:from:autocrypt:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=Eq5vBIhLhYFFeV3qdCgqe8ne2Wmh9uEX9UqiSdAh/9c=; b=Q35ATVAJq5qGke+rk799L1Qr4nJPwkfjZ60kuUn4TQ4dLTpHDvLP4bKGRV4QloTb56 iviR6BtSRG3vQn9ah5hedp4I0L9mBc933b11fWeYqB/wavpzoPSdeAPBF7VGQw3yVLOT L6V/MqXRY2N00pHlpmVO66KxsBV4q6tX/1hv0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-transfer-encoding:content-language; bh=Eq5vBIhLhYFFeV3qdCgqe8ne2Wmh9uEX9UqiSdAh/9c=; b=U3cCCQ/ynhOR8UhSlYf7+WU4sMvQyClnk2iEjz54VXNyQn/p7Bx1hCdr881PYLxo2/ Nv2Q/G18eeaziRGoO1zOFRRmzx/KqM7K5RJlUy3WQqUY+1bH6Z6DwH/oB0ZD59YLLiBk 695jquRS5v36HUYgoBi2IL1wYMA5P4G6MRTcyPU8DvCTubT94xOgo9OgdgQlODwaPnn1 ubZe7J5dlLL+VsMaHsIUfQ4P1OFCPzdzzzeDfA8eeiHdxWB8Qozjfhxv3BtkHtZD9dcm EVZVOfGuq2W8nnmSvOQpx07LCXLjqlQ8PnoDwYKK8SC1MpeiACGJr7usZ2V1ivaJZL/K NjEw== X-Gm-Message-State: AGi0PuZlA7vnamZcqKRLe3utHGJe4jGD1gyFz7UIC17v4/F6lUq03njE nln40oOdagVnJ0n5hYPytd6nUhanDAA= X-Google-Smtp-Source: APiQypLWWcoWfDaq9riMKjX4oKP5z/XPQB9rONgj9jFDHWmlDVDoiMD60VHnFXUlguo4kUx2sGnhPw== X-Received: by 2002:adf:e711:: with SMTP id c17mr216908wrm.334.1588200037383; Wed, 29 Apr 2020 15:40:37 -0700 (PDT) Original-Received: from [192.168.1.104] ([85.232.212.161]) by smtp.gmail.com with ESMTPSA id g25sm9548194wmh.24.2020.04.29.15.40.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 29 Apr 2020 15:40:36 -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: <87zhau5bfw.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:179361 Archived-At: On 29/04/2020 22:38, Juri Linkov wrote: >> I think the error is in the implementation. > Then I see no way other than for next-error-select-buffer to say: > "the current buffer was visited from next-error-last-buffer". > Yes, this is a lie, but a white lie with good intentions, so > next-error-find-buffer will trust this misinformation and leave > the buffer alone. Is this patch morally acceptable? > > diff --git a/lisp/simple.el b/lisp/simple.el > index b5ba05426f..b5f148b7d5 100644 > --- a/lisp/simple.el > +++ b/lisp/simple.el > @@ -379,7 +379,8 @@ next-error-select-buffer > (list (get-buffer > (read-buffer "Select next-error buffer: " nil nil > (lambda (b) (next-error-buffer-p (cdr b))))))) > - (setq next-error-last-buffer buffer)) > + (setq next-error-last-buffer buffer) > + (setq next-error-buffer buffer)) > > (defalias 'goto-next-locus 'next-error) > (defalias 'next-match 'next-error) > I think this would work for next-error-select-buffer. Then to fix the other issue about new compilations, compilation-start can be modified to use next-error-select-buffer. That way the change in compilation-start is morally unambiguous :) diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 455f181f50..41e77007c6 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -1910,7 +1910,7 @@ compilation-start      (goto-char (point-max))))        ;; Make it so the next C-x ` will use this buffer. -    (setq next-error-last-buffer outbuf))) +    (next-error-select-buffer outbuf)))    (defun compilation-set-window-height (window)    "Set the height of WINDOW according to `compilation-window-height'."