From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Timur Aydin Newsgroups: gmane.emacs.help Subject: defadvicing next-error Date: Tue, 31 Mar 2015 15:18:16 +0300 Message-ID: <551A9088.6060004@taydin.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1427804329 9531 80.91.229.3 (31 Mar 2015 12:18:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 31 Mar 2015 12:18:49 +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 14:18:44 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 1Ycv7u-0007hd-It for geh-help-gnu-emacs@m.gmane.org; Tue, 31 Mar 2015 14:18:38 +0200 Original-Received: from localhost ([::1]:38461 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ycv7t-0004Nt-Ur for geh-help-gnu-emacs@m.gmane.org; Tue, 31 Mar 2015 08:18:37 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48703) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ycv7j-0004Nn-4z for help-gnu-emacs@gnu.org; Tue, 31 Mar 2015 08:18:27 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ycv7b-0005tB-NM for help-gnu-emacs@gnu.org; Tue, 31 Mar 2015 08:18:26 -0400 Original-Received: from bonsai.taydin.org ([213.14.134.124]:52433 helo=mail.taydin.org) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ycv7b-0005sN-FW for help-gnu-emacs@gnu.org; Tue, 31 Mar 2015 08:18:19 -0400 Original-Received: from [127.0.0.1] (mail.taydin.org [127.0.0.1]) by mail.taydin.org (Postfix) with ESMTPSA id 041DD44003A for ; Tue, 31 Mar 2015 15:18:17 +0300 (EEST) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 213.14.134.124 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:103466 Archived-At: 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? Timur