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

From: Eli Zaretskii <[email-masked]>
Date: Sat, 05 Aug 2017 09:52:59 +0300

> From: [email-masked]
> Date: Fri, 04 Aug 2017 21:56:11 -0400
> Cc: [email-masked]
> 
> Kaushal Modi <[email-masked]> writes:
> 
> > The current behavior of indent-region function is that it will first indent
> > the buffer and then throw an error at the end that it couldn't apply the
> > indentation. Instead the below patch checks if the buffer if read-only
> > first before trying to indent.
> 
> I wonder if someone will complain that they were relying on this
> behaviour to check indentation in read-only buffers (currently if the
> indentation is already correct there is no error).

The original submission provided no rationale for the change, so it's
hard to reason about its advantages.  The clear disadvantage is that
this goes against veteran Emacs behavior regarding read-only text,
behavior that is present in several other commands, and that AFAIR
resulted from some past discussions.

If the rationale is user surprise, then I'd suggest to leave the
current behavior unchanged.