I am trying to copy some text from the browser by highlighting it. I then go to emacs and want to paste over an existing paragraph without deleting it beforehand. How do you do that?

  • This would be on topic in the Emacs Stack Exchange. Just FYI. – Faheem Mitha Feb 21 '16 at 17:32

According to Michael Mrozek in How to replace a region in emacs with yank buffer contents?

Add this to your .emacs:

(delete-selection-mode 1)

Anything that writes to the buffer while the region is active will overwrite it, including paste, but also simply typing something or hitting backspace

Further reading:


Emacs doesn't have an "overwrite current selection" command, but you can easily (hah!) write your own.

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.