Ctrl-s
, isearch-forward
is not appealing to me and so, i wrote a wrapper around it to search from the beginning of the buffer always.
(defun sk-isearch-forward (original)
(interactive "sEnter search string: ")
(save-excursion
(beginning-of-buffer)
(isearch-forward original)))
Now, i am seeing two issues:::
1) M-x sk-isearch-forward
goes to the beginning of the buffer but never returns to the original cursor position. save-excursion
is added to take care of this but it is failing me
2) it is not highlighting any of the matching words in the current buffer.
Is isearch-forward
not the right function for this job?
I always search for a word, no regexes and the search, i prefer to start from the beginning. How can i do this?