> In delete-seletion-mode, trying to self insert in read-only text when > there is a selection signals an error that clears pre-command-hook. > > emacs -Q > > (delete-selection-mode 1) > (insert (propertize "12345" 'read-only t)) > > Select read only text with C-SPC + moving. Press a self-inserting key ("x"). > > => pre-command-hook is cleared. > > delete-selection-mode does check buffer-read-only, but it does not > protect against read-only text. Does the attached patch fix it?