unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* How to let C-s center the line
@ 2003-11-12 14:58 Timur Aydin
  2003-11-12 15:58 ` Mario Domgörgen
  2003-11-12 20:40 ` Kevin Rodgers
  0 siblings, 2 replies; 3+ messages in thread
From: Timur Aydin @ 2003-11-12 14:58 UTC (permalink / raw)


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?

-- 
Timur Aydin

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How to let C-s center the line
  2003-11-12 14:58 How to let C-s center the line Timur Aydin
@ 2003-11-12 15:58 ` Mario Domgörgen
  2003-11-12 20:40 ` Kevin Rodgers
  1 sibling, 0 replies; 3+ messages in thread
From: Mario Domgörgen @ 2003-11-12 15:58 UTC (permalink / raw)


Timur Aydin <sdfeklsdf@sadfoweklsdfs.cdweeds> writes:

> 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.

look on flush-lines and adept it to center a line and not delete it

Mario

-- 
The Tao that is seen
Is not the true Tao, until
You bring fresh toner.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How to let C-s center the line
  2003-11-12 14:58 How to let C-s center the line Timur Aydin
  2003-11-12 15:58 ` Mario Domgörgen
@ 2003-11-12 20:40 ` Kevin Rodgers
  1 sibling, 0 replies; 3+ messages in thread
From: Kevin Rodgers @ 2003-11-12 20:40 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-11-12 20:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-11-12 14:58 How to let C-s center the line Timur Aydin
2003-11-12 15:58 ` Mario Domgörgen
2003-11-12 20:40 ` Kevin Rodgers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).