2

In a large file, I would isearch for the word byebug

but as soon as I type by, my cursor is moved to a line containing the word bystander. (The file actually does not have the word byebug.)

But now I'm a bit lost with my cursor at this random line. I didn't find what I was looking for (byebug), and I don't know how to get back to where I started searching.

This kinda sucks. Is there a way to either

a) tell search to not start until I've finished typing or

b) if I search moves my cursor to a partial match, how can I go back to where I was

1
  • Maybe you can try starting the search with isearch-edit-string? And, press return when you are done typing the string?
    – scribe
    Commented Aug 9, 2022 at 5:40

1 Answer 1

5

C-g, possibly repeating it, puts you back where you started and exits Isearch.

Not wanting search to start until you've finished typing is not incremental search. It is plain, nonincremental search. In Emacs you do it using C-s RET.

See the Emacs manual, node Nonincremental Search.

How did I find that help page in the Emacs manual?

  1. C-h r to open the manual.
  2. i noninc TAB to ask the Index about things nonincremental.

If you get to know the Emacs help commands then you can ask Emacs.

1
  • 1
    Note also that if you have exited isearch and want to get back to where you started from, you can simply pop the mark with C-u C-SPC
    – phils
    Commented Mar 3, 2018 at 3:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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