Suppose we have the following text:
(print "thIis-is-a-text")
and the cursor is in the word "this" which between char 'h' and 'i'.
In emacs, if I type C-s C-w, the text to search is 'is',
again C-w is 'is-is',
again C-w is 'is-is-a',
again C-w is 'is-is-a-text',
again C-w is 'is-is-a-text"'...
And there is a emacs plugin expand region: "Expand region increases the selected region by semantic units. Just keep pressing the key until it selects what you want."
So I want to make C-s C-w to be more intelligent: to combine with expand region.
Cursor between char 'h' and 'i' in the word 'this' again, my goal is:
when I type C-s C-w, the word 'this' will be the text to search,
again will be 'this-is-a-text',
again will be '"this-is-a-text"',
again will be 'print "this-is-a-text"',
again will be '(print "this-is-a-text")',
....(behaves like expand region, maybe this is not a good example...)
As I find sometimes expand region is quite useful in searching texts, I hope someone can write some codes to achieve this for me since I am new to emacs and elisp. Thanks and please forgive my broken English! :)