all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Timur Aydin <ta@taydin.org>, help-gnu-emacs@gnu.org
Subject: RE: repeating a search a certain number of times
Date: Thu, 21 Jan 2016 10:10:39 -0800 (PST)	[thread overview]
Message-ID: <2946d014-5a96-4209-99d3-92f6bf61c0d2@default> (raw)
In-Reply-To: <56A11703.8050200@taydin.org>

> 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	other threads:[~2016-01-21 18:10 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-17 20:07 Mac: Don't quit Emacs when window is closed Luis Gerhorst
2016-01-17 22:40 ` Marcin Borkowski
2016-01-18  4:21   ` Random832
2016-01-19 18:31     ` Luis Gerhorst
     [not found]   ` <mailman.2484.1453090928.843.help-gnu-emacs@gnu.org>
2016-01-18 17:05     ` Barry Margolin
2016-01-18 18:03       ` Philipp Stephani
2016-01-21 17:36       ` repeating a search a certain number of times Timur Aydin
2016-01-21 18:10         ` Drew Adams [this message]
2016-01-18  7:15 ` Mac: Don't quit Emacs when window is closed Nick Helm
2016-01-19 18:35   ` Luis Gerhorst
2016-01-19 21:46     ` Luis Gerhorst
2016-01-19 22:04     ` Nick Helm
2016-01-18  9:11 ` tomas
  -- strict thread matches above, loose matches on Subject: below --
2016-01-21 17:41 repeating a search a certain number of times Timur Aydin
2016-01-21 22:14 ` Marcin Borkowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2946d014-5a96-4209-99d3-92f6bf61c0d2@default \
    --to=drew.adams@oracle.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=ta@taydin.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.