[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to search current word under cursor?

From: Andreas Politz
Subject: Re: How to search current word under cursor?
Date: Sat, 19 Jul 2008 21:27:23 +0200
User-agent: Mozilla-Thunderbird (X11/20080509)

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?


bastien-3 wrote:
Jijun MA <address@hidden> writes:

I want search this buffer of current word under cursor, how can I do
C-s C-w


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

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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]