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

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

Re: How to let C-s center the line


From: Kevin Rodgers
Subject: Re: How to let C-s center the line
Date: Wed, 12 Nov 2003 13:40:44 -0700
User-agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2

Timur Aydin wrote:

Hi,

I am trying to advice the isearch-forward function so that when I
search for a string and that string is found in the buffer, I want
that line to be centered. When I hit C-s again to find the next
instance of the string, that line should also be centered.

Here is what I wrote in the scratch buffer:

(defadvice isearch-forward (after my-isearch-forward-with-center activate)
        (recenter))

Then I have evaluated this, but C-s behaves exactly the same was as before...

Is this the proper way of achieving my goal, or am I way off?

I don't know why this doesn't work:


(add-hook 'isearch-mode-hook 'recenter)

but this does:

(defadvice isearch-update (after recenter activate)
  (recenter))

--
Kevin Rodgers



reply via email to

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