In article , Maindoor wrote: > Hi, >      I have the following code to search forward from point. >      But If I have a string like SOMETHING_HERE=$(HI) > >      then this code yanks the whole "SOMETHING_HERE=$" >      and searches for it forward. How do I limit it to >      "SOMETHING_HERE". I want it to stop if it encounters >      any special characters except "_" and "-". C-h f current-word and see the really-word parameter. However, you may also need to change the syntax table to make "_" and "-" be considered word constituents. > >      Here is the code: > > (defun my-viper-search-yank-word (arg forward) >   "Search forward for ARG occurance of word under point. > If FORWARD is nil, searches backward instead." >   (let ((viper-re-search t)) >     (viper-search >      (concat "\\<" (regexp-quote (current-word)) "\\>") forward arg))) > > (defun my-viper-search-forward-yank-word (arg) >   "Search forward for ARG occurance of word under point. > Like the Vim command \"*\" (but not exactly)." >   (interactive "P") >   (my-viper-search-yank-word arg t)) > > Regards, > Maindoor. > -- Barry Margolin, barmar@alum.mit.edu Arlington, MA *** PLEASE post questions in newsgroups, not directly to me *** *** PLEASE don't copy me on replies, I'll read them in the group ***