[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: inhibit-read-only text property does not work expectedly
From: |
Eli Zaretskii |
Subject: |
Re: inhibit-read-only text property does not work expectedly |
Date: |
Sat, 14 Sep 2019 10:50:11 +0300 |
> From: Serhii Mozghovyi <address@hidden>
> Date: Sat, 14 Sep 2019 09:35:41 +0300
>
> C-x b <unique buffer name>, then insert some text, such as:
>
> First paragraph.
>
> Second paragraph.
>
> Then M-: (put-text-property (point-min) (point-max) 'inhibit-read-only
> t), and C-x C-q to make the buffer read-only. Now select the "Se" and
> kill it with C-w: it succeeds. Then hit C-/ to undo, select "Sec" and
> try to kill again. Now it fails. For any other region that does not
> intersect with "Se", killing works.
Please file a bug report with all the details.
> I found out that the reason for that is this code in the function
> "verify_interval_modifications" in textprop.c (lines 2259-2263):
>
> if (i->position + LENGTH (i) < end
> && (!NILP (BVAR (current_buffer, read_only))
> && NILP (Vinhibit_read_only)))
> xsignal1 (Qbuffer_read_only, Fcurrent_buffer ());
>
> I don't quite understand what is its purpose, anyway? To disable
> deletion of entire intervals? Does it make any bit of a sense? Intervals
> should be invisible at Lisp programming level, right?
AFAIU, this code catches the cases where only part of the region to be
deleted has the inhibit-read-only property.
I think the bug is that undo doesn't cause the adjacent intervals to
be spliced or something.