From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.help Subject: RE: repeating a search a certain number of times Date: Thu, 21 Jan 2016 10:10:39 -0800 (PST) Message-ID: <2946d014-5a96-4209-99d3-92f6bf61c0d2@default> References: <87lh7n96er.fsf@mbork.pl> <56A11703.8050200@taydin.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1453399873 29329 80.91.229.3 (21 Jan 2016 18:11:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 21 Jan 2016 18:11:13 +0000 (UTC) To: Timur Aydin , help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jan 21 19:11:00 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aMJhE-0000Ic-KH for geh-help-gnu-emacs@m.gmane.org; Thu, 21 Jan 2016 19:11:00 +0100 Original-Received: from localhost ([::1]:49224 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMJhD-0003t5-Cf for geh-help-gnu-emacs@m.gmane.org; Thu, 21 Jan 2016 13:10:59 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39676) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMJh0-0003st-OJ for help-gnu-emacs@gnu.org; Thu, 21 Jan 2016 13:10:47 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aMJgw-0004NY-OT for help-gnu-emacs@gnu.org; Thu, 21 Jan 2016 13:10:46 -0500 Original-Received: from userp1040.oracle.com ([156.151.31.81]:23107) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMJgw-0004NR-Gz for help-gnu-emacs@gnu.org; Thu, 21 Jan 2016 13:10:42 -0500 Original-Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u0LIAfPo016320 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Thu, 21 Jan 2016 18:10:41 GMT Original-Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u0LIAeBf002750 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Thu, 21 Jan 2016 18:10:41 GMT Original-Received: from abhmp0004.oracle.com (abhmp0004.oracle.com [141.146.116.10]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u0LIAe5S028323; Thu, 21 Jan 2016 18:10:40 GMT In-Reply-To: <56A11703.8050200@taydin.org> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9 (901082) [OL 12.0.6691.5000 (x86)] X-Source-IP: userv0021.oracle.com [156.151.31.71] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 156.151.31.81 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:108807 Archived-At: > 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: >=20 > (search-forward "something" nil nil 5) >=20 > But unfortunately this isn't bound to a key. The docstring says it is > bound to , 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. >=20 > 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'.