I am trying to improve the searching features of my emacs and allow it to search in other window (when multiple windows open), search the word i'm currently on and search on mouse click. I used this unit-at-cursor to create the following functions:
(defun seek-other-tab ()
(interactive)
(setq unit (elt (unit-at-cursor 'word) 0) // gets the word at which the cursor is
(other-window 1) // get to the next window
(search-forward unit nil nil))) // search...
and
(defun seek-buffer ()
(interactive)
(search-forward (elt (unit-at-cursor 'word) 0))
however, this is weaker than manually searching the other buffer because a. it doesn't wrap around and b. it doesn't remember the search so basically i need to use the both of the functions for searching effectively. it also doesn't mark the candidates as isearch-forward does.
as to the use of mouse as searcher (i thought of something like Alt-mouse to select a word and look for all its instances - like the GVIM shift-mouse1), i don't even know how to assign the mouse click :(
so my questions are : How can i improve my functions to have a wraparound search and to highlight selection\ make the isearch remember the search so at least i will be able to continue searching with C-s? How can i make the third function, that selects the word touched by the mouse and search for the instances (preferably, also highlighting)
update: the highlight_symbol mode is almost what i wanted for using the mouse as search device:
(global-set-key [(control shift mouse1)] 'highlight-symbol-at-point)
however, the function still only looks under the cursor instead of the mouse position. will ask it in a different thread. i still can't make a decent function for the (wrapable) searching of items in the other window :(