Delete Selection mode lets you treat an Emacs region much like a typical text selection outside of Emacs: You can replace the active region just by typing text, and you can delete the selected text just by hitting the Backspace key (‘DEL’).

According to the Emacs manual,

If you enable Delete Selection mode, a minor mode, then inserting text while the mark is active causes the selected text to be deleted first. This also deactivates the mark. Many graphical applications follow this convention, but Emacs does not.

Put the following in your init file: (delete-selection-mode 1)

(Emacs calls this ‘delete-selection-mode’. XEmacs calls it ‘pending-delete-mode’. Each has an alias for the other name, however, so the name doesn’t really matter.)

See also: TransientMarkMode. Transient Mark mode is enabled in Delete Selection mode.

As an EmacsLisp programmer, if you want to adapt commands in your own code (e.g. some mode of yours) to ‘delete-selection-mode’, then see this description of the use of symbol property ‘delete-selection’:

DrewAdams has slightly modified Delete Selection mode (standard library delsel.el) to be more compatible with Completion mode (standard library completion.el) – see delsel.el (on EmacsWiki).