From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Moreton Newsgroups: gmane.emacs.help Subject: Re: defadvicing next-error Date: Tue, 31 Mar 2015 16:09:29 +0100 Message-ID: References: <551A9088.6060004@taydin.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1427814639 28636 80.91.229.3 (31 Mar 2015 15:10:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 31 Mar 2015 15:10:39 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Mar 31 17:10:08 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Ycxnq-0006Xw-A3 for geh-help-gnu-emacs@m.gmane.org; Tue, 31 Mar 2015 17:10:06 +0200 Original-Received: from localhost ([::1]:39141 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ycxnp-0002CE-BI for geh-help-gnu-emacs@m.gmane.org; Tue, 31 Mar 2015 11:10:05 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35182) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ycxnd-0002C8-Hi for help-gnu-emacs@gnu.org; Tue, 31 Mar 2015 11:09:54 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YcxnY-0001Am-6n for help-gnu-emacs@gnu.org; Tue, 31 Mar 2015 11:09:53 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:53051) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YcxnX-0001AV-Vv for help-gnu-emacs@gnu.org; Tue, 31 Mar 2015 11:09:48 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1YcxnU-0006EJ-Ez for help-gnu-emacs@gnu.org; Tue, 31 Mar 2015 17:09:44 +0200 Original-Received: from uk.solarflare.com ([193.34.186.16]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 31 Mar 2015 17:09:44 +0200 Original-Received: from andrewjmoreton by uk.solarflare.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 31 Mar 2015 17:09:44 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 27 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: uk.solarflare.com User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (windows-nt) Cancel-Lock: sha1:QR4tHs6/eRTmF6AT96QEbiST80I= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:103467 Archived-At: On Tue 31 Mar 2015, Timur Aydin wrote: > Hi, > > I had defadviced isearch-update a long time ago so that it also > recenters the screen and have never looked back. Best entry I made in my > .emacs.el :) Here is what I have for that: > > (defadvice isearch-update (after recenter activate) > (recenter)) > > Now I want to do the same thing with next-error: > > (defadvice next-error (after recenter activate) > (recenter)) > > But while this works most of the time, it doesn't work with the first > hit. And it doesn't work when a transition happens from one source file > to another. I get "recenter'ing a window that does not display > current-buffer". > > So how do I get the recenter for every hit of next-error, just like > isearch-update? There is no need for advice: see variable next-error-recenter. AndyM