all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* How to search current word under cursor?
@ 2006-05-17 12:01 Jijun MA
  2006-05-17 12:09 ` Bastien
  2006-05-17 13:43 ` Peter Dyballa
  0 siblings, 2 replies; 6+ messages in thread
From: Jijun MA @ 2006-05-17 12:01 UTC (permalink / raw)



I want search this buffer of current word under cursor, how can I do it?
thank you

-- 

           fireflower

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

* Re: How to search current word under cursor?
  2006-05-17 12:01 How to search current word under cursor? Jijun MA
@ 2006-05-17 12:09 ` Bastien
  2008-07-18 13:13   ` cfelton
       [not found]   ` <mailman.15011.1216429238.18990.help-gnu-emacs@gnu.org>
  2006-05-17 13:43 ` Peter Dyballa
  1 sibling, 2 replies; 6+ messages in thread
From: Bastien @ 2006-05-17 12:09 UTC (permalink / raw)


Jijun MA <jjmmma@gmail.com> writes:

> I want search this buffer of current word under cursor, how can I do
> it?

C-s C-w

-- 
Bastien

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

* Re: How to search current word under cursor?
  2006-05-17 12:01 How to search current word under cursor? Jijun MA
  2006-05-17 12:09 ` Bastien
@ 2006-05-17 13:43 ` Peter Dyballa
  1 sibling, 0 replies; 6+ messages in thread
From: Peter Dyballa @ 2006-05-17 13:43 UTC (permalink / raw)
  Cc: help-gnu-emacs


Am 17.05.2006 um 14:01 schrieb Jijun MA:

> I want search this buffer of current word under cursor, how can I  
> do it?

M-b C-s C-w C-s

--
Greetings

   Pete

"Let's face it; we don't want a free market economy either."
         James Farley, president, Coca-Cola Export Corp., 1959

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

* Re: How to search current word under cursor?
  2006-05-17 12:09 ` Bastien
@ 2008-07-18 13:13   ` cfelton
  2008-07-19 16:24     ` Drew Adams
       [not found]   ` <mailman.15011.1216429238.18990.help-gnu-emacs@gnu.org>
  1 sibling, 1 reply; 6+ messages in thread
From: cfelton @ 2008-07-18 13:13 UTC (permalink / raw)
  To: Help-gnu-emacs


How do you extend this to the occur function?  I have a key binding mapped to
the occur function, and I would like the word at the cursor (compete word
foo_bar, not just foo) to be the default search when invoked?

Thanks 


bastien-3 wrote:
> 
> Jijun MA <jjmmma@gmail.com> writes:
> 
>> I want search this buffer of current word under cursor, how can I do
>> it?
> 
> C-s C-w
> 
> -- 
> Bastien
> _______________________________________________
> help-gnu-emacs mailing list
> help-gnu-emacs@gnu.org
> http://lists.gnu.org/mailman/listinfo/help-gnu-emacs
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-search-current-word-under-cursor--tp4429652p18528933.html
Sent from the Emacs - Help mailing list archive at Nabble.com.





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

* RE: How to search current word under cursor?
  2008-07-18 13:13   ` cfelton
@ 2008-07-19 16:24     ` Drew Adams
  0 siblings, 0 replies; 6+ messages in thread
From: Drew Adams @ 2008-07-19 16:24 UTC (permalink / raw)
  To: 'cfelton', Help-gnu-emacs

> >> I want search this buffer of current word under cursor, 
> >> how can I do it?
> > 
> > C-s C-w
>
> How do you extend this to the occur function?  I have a key 
> binding mapped to the occur function, and I would like the
> word at the cursor (compete word foo_bar, not just foo) to be
> the default search when invoked?

http://www.emacswiki.org/cgi-bin/wiki/OccurFromIsearch

(Also, C-s C-w C-w... accumulates search text, so C-s C-w C-w will pick up
foo_bar as the search string.)
 





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

* Re: How to search current word under cursor?
       [not found]   ` <mailman.15011.1216429238.18990.help-gnu-emacs@gnu.org>
@ 2008-07-19 19:27     ` Andreas Politz
  0 siblings, 0 replies; 6+ messages in thread
From: Andreas Politz @ 2008-07-19 19:27 UTC (permalink / raw)
  To: help-gnu-emacs

cfelton wrote:
> How do you extend this to the occur function?  I have a key binding mapped to
> the occur function, and I would like the word at the cursor (compete word
> foo_bar, not just foo) to be the default search when invoked?
> 
> Thanks 
> 
> 
> bastien-3 wrote:
>> Jijun MA <jjmmma@gmail.com> writes:
>>
>>> I want search this buffer of current word under cursor, how can I do
>>> it?
>> C-s C-w
>>
>> -- 
>> Bastien

occur takes the first item in `regexp-history' as default value.
This list can be manipulated.

(defun occur-symbol-at-point ()
   (interactive)
   (let ((sym (thing-at-point 'symbol)))
     (if sym
	(push (regexp-quote sym) regexp-history)) ;regexp-history defvared in replace.el
       (call-interactively 'occur)))


-ap



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

end of thread, other threads:[~2008-07-19 19:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-17 12:01 How to search current word under cursor? Jijun MA
2006-05-17 12:09 ` Bastien
2008-07-18 13:13   ` cfelton
2008-07-19 16:24     ` Drew Adams
     [not found]   ` <mailman.15011.1216429238.18990.help-gnu-emacs@gnu.org>
2008-07-19 19:27     ` Andreas Politz
2006-05-17 13:43 ` Peter Dyballa

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.