I have a long document. I placed two unique identifiers, in the form of short strings of printable English letter, in two positions in the document. The identifiers are far apart. My task is to delete the region starting just before the first identifier and extending all the way down to just after the other identifier.

Here's how I've tried to do it.

  1. I placed the cursor on the first letter of the first identifier.
  2. I typed C-Space to set the mark.
  3. I typed M-s, o + the second identifier + Enter to search for the location of the second identifier, and then moved the cursor to this location by clicking on the corresponding row in the resulting mini window.
  4. I clicked the backspace key to delete the region between the mark and the current position of the cursor.

Unfortunately, nothing seemed to happen at the end of step no. 4, and the region I thought I was selecting was not deleted.

What did I do wrong? How can I accomplish my task?

  • 1
    Did you try C-x C-x (or C-x C-x C-x C-x), to activate the region? Does that help? (Why do you bother with M-x o, here, instead of just searching for the second identifier directly, with C-s?) – Drew Oct 8 '18 at 13:38
  • @Drew: C-x, C-x did the trick. Thanks! – Evan Aad Oct 8 '18 at 14:31

Your Answer

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

Browse other questions tagged or ask your own question.