From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.help Subject: Re: auto-revert in VCS Date: Mon, 22 Feb 2010 21:29:34 -0700 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1266899464 27578 80.91.229.12 (23 Feb 2010 04:31:04 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 23 Feb 2010 04:31:04 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Feb 23 05:31:00 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1NjmQF-0003Ji-9p for geh-help-gnu-emacs@m.gmane.org; Tue, 23 Feb 2010 05:30:59 +0100 Original-Received: from localhost ([127.0.0.1]:35304 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NjmQE-00072c-Mo for geh-help-gnu-emacs@m.gmane.org; Mon, 22 Feb 2010 23:30:58 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NjmPG-0006cu-VP for help-gnu-emacs@gnu.org; Mon, 22 Feb 2010 23:29:59 -0500 Original-Received: from [140.186.70.92] (port=39573 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NjmPA-0006Yo-6x for help-gnu-emacs@gnu.org; Mon, 22 Feb 2010 23:29:56 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NjmP5-0001Gk-PU for help-gnu-emacs@gnu.org; Mon, 22 Feb 2010 23:29:52 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:34516) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NjmP5-0001GN-Fj for help-gnu-emacs@gnu.org; Mon, 22 Feb 2010 23:29:47 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1NjmP2-0002x1-81 for help-gnu-emacs@gnu.org; Tue, 23 Feb 2010 05:29:44 +0100 Original-Received: from c-71-237-24-138.hsd1.co.comcast.net ([71.237.24.138]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 23 Feb 2010 05:29:44 +0100 Original-Received: from kevin.d.rodgers by c-71-237-24-138.hsd1.co.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 23 Feb 2010 05:29:44 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 49 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: c-71-237-24-138.hsd1.co.comcast.net User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:72045 Archived-At: 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