[Top][All Lists]

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

Re: auto-revert doesn't catch mode changes

From: Anders Lindgren
Subject: Re: auto-revert doesn't catch mode changes
Date: 20 Dec 2001 16:44:33 +0100
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

The following message is a courtesy copy of an article
that has been posted to gnu.emacs.help as well.

In "gnu.emacs.help" Matt Armstrong
<address@hidden> writes:

> Has anybody hacked on auto-revert mode to also check for changes
> between read-only and writable?
> Under emacs 21 (and previous versions), when I edit a bunch of files
> under source code control, save them all, and then submit them, emacs'
> global-auto-revert doesn't detect that the files have now become
> read-only (the source code control system does not change their
> modification times).
> Then some time later I visit the file, make edits, and only to find
> the file on disk read only.  This happens frequently enough to be
> annoying.

Hi Matt!

The situation is not as simple as it at first sight may seem.

The problem is that when the read-only status of the buffer and the
file differs, was it really the file that was modified?  In fact, it
could have been the buffer read-only status that was changed, then the
user would certainly not want emacs to revert the buffer.  (In an
early, unreleased, version auto-revert did this; No Good!)

What is needed is for emacs to record the original read-only status of
the file, just as it records the original modification date.  Then it
could check if the files read-only status has been changed.

Auto-revert is a package that is designed to be loadable long after
the buffer has been opened, hence it can not be responsible for
remembering the original status.  (At least not as long as the basic
design should not be changed.)

Once upon the time I wished to get this low-level feature added, if
we're lycky then santa will bring it to us, then I promose I will add
the high-level features to auto-revert itself.  In fact, if the
read-only status also was checked by `verify-visited-file-modtime'
then auto-revert would start working straight out of the box.

    -- Anders (Author of auto-revert)
;; .signature -- File added to the end of mail, containing joke or info.
(defvar me '((profession . "Compiler Designer") (company . "IAR Systems")
  (age . 32) (country . "Sweden") (hair . "Long") (lindy-hopper . t)))
;; .signature ends here.

reply via email to

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