Subject: Re: bug#78124: 30.1; `revert-buffer' regression

From: Kévin Le Gouguec <[email-masked]>
Date: Tue, 29 Apr 2025 08:07:47 +0200

Drew Adams via "Bug reports for GNU Emacs, the Swiss army knife of text
editors" <[email-masked]> writes:

> I didn't find anything about this in NEWS, so I'm assuming this change
> in behavior isn't intended.  And I HOPE it's not intended.
>
> emacs -Q
>
> Visit any file, say foo.el.
>
> Use `C-x C-q' to make the buffer read-only.
>
> M-: (revert-buffer t t)
>
> The buffer should be changed back to writable, but it remains
> read-only.  This is not the case in any prior Emacs release.

This describes the effect of…

  [NEWS]
  ** New variable 'revert-buffer-restore-functions'.
  It helps to preserve various states after reverting the buffer.

  [files.el]
  (defvar revert-buffer-restore-functions '(revert-buffer-restore-read-only)
    "Functions to preserve any state during `revert-buffer'.
    …")

… if I am not mistaken?

> Reversion should restore the state of the saved file to the buffer,
> including whether the file itself is read-only.
>
> I bind this command to F5, so the key reverts, as on Windows:
>
> (defun revert-buffer-no-confirm ()
>   "Revert buffer without confirmation."
>   (interactive) (revert-buffer t t))
>
> Useless now.
>
> In GNU Emacs 30.1 (build 2, x86_64-w64-mingw32) of 2025-02-23 built on
>  AVALON
> Windowing system distributor 'Microsoft Corp.', version 10.0.26100
> System Description: Microsoft Windows 10 Pro (v10.0.2009.26100.3775)