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

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

Re: global-auto-revert mode doesn't revert fully


From: Karl Chen
Subject: Re: global-auto-revert mode doesn't revert fully
Date: Tue, 14 May 2002 22:13:07 -0700

I agree that that's an annoying bug. Here's a fix.

Add this to your .emacs:

(defun vc-reload-version-info ()
  "Re-read a file's version information after an external edit.

Meant to be added as to `after-revert-hook'."
  (when (vc-backend buffer-file-name)
    (vc-file-setprop buffer-file-name 'vc-workfile-version
                     (vc-call workfile-version buffer-file-name))
    (vc-mode-line buffer-file-name)
    (force-mode-line-update)
    )
  t)

(add-hook 'after-revert-hook 'vc-reload-version-info)

--
Karl Chen


"Luke Blanshard" <luke@quiq.com> wrote in message
GW27ZR00.G1Z@nsmail.west.quiq.com">news:GW27ZR00.G1Z@nsmail.west.quiq.com...
> 1. Turn on global-auto-revert-mode.
> 2. Open a CVS-controlled file in Emacs.
> 3. Do a CVS update outside of Emacs that brings out a newer version of
>    the file.
> 4. Emacs will revert the contents of the buffer, but not the version
>    number (as displayed in the mode line).  If you do any VC
>    operations from within Emacs against that file, the VC commands
>    will use the original version of the file as if it was current.






reply via email to

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