Subject: Re: bug#20380: 24.5; (shell-command-on-region ... "*Messages*") yields "Buffer is read-only" error

From: Eli Zaretskii <[email-masked]>
Date: Mon, 20 Apr 2015 17:50:26 +0300

> From: Alexis <[email-masked]>
> Date: Mon, 20 Apr 2015 19:51:57 +1000
> 
> 
> Vincent Lefevre <[email-masked]> writes:
> 
> > I have the following problem with Emacs 24:
> >
> > emacs -Q --eval \ 
> >   '(shell-command-on-region (point) (point) "cp" t t 
> >   "*Messages*")' tst.txt
> >
> > yields a "Buffer is read-only: #<buffer *Messages*>" error 
> > instead of outputting the standard error from "cp" to the buffer 
> > *Messages* like with Emacs 23.
> 
> NEWS section "Changes in Emacs 24.4" states: 
>  
>     ** The *Messages* buffer is created in `messages-buffer-mode', 
>     a new major mode, with read-only status.

Indeed, this is a new feature.  If you want to know why it was
introduced, read this discussion:

  http://lists.gnu.org/archive/html/emacs-devel/2010-02/msg00135.html