1

When I do reverse incremental search, the cursor is placed at the beginning of a match for my search, and stays there as I type further characters that match. With forward search, on the other hand, the cursor moves forward as I continue to type matching letters. Is there a way to do a forward search that behaves like backward search in this respect? (To place the cursor at the beginning of a match, I first do a forward search, then do a reverse search. I'd like to avoid this, if possible.)

0

I have the this in my init taken from the emacswiki to solve this:

(defun my-goto-match-beginning ()
  (when (and isearch-forward isearch-other-end)
    (goto-char isearch-other-end)))

(add-hook 'isearch-mode-end-hook 'my-goto-match-beginning)

If you leave the search, the point will jump to the beginning automatically.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.