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

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

RE: repeating a search a certain number of times


From: Drew Adams
Subject: RE: repeating a search a certain number of times
Date: Thu, 21 Jan 2016 10:10:39 -0800 (PST)

> I have been looking for a way to repeat a search a certain number of
> times, and from the documentation i have found the search-forward
> function to do that:
> 
> (search-forward "something" nil nil 5)
> 
> But unfortunately this isn't bound to a key. The docstring says it is
> bound to <find>, but I don't know what that means. It isn't a lisp
> function. I thought maybe it is a menu item, but can't see that in the
> menu either.
> 
> So my question is, how can I bind this to a key so that when I press it,
> it asks me for the string, then the repetition count and then goes ahead
> and finds it?

`search-forward' is bound to `C-s RET'. Just repeat `C-s RET' to repeat
your search (no need to enter the same input again).

See the Emacs manual, node `Nonincremental Search': `C-h r g noni TAB RET'.

Is there some reason you do not want to use incremental search: `C-s'?
If you do that, then just repeat `C-s'.

See the Emacs manual, node `Incremental Search': `C-h r g incr TAB RET'.



reply via email to

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