From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Xah Lee Newsgroups: gmane.emacs.help Subject: Re: automatic search/search and replace for a marked string Date: Sat, 22 Aug 2009 06:58:33 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <61780ed3-2c6b-4233-8f05-3ec082689bb8@s15g2000yqs.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1250963827 17270 80.91.229.12 (22 Aug 2009 17:57:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 22 Aug 2009 17:57:07 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Aug 22 19:57:00 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Meupm-0004w8-CO for geh-help-gnu-emacs@m.gmane.org; Sat, 22 Aug 2009 19:56:58 +0200 Original-Received: from localhost ([127.0.0.1]:41484 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Meupl-0000FC-St for geh-help-gnu-emacs@m.gmane.org; Sat, 22 Aug 2009 13:56:57 -0400 Original-Path: news.stanford.edu!headwall.stanford.edu!news.glorb.com!news2.glorb.com!postnews.google.com!l5g2000pra.googlegroups.com!not-for-mail Original-Newsgroups: comp.emacs,gnu.emacs.help Original-Lines: 51 Original-NNTP-Posting-Host: 76.102.12.87 Original-X-Trace: posting.google.com 1250949513 19458 127.0.0.1 (22 Aug 2009 13:58:33 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Sat, 22 Aug 2009 13:58:33 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: l5g2000pra.googlegroups.com; posting-host=76.102.12.87; posting-account=bRPKjQoAAACxZsR8_VPXCX27T2YcsyMA User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/530.5 (KHTML, like Gecko) Chrome/2.0.172.39 Safari/530.5, gzip(gfe), gzip(gfe) Original-Xref: news.stanford.edu comp.emacs:98631 gnu.emacs.help:172254 X-Mailman-Approved-At: Sat, 22 Aug 2009 13:51:56 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:67416 Archived-At: On Aug 22, 4:07 am, lichtkind wrote: > Hello, > > I have marked a string. Now I want to search for this string in the > whole text. I know that I can search with C-R or C-S. and type in the > searchstring. I'm looking for a way, that the marked string is > automatic the searchstring. This should also work for the other > search/ search and replace types. if u are using emacs 22, then you can do this: =E2=80=9CCtrl+s Ctrl+w=E2=80=9D. This will search the current word, but you= must move your cursor to the beginning of the word first. In emacs 23, the above is deprecated. Basically, now you start it with M-s as prefix, then press some other key. It's rather complex and very not intuitive. I have 10 years of using emacs, but i did spent some 5 or 10 min reading the release notes... but i haven't figured it out. You can, type M-s then C-h, to get a list of shortcuts that has M-s as start. You can read their command names there. here's the output: Global Bindings Starting With M-s: key binding --- ------- M-s h Prefix Command M-s o occur M-s w isearch-forward-word M-s h f hi-lock-find-patterns M-s h l highlight-lines-matching-regexp M-s h p highlight-phrase M-s h r highlight-regexp M-s h u unhighlight-regexp M-s h w hi-lock-write-interactive-patterns ok, i just gave another try with M-s w. Spent another 2 min on this. Dunno what the fuck it is going. someday i'll give a hour or two on this, maybe then i'll know the answer. Xah =E2=88=91 http://xahlee.org/ =E2=98=84