unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Search waht is under the cursor
@ 2007-07-30  9:30 Rafal Kurcz
  2007-07-30  9:46 ` Harald Hanche-Olsen
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Rafal Kurcz @ 2007-07-30  9:30 UTC (permalink / raw)
  To: help-gnu-emacs

Hello
I would like to search the string that is currently under the cursor.
It should do something very similar to C-s and C-r but take the string
that is currently under the cursor as a default search pattern.

Do you know how to do that ?

Thank You for help

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

* Re: Search waht is under the cursor
  2007-07-30  9:30 Search waht is under the cursor Rafal Kurcz
@ 2007-07-30  9:46 ` Harald Hanche-Olsen
  2007-07-30  9:49 ` Nick Roberts
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Harald Hanche-Olsen @ 2007-07-30  9:46 UTC (permalink / raw)
  To: help-gnu-emacs

+ Rafal Kurcz <pawlaczus@yahoo.com>:

| Hello
| I would like to search the string that is currently under the cursor.
| It should do something very similar to C-s and C-r but take the string
| that is currently under the cursor as a default search pattern.
|
| Do you know how to do that ?

You mean, like C-s C-w ?  It may not be exactly what you describe, but
could be just what you want.  I use it all the time.  Each C-w (can be
used anytime during an incremental search) incorporates one more word
into the search term.  Try it.

Another useful thing is to type M-p during an incremental search. That
turns off searching temporarily, and lets you edit the search string
in the minibuffer (actually, it invokes a history mechanism using M-p
and M-n).  You can then yank copied text into the search string, edit
to your heart's content and hit C-s to turn searching back on.

-- 
* Harald Hanche-Olsen     <URL:http://www.math.ntnu.no/~hanche/>
- It is undesirable to believe a proposition
  when there is no ground whatsoever for supposing it is true.
  -- Bertrand Russell

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

* Re: Search waht is under the cursor
  2007-07-30  9:30 Search waht is under the cursor Rafal Kurcz
  2007-07-30  9:46 ` Harald Hanche-Olsen
@ 2007-07-30  9:49 ` Nick Roberts
  2007-07-30 10:45 ` Nikolaj Schumacher
  2007-07-30 10:49 ` Peter Dyballa
  3 siblings, 0 replies; 5+ messages in thread
From: Nick Roberts @ 2007-07-30  9:49 UTC (permalink / raw)
  To: Rafal Kurcz; +Cc: help-gnu-emacs

 > Hello
 > I would like to search the string that is currently under the cursor.
 > It should do something very similar to C-s and C-r but take the string
 > that is currently under the cursor as a default search pattern.

  The characters `C-w' and `C-y' can be used in incremental search to
  grab text from the buffer into the search string.  This makes it
  convenient to search for another occurrence of text at point.  `C-w'
  copies the character or word after point as part of the search string,
  advancing point over it.  (The decision, whether to copy a character or
  a word, is heuristic.)  Another `C-s' to repeat the search will then
  search for a string including that character or word.

Hopefully next time this will help you search the manual more effectively
first!

-- 
Nick                                           http://www.inet.net.nz/~nickrob

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

* Re: Search waht is under the cursor
  2007-07-30  9:30 Search waht is under the cursor Rafal Kurcz
  2007-07-30  9:46 ` Harald Hanche-Olsen
  2007-07-30  9:49 ` Nick Roberts
@ 2007-07-30 10:45 ` Nikolaj Schumacher
  2007-07-30 10:49 ` Peter Dyballa
  3 siblings, 0 replies; 5+ messages in thread
From: Nikolaj Schumacher @ 2007-07-30 10:45 UTC (permalink / raw)
  To: help-gnu-emacs; +Cc: Rafal Kurcz

Rafal Kurcz <pawlaczus@yahoo.com> wrote:

> I would like to search the string that is currently under the cursor.

> It should do something very similar to C-s and C-r but take the string
> that is currently under the cursor as a default search pattern.
>
> Do you know how to do that ?

Depends on what you mean by "string" and by "under the cursor".

After pressing C-s, you can use C-w to insert the word(s) after the
cursor.

If you're searching for the symbol at point, you can jump to the next
location with my highlight-symbol-mode[1].

For something else, you could dig through this:
http://www.emacswiki.org/cgi-bin/emacs-en/SearchAtPoint


regards,
Nikolaj Schumacher

[1]: http://nschum.de/src/emacs/highlight-symbol/

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

* Re: Search waht is under the cursor
  2007-07-30  9:30 Search waht is under the cursor Rafal Kurcz
                   ` (2 preceding siblings ...)
  2007-07-30 10:45 ` Nikolaj Schumacher
@ 2007-07-30 10:49 ` Peter Dyballa
  3 siblings, 0 replies; 5+ messages in thread
From: Peter Dyballa @ 2007-07-30 10:49 UTC (permalink / raw)
  To: Rafal Kurcz; +Cc: help-gnu-emacs


Am 30.07.2007 um 11:30 schrieb Rafal Kurcz:

> Do you know how to do that ?

M-b C-s C-w ? I.e.: backward-word, isearch-forward, yank that word in  
isearch mode.

Do you know how to create a keyboard macro?

--
Greetings

   Pete

Time is an illusion. Lunchtime, doubly so.

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

end of thread, other threads:[~2007-07-30 10:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-30  9:30 Search waht is under the cursor Rafal Kurcz
2007-07-30  9:46 ` Harald Hanche-Olsen
2007-07-30  9:49 ` Nick Roberts
2007-07-30 10:45 ` Nikolaj Schumacher
2007-07-30 10:49 ` Peter Dyballa

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