GNU bug report logs - #78124
30.1; `revert-buffer' regression

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Mon, 28 Apr 2025 23:22:04 UTC

Severity: normal

Tags: notabug

Found in version 30.1

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 78124 <at> debbugs.gnu.org
Subject: bug#78124: 30.1; `revert-buffer' regression
Date: Tue, 29 Apr 2025 09:22:29 +0300
tags 78124 notabug
thanks

> Date: Mon, 28 Apr 2025 23:20:37 +0000
> From:  Drew Adams via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
> 
> 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 is a (new) feature.  The behavior change was in Emacs 29, where
we have this in NEWS:

  ** Explicitly-set read-only state is preserved when reverting a buffer.
  If you use the 'C-x C-q' command to change the read-only state of the
  buffer and then revert it, Emacs would previously use the file
  permission bits to determine whether the buffer should be read-only
  after reverting the buffer.  Emacs now remembers the decision made in
  'C-x C-q'.

The change was (briefly) discussed in bug#35166.

If you want back the previous behavior, you can define your own
function that is the value of revert-buffer-restore-functions (e.g.,
set it to nil).

> 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.

You can change that trivially to restore the behavior you expect.




This bug report was last modified 46 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.