From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.devel Subject: Re: File watch support in autorevert.el Date: Thu, 10 Jan 2013 21:38:21 +0100 Message-ID: <87obgwyds2.fsf@gmx.de> References: <878v819kok.fsf@gmx.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1357850314 13993 80.91.229.3 (10 Jan 2013 20:38:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 10 Jan 2013 20:38:34 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jan 10 21:38:52 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TtOti-00017h-Sd for ged-emacs-devel@m.gmane.org; Thu, 10 Jan 2013 21:38:46 +0100 Original-Received: from localhost ([::1]:54691 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TtOtS-00025n-SJ for ged-emacs-devel@m.gmane.org; Thu, 10 Jan 2013 15:38:30 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:49382) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TtOtP-0001zJ-4C for emacs-devel@gnu.org; Thu, 10 Jan 2013 15:38:28 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TtOtN-0000qq-S1 for emacs-devel@gnu.org; Thu, 10 Jan 2013 15:38:27 -0500 Original-Received: from mout.gmx.net ([212.227.15.19]:50792) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TtOtN-0000qm-IT for emacs-devel@gnu.org; Thu, 10 Jan 2013 15:38:25 -0500 Original-Received: from mailout-de.gmx.net ([10.1.76.12]) by mrigmx.server.lan (mrigmx002) with ESMTP (Nemesis) id 0LlKmm-1TIgQo1U0M-00b1Hw for ; Thu, 10 Jan 2013 21:38:24 +0100 Original-Received: (qmail invoked by alias); 10 Jan 2013 20:38:23 -0000 Original-Received: from p57BB9796.dip0.t-ipconnect.de (EHLO detlef.gmx.de) [87.187.151.150] by mail.gmx.net (mp012) with SMTP; 10 Jan 2013 21:38:23 +0100 X-Authenticated: #3708877 X-Provags-ID: V01U2FsdGVkX1/Rf7gl6tDR6zKwTvdfU5kEmq/2N49DSP0xWTyKnL g7kNa4t0EoJjqI In-Reply-To: (Stefan Monnier's message of "Thu, 10 Jan 2013 12:11:56 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-Y-GMX-Trusted: 0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 212.227.15.19 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:156197 Archived-At: Stefan Monnier writes: >> As a proof of concept, I have installed a patch in autorevert.el >> implementing file watches. This shall work for `auto-revert-mode' and >> `global-auto-revert-mode' for buffers visiting files. >> `auto-revert-tail-mode' is not supported (yet). > > Thanks, that sounds like a very good start. But please make it > optional, for those users who want to use auto-revert-mode on files > accessed over NFS and other protocols where inotify doesn't work. Done. There's a now user option `auto-revert-use-notify', which can be set to nil in order to suppress file watches. Maybe it would be more useful, if autorevert would decide per file, whether to trust on file watches, or not. For example, one could check whether *-add-watch returns a nil watch descriptor. In this case, there shall be a fallback to the current implementation. Will see. After that, I will check what to do with `auto-revert-tail-mode'. And there is still the open point what to do with the timer. The current implementation uses the file watches to mark buffers which need to be reverted. The revert operation itself is triggered by the timer. One could invoke the revert operation directly when the file watch event arrives. But the timer would still be needed. For example for these files which do not support file watches (see above), or for buffers which are not linked with a visiting file. Therefore, it might not be necessary to invoke the revert operation directly from the incoming event. > Stefan Best regards, Michael.