From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Tino Calancha Newsgroups: gmane.emacs.bugs Subject: bug#28864: 25.3.50; next-error-no-select does select Date: Sat, 21 Oct 2017 12:52:36 +0900 Message-ID: <87d15h5f97.fsf@gmail.com> 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> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1508557989 19013 195.159.176.226 (21 Oct 2017 03:53:09 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 21 Oct 2017 03:53:09 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 28864@debbugs.gnu.org, Noam Postavsky , Juri Linkov To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Oct 21 05:53:05 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 1e5kqO-0004IN-Kj for geb-bug-gnu-emacs@m.gmane.org; Sat, 21 Oct 2017 05:53:04 +0200 Original-Received: from localhost ([::1]:56522 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5kqW-00050C-6B for geb-bug-gnu-emacs@m.gmane.org; Fri, 20 Oct 2017 23:53:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46761) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5kqQ-000507-6f for bug-gnu-emacs@gnu.org; Fri, 20 Oct 2017 23:53:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e5kqM-0008Gx-Fr for bug-gnu-emacs@gnu.org; Fri, 20 Oct 2017 23:53:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:44277) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e5kqM-0008Gt-BI for bug-gnu-emacs@gnu.org; Fri, 20 Oct 2017 23:53:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1e5kqL-00074g-W7 for bug-gnu-emacs@gnu.org; Fri, 20 Oct 2017 23:53:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Tino Calancha Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 21 Oct 2017 03:53:01 +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.150855797227178 (code B ref 28864); Sat, 21 Oct 2017 03:53:01 +0000 Original-Received: (at 28864) by debbugs.gnu.org; 21 Oct 2017 03:52:52 +0000 Original-Received: from localhost ([127.0.0.1]:52958 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e5kqB-00074I-Nd for submit@debbugs.gnu.org; Fri, 20 Oct 2017 23:52:51 -0400 Original-Received: from mail-pg0-f68.google.com ([74.125.83.68]:49568) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e5kqA-000740-7t for 28864@debbugs.gnu.org; Fri, 20 Oct 2017 23:52:51 -0400 Original-Received: by mail-pg0-f68.google.com with SMTP id g6so8042016pgn.6 for <28864@debbugs.gnu.org>; Fri, 20 Oct 2017 20:52:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=LRYJZvFIIOt+XuG8GouDjzBLScSB8k8yuOrGx1wTLdQ=; b=Uevd80B17f835hnb6G1URIZCkQpxA059JMB0PN98WmII+jPEsRiSYWe+Dj9bNV8/tI Ac/GkZ1vTuzVgu+ZqC+hk0VtGLJ6TZi3Q1soV+FWnqWKeN4d7WxIawtRb7Hg+NfxPLUp yDyZ8KqYsyofsjExSYSR8cGSB3RY9S2b5CtwidfhSgDkgtCg0fhdvHgGETvAf3ZfmCpw jg1EcQAaDGwy3vS0dkM/ogxRoNFoysgkUJeUqqkHh+k5YWrTDJPDwa6Tyci3x31Jw/HQ oUWBVUcmMbHCSH6mJKlNEK2LAPs7JRv+qs+NGd2dG3WvXScy3ijUWFI5VORAJ1Vs3fPP sDPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=LRYJZvFIIOt+XuG8GouDjzBLScSB8k8yuOrGx1wTLdQ=; b=s2arUrt3Qkbnyb9AKuh4HcSO1FSUNcCg4RM+GItpmNQQ2shiOEOkbQyoC7l/q3D6ol vIEYcn+0iqWaXE0R+l1CVd+mDmu/7NZG6ODVTkIZoJkd6G4KfZxZsSK3idd/YOGLFxmt c/iNIIgIKrROGfhnAhgCh9oGNKPS6jv6U5TQrPDqfDe30h9RHLdrau0rJJCYKs1gZ6/n wQ5I+0mt6IJ5npunDkcXGM9urrDv7um8VOIT6uQQkNIZcknvHbZcUskjPs+My3GqaHeD 6aDkFUdqo/xGV/HD3kZ2uYbwQK+qVn34FJyTMlrG6gUlDtktxWqVMybVVO45gv4gt2i8 Qyjw== X-Gm-Message-State: AMCzsaUN7O6wgjiPQ9vb1rGl5EUwJNtGRk6TnBhZL6wZoVJazDz5r9Di +f+KQKM1h9ibaiTkybZj47s= X-Google-Smtp-Source: ABhQp+Sa4LgpB+3OysmcCRqcb6kscEu8lnOS7d16F95AxhfRzBTF0gR+KmwP94Lix5Q1UUt7gzsRRw== X-Received: by 10.98.166.86 with SMTP id t83mr6660780pfe.345.1508557964314; Fri, 20 Oct 2017 20:52:44 -0700 (PDT) Original-Received: from calancha-pc (203.191.218.133.dy.bbexcite.jp. [133.218.191.203]) by smtp.gmail.com with ESMTPSA id b10sm4311706pfk.20.2017.10.20.20.52.41 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2017 20:52:43 -0700 (PDT) In-Reply-To: (Dmitry Gutov's message of "Sat, 21 Oct 2017 00:49:11 +0300") 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:138793 Archived-At: Dmitry Gutov writes: > On 10/20/17 10:21 AM, Tino Calancha wrote: > >>> It kind of improves something, but the behavior is still wonky and >>> counter-intuitive. Here are my steps: >> I think I understand it now: >> * change-log-mode sets 'next-error-last-buffer' to the current buffer (the >> ChangeLog source). >> >> We can restrict to not do that when we are calling 'next-error-no-select. >> I think some people don't like to use this-command in such >> situations; alternatively, we could use `change-log-mode-hook' but the patch >> below is shorter and explicit. > > It's really a hack though, right? Maybe no major modes should set > next-error-last-buffer by itself, no matter the current command. That sounds better. > I'd like to know what Juri thinks about this. In case Juri think that change-log-mode should keep seting next-error-last-buffer for other reasons we could just bind next-error-last-buffer: --8<-----------------------------cut here---------------start------------->8--- commit c7b2ecd19714055b89ce348c07bae1c88a3fdc0a Author: Tino Calancha Date: Sat Oct 21 12:49:30 2017 +0900 Dont select the source with next-error-no-select * lisp/simple.el (next-error): Bind `next-error-last-buffer' before call next-error-function (Bug#28864). diff --git a/lisp/simple.el b/lisp/simple.el index 5ef511ce0a..b321d324e7 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -281,7 +281,9 @@ next-error (when (setq next-error-last-buffer (next-error-find-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) + ;; next-error-function should not change `next-error-last-buffer' Bug#28864. + (let ((next-error-last-buffer next-error-last-buffer)) + (funcall next-error-function (prefix-numeric-value arg) reset)) (when next-error-recenter (recenter next-error-recenter)) (run-hooks 'next-error-hook)))) --8<-----------------------------cut here---------------end--------------->8---