[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: auto-revert in VCS
From: |
Kevin Rodgers |
Subject: |
Re: auto-revert in VCS |
Date: |
Mon, 22 Feb 2010 21:29:34 -0700 |
User-agent: |
Thunderbird 2.0.0.23 (Macintosh/20090812) |
Andrea Crotti wrote:
I would like to have auto-revert activated when I work with branches.
For example in git projects every time I change branch I have to revert
buffer manually to start working on the new branch.
So I wrote this in my conf:
--8<---------------cut here---------------start------------->8---
(require 'autorevert)
(setq auto-revert-check-vc-info t)
(setq auto-revert-interval 3) ;; this could be cpu consuming
(setq auto-revert-verbose t)
(setq global-auto-revert-mode t)
That last setting is not recommended:
,----[ C-h v global-auto-revert-mode RET ]
| global-auto-revert-mode is a variable defined in `autorevert.el'.
| Its value is nil
|
|
| Documentation:
| Non-nil if Global-Auto-Revert mode is enabled.
| See the command `global-auto-revert-mode' for a description of this minor
mode.
| Setting this variable directly does not take effect;
| either customize it (see the info node `Easy Customization')
| or call the function `global-auto-revert-mode'.
|
| You can customize this variable.
|
| [back]
`----
--8<---------------cut here---------------end--------------->8---
The problem is that emacs was sucking all my cpu power and that's not
nice...
I only need to enable auto-revert for files under revision control, and
only on files which I'm visiting in some buffers (and the buffer is
active), is that possible somehow?
Call turn-on-auto-revert-mode in a find-file-hook function that checks
the result of (vc-backend buffer-file-name).
There is no such thing as an active/inactive buffer.
--
Kevin Rodgers
Denver, Colorado, USA