From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#30646: 27.0.50; Occur next-error and recentering bug Date: Wed, 28 Feb 2018 23:06:37 +0200 Organization: LINKOV.NET Message-ID: <87po4o963m.fsf@mail.linkov.net> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1519854292 32132 195.159.176.226 (28 Feb 2018 21:44:52 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 28 Feb 2018 21:44:52 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) Cc: 30646@debbugs.gnu.org To: p.stephani2@gmail.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Feb 28 22:44:48 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 1er9Wp-0007vq-JV for geb-bug-gnu-emacs@m.gmane.org; Wed, 28 Feb 2018 22:44:47 +0100 Original-Received: from localhost ([::1]:47197 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1er9Ys-0004Ju-6m for geb-bug-gnu-emacs@m.gmane.org; Wed, 28 Feb 2018 16:46:54 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52988) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1er9Y7-0003tu-Nj for bug-gnu-emacs@gnu.org; Wed, 28 Feb 2018 16:46:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1er9Y4-0007Kb-6s for bug-gnu-emacs@gnu.org; Wed, 28 Feb 2018 16:46:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:58286) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1er9Y4-0007KC-15 for bug-gnu-emacs@gnu.org; Wed, 28 Feb 2018 16:46:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1er9Y3-0007HD-NA for bug-gnu-emacs@gnu.org; Wed, 28 Feb 2018 16:46:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 28 Feb 2018 21:46:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30646 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 30646-submit@debbugs.gnu.org id=B30646.151985433327859 (code B ref 30646); Wed, 28 Feb 2018 21:46:03 +0000 Original-Received: (at 30646) by debbugs.gnu.org; 28 Feb 2018 21:45:33 +0000 Original-Received: from localhost ([127.0.0.1]:37938 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1er9XY-0007FH-QN for submit@debbugs.gnu.org; Wed, 28 Feb 2018 16:45:32 -0500 Original-Received: from sub3.mail.dreamhost.com ([69.163.253.7]:38328 helo=homiemail-a15.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1er9XX-0007F9-5h for 30646@debbugs.gnu.org; Wed, 28 Feb 2018 16:45:31 -0500 Original-Received: from homiemail-a15.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a15.g.dreamhost.com (Postfix) with ESMTP id 128EE76C069; Wed, 28 Feb 2018 13:45:30 -0800 (PST) Original-Received: from localhost.linkov.net (m91-129-98-215.cust.tele2.ee [91.129.98.215]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by homiemail-a15.g.dreamhost.com (Postfix) with ESMTPSA id 3077676C065; Wed, 28 Feb 2018 13:45:28 -0800 (PST) In-Reply-To: (p.'s message of "Wed, 28 Feb 2018 12:51:45 +0100") 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:143770 Archived-At: > M-x set-variable RET next-error-recenter RET (4) RET > M-x occur, use something that gives results (e.g. ';;' in the scratch > buffer) > M-g M-n > > This signals an error > next-error: =E2=80=98recenter=E2=80=99ing a window that does not displa= y current-buffer. > > Stack trace is > > Debugger entered--Lisp error: (error "=E2=80=98recenter=E2=80=99ing a w= indow that does not > display current-buffer.") > recenter((4)) > next-error(nil) > funcall-interactively(next-error nil) > call-interactively(next-error nil nil) > command-execute(next-error) I don't know why =E2=80=98recenter=E2=80=99 doesn't support a non-selecte= d window, but moving the =E2=80=98recenter=E2=80=99 call outside of =E2=80=98with-curre= nt-buffer=E2=80=99 seems to do the right thing. Incidentally, we are discussing a related issue in bug#20489, that might bring a better fix than this: diff --git a/lisp/simple.el b/lisp/simple.el index b7ad6eb..9b1720c 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -282,20 +282,20 @@ 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 fu= ncall (with-current-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)))) + (funcall next-error-function (prefix-numeric-value arg) reset)) + (when next-error-recenter + (recenter next-error-recenter)) + (run-hooks 'next-error-hook))) =20 (defun next-error-internal () "Visit the source code corresponding to the `next-error' message at po= int." (setq next-error-last-buffer (current-buffer)) ;; we know here that next-error-function is a valid symbol we can func= all (with-current-buffer next-error-last-buffer - (funcall next-error-function 0 nil) - (when next-error-recenter - (recenter next-error-recenter)) - (run-hooks 'next-error-hook))) + (funcall next-error-function 0 nil)) + (when next-error-recenter + (recenter next-error-recenter)) + (run-hooks 'next-error-hook)) =20 (defalias 'goto-next-locus 'next-error) (defalias 'next-match 'next-error)