bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#50431: revert-buffer doesn't preserve read-onlyness


From: Drew Adams
Subject: bug#50431: revert-buffer doesn't preserve read-onlyness
Date: Fri, 26 Aug 2022 16:10:02 +0000

> > >> Maybe minor modes should be restored after reverting?
> > >
> > It was a regression when reverting stopped to preserve
> > the read-only status that worked in older versions.
> 
> IMO, that was a mistake.  It violates the notion of
> "reverting", at least in my book.

Yes, there can be different notions of reverting.

In the file-visiting case, it generally means and
should mean, IMO) respecting the current state of
the file on disk.  That might not be the last
state of an unmodified buffer visiting the file.

Nor non-file buffers it can mean different things
depending on the mode or whatever.  It's really
whatever state/behavior `revert-buffer-function'
defines.

Dunno whether we have, or should have, guidelines
for what kinds of behavior generally make sense
(or generally don't make sense) for
`revert-buffer-function'.

I certainly wouldn't expect, by default, a
file-visiting buffer to have all previously
enabled minor modes turned on, etc.  And I
wouldn't expect a buffer visiting a file whose
disk read-only status has been changed to revert
to the last read-only status of the buffer.

Reversion involves substituting some state for
the current one.  Sometimes the new state is in
some sense a restoration of a previous state
(in Emacs).  But clearly that's not the case for
revisiting a file whose state on disk has been
changed - whether content, read-only status, or
whatever.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]