next = Qnil;
GCPRO2 (next, list);
- /* Don't let read-only properties interfere with undo. */
- if (!NILP (current_buffer->read_only))
+ /* In a writable buffer, enable undoing read-only text that is so
+ because of text properties. */
+ if (NILP (current_buffer->read_only))
specbind (Qinhibit_read_only, Qt);
/* Don't let `intangible' properties interfere with undo. */
else if (INTEGERP (car) && INTEGERP (cdr))
{
/* Element (BEG . END) means range was inserted. */
- Lisp_Object end;
if (XINT (car) < BEGV
|| XINT (cdr) > ZV)