From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs Subject: bug#37856: 27.0.50; 'next-error' advised with 'recenter' signals error when run from "*grep*" buffer Date: Mon, 21 Oct 2019 22:11:50 +0200 Message-ID: References: <83lftd28wt.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="27291"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 37856@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Oct 21 22:13:15 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iMe3E-0006uu-9H for geb-bug-gnu-emacs@m.gmane.org; Mon, 21 Oct 2019 22:13:12 +0200 Original-Received: from localhost ([::1]:47482 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMe3B-0002Nf-IJ for geb-bug-gnu-emacs@m.gmane.org; Mon, 21 Oct 2019 16:13:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37756) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMe35-0002MB-FI for bug-gnu-emacs@gnu.org; Mon, 21 Oct 2019 16:13:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iMe34-0000h2-Cw for bug-gnu-emacs@gnu.org; Mon, 21 Oct 2019 16:13:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49070) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iMe34-0000gy-9S for bug-gnu-emacs@gnu.org; Mon, 21 Oct 2019 16:13:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iMe34-0006Ca-25 for bug-gnu-emacs@gnu.org; Mon, 21 Oct 2019 16:13:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 21 Oct 2019 20:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 37856 X-GNU-PR-Package: emacs Original-Received: via spool by 37856-submit@debbugs.gnu.org id=B37856.157168872923777 (code B ref 37856); Mon, 21 Oct 2019 20:13:02 +0000 Original-Received: (at 37856) by debbugs.gnu.org; 21 Oct 2019 20:12:09 +0000 Original-Received: from localhost ([127.0.0.1]:57890 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iMe2D-0006BR-Ab for submit@debbugs.gnu.org; Mon, 21 Oct 2019 16:12:09 -0400 Original-Received: from mail-pf1-f181.google.com ([209.85.210.181]:44041) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iMe2B-0006BA-Pt for 37856@debbugs.gnu.org; Mon, 21 Oct 2019 16:12:08 -0400 Original-Received: by mail-pf1-f181.google.com with SMTP id q21so9085337pfn.11 for <37856@debbugs.gnu.org>; Mon, 21 Oct 2019 13:12:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=Ga9kQdfgj0vOMf16qgrZwjRgNs5ZRBJNPjb3zxJQ5/Y=; b=VfTCgjfeLU2QdSLdeGyKh+Yc7bJ0aZHUXuwJ6Z5LrsDx226F3pudOFCAj4GXy5/GSp PEKF98C6gvxq05ZJTiYehKd0ov43F4GtncReuVLDowGvb6EvNnXGYqPnhbaSkx0/IjZh Qtenzdpxtfn7vAViQ0Smd27+sWDE8P1hHKs5tFGoBLEp+xWd4zeshNkAVTkDCHhrWpPa rCGlMZVNhzVjwUA8moEAA8Zs1Z4ABydFHWI5gs1+nXFTzTPl8xTlUcUB8ph8YIjRlUtb oapYkaQBldzC379NGI72lwfMUGgeMUa55sQP8TuNlAGQcbzIsONAYuAwYc0q9mxIO6CP UlUA== X-Gm-Message-State: APjAAAX4vXM5V2+jIAgaDa/jQcQjWHGgh/bhMNWXuRCpcibhyiW2e4ot XpY+AGuYAsGoAfJ8Xo4vFfhv1Igfp5WI+QZ78uizi0bd X-Google-Smtp-Source: APXvYqxSLNHsxhcz+gM0wqwveEKtVy2r7xd/vtNXhyaPvRZcUlJAZ+VB565D8W5/BS87fWWZ2StQG4gMxtj7G93DEA0= X-Received: by 2002:aa7:8652:: with SMTP id a18mr24510500pfo.190.1571688721907; Mon, 21 Oct 2019 13:12:01 -0700 (PDT) In-Reply-To: <83lftd28wt.fsf@gnu.org> 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: 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:169944 Archived-At: Eli Zaretskii writes: > > 1. Under "emacs -Q", evaluate: > > (defun my-advice (&rest args) > > (recenter)) > > (advice-add 'next-error :after #'my-advice) > > 2. M-x rgrep RET [... grep for something] > > 3. Run 'next-error' (M-g M-n) from the "*grep*" buffer. > > > > Result: I get the error: > > recenter-top-bottom: =E2=80=98recenter=E2=80=99ing a window that do= es not display > > current-buffer. > > Why isn't this a cockpit error: you force a function that happens to > switch buffers to recenter. It's like you've added a call to > 'recenter' in some arbitrary place in a random function: you are > responsible for that code, and if it does stuff that it shouldn't, > your code is wrong. No? In this case my expectation was that this code would be run *after* the command, i.e. when it had already done all the switching. I'm not sure that's comparable to placing recenter in an arbitrary place inside the function. It was surprising to me that this didn't work, and it's not clear what I should do instead. For example, the following code exhibits the same problem: (defun my-next-error () (interactive) (next-error) (recenter)) What am I missing? Best regards, Stefan Kangas