I cannot find the setting that prevents deletion of an entire region when you have it highlighted and you hit backspace... (I just want it to delete one character even if a region is highlighted.) I already have
(delete-selection-mode 0)
and in custom-set-variables (I have cua-mode enabled for its rectangle functions),
'(cua-delete-selection nil)
but that is the behavior I get. Am I missing something?
Found it:
(setq delete-active-region nil)
is the answer. Thanks to all for toughing it out with me!
Emacs has different behavior depending on whether the highlighting was done with mouse or the keyboard.
Even in transient-mark-mode
, if you set the mark and move the point, using backspace will not delete the region. delete-selection-mode
is a minor mode that changes this behavior.
When using the mouse to highlight a region, regardless of delete-selection-mode
, using backspace will delete the region that was highlighted with the mouse. From Section 25.1.1 of the manual:
"While the region remains active, typing or deletes the text in that region and deactivates the mark; this behavior follows a convention established by other graphical programs, and it does not apply when you set the region any other way, including shift-selection (*note Shift Selection::)."
Based on this, it sounds like you're selecting the region using the mouse. Is that correct? Does the same behavior arise when using shift-select-mode
or simply using mark and point?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With