Subject: bug#22819: 25.0.91; Don't try to indent region if the buffer is read-only

From: [email-masked]
Date: Sat, 05 Aug 2017 08:47:37 -0400

Eli Zaretskii <[email-masked]> writes:

>> >against veteran Emacs behavior regarding read-only text, behavior
>> >that is present in several other commands, and that AFAIR resulted
>> >from some past discussions.
>> 
>> This is the only one that provided me this surprise in about a decade of Emacs use. Which other commands
>> do the text manipulation, and then check the buffer read-only status? 
>
> C-w, to name just one.

That seems like a bit of a special case, as there is `kill-read-only-ok'
which specifically controls this behaviour.

> IOW, a command could have useful side effects that are produced even
> if the buffer is read-only and its text cannot be changed, thus
> preventing the main effect of the command from happening.

indent-region doesn't have any side-effects though, right?  There are
lots of other commands which check read-only status at the beginning:

    M-x rgrep barf-if-buffer-read-only\|(interactive "\*