emacs-devel
[Top][All Lists]
Advanced

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

Re: autorevert and vc


From: Stefan Monnier
Subject: Re: autorevert and vc
Date: 28 Mar 2004 23:24:03 -0500
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

> As I already said before, the one part of the recent changes to
> autorevert.el (prior to the ones I made) which I did not check are
> the vc-part of those changes.  There seem to be bugs, or at the very
> least nuisance features, associated with them.

I'd suggest to completely take them out.
Their implementation is so ugly that it's best to start over from scratch.

If you don't want to take it all out, at least please remove:

        (if (eq revert 'vc)
            (vc-mode-line buffer-file-name))))))

It seems to be redundant and probably results from the fact that the
original author tried to fix a problem and didn't notice when he updated his
code that the current version does

        ;; `preserve-modes' avoids changing the (minor) modes.  But we
        ;; do want to reset the mode for VC, so we do it explicitly.
        (vc-find-file-hook)

just before which fixes the same problem.

Another thing: why on earth do

  (and (boundp 'vc-mode)
       (string-match "[0-9]" (or vc-mode ""))))

rather than 

  (and (boundp 'vc-mode) (stringp vc-mode)) ?

Also all the CVS-related code needs to be moved to vc-cvs.el.

Finally, I think the idea of doing a `revert' of the file when the file has
not changed is just plain wrong.  If you want to update the VC-state, then
update just the VC-state, but don't additionally revert the buffer.

In other words the VC-state-refresh code should be completely separate
from the file-buffer-refresh code since both can change independently.
It can still all be in autorevert.el, but a refresh of one shouldn't
necessarily force a refresh of another (currently a refresh of the buffer
text forces a refresh of the VC-state, which is OK only because we don't
kow how to check staleness of the VC-state so we use staleness of the
buffer-text as a heuristic that the VC-state might also be stale).


        Stefan




reply via email to

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