[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

inhibit-read-only text property does not work expectedly

From: Serhii Mozghovyi
Subject: inhibit-read-only text property does not work expectedly
Date: Sat, 14 Sep 2019 09:35:41 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0

In Emacs 26.1, the inhibit-read-only text property in a read-only buffer
does not always do what it should. Some regions can be killed with C-w
but some others cannot.

To reproduce, try the following:

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.

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?

Best regards,
Serhii Mozghovyi

reply via email to

[Prev in Thread] Current Thread [Next in Thread]