help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: defadvicing next-error


From: Andy Moreton
Subject: Re: defadvicing next-error
Date: Tue, 31 Mar 2015 16:09:29 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (windows-nt)

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]