Subject: bug#10006: 24.0.91; set-text-properties fails with "Text is read-only", but didn't in Emacs 23

From: Glenn Morris <[email-masked]>
Date: Wed, 09 Nov 2011 18:38:36 -0500

Eric Hanchrow wrote:

> (insert "frotz")
> (occur "f")
> (set-buffer (get-buffer "*Occur*"))
> (fundamental-mode)
> (toggle-read-only 0)
> (set-text-properties (point-min) (point-max) nil)
> ===>8===>8===>8===>8===>8===>8===>8===>8===>8===>8===>8===>8===
>
> Invoke emacs like this:
>
>     $ emacs -Q --batch --load /tmp/fail.el  ; echo $?
>
> You'll see
>
>     Searched 1 buffer; 1 match
>     Text is read-only
>     255

There are read-only text properties in the Occur buffer now.
If you let-bind inhibit-read-only around your code rather than
using toggle-read-only, it should all work fine.
I don't think there is a bug here.