Subject: 26.1; Disabling view-mode sometimes unexpectedly retains read-only mode

From: Markus Triska <[email-masked]>
Date: Fri, 26 Jan 2024 11:35:41 +0100

To reproduce this issue, please launch Emacs with:

    $ emacs -Q

And then do:

    M-x view-mode RET
    C-u M-x view-mode RET
    M-x view-mode RET

After this, the echo area reads:

    View mode disabled in current buffer

When I then press SPC, I unexpectedly get:

    Buffer is read-only: #<buffer *scratch*>

The expectation is that since view mode is disabled, the buffer can be
edited again and is not readonly.

Thank you and all the best,
Markus

In GNU Emacs 26.1 (build 3, x86_64-pc-linux-gnu, X toolkit, Xaw scroll bars)
 of 2019-04-09 built on mt-laptop
Windowing system distributor 'The X.Org Foundation', version 11.0.12201003
System Description:	Ubuntu 22.10

Configured using:
 'configure --with-tiff=no'

Configured features:
XPM JPEG GIF PNG SOUND GSETTINGS NOTIFY GNUTLS LIBXML2 FREETYPE XFT ZLIB
TOOLKIT_SCROLL_BARS LUCID X11 THREADS