From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: File watch support in autorevert.el Date: Sat, 12 Jan 2013 13:36:05 +0200 Message-ID: <836232tyze.fsf@gnu.org> References: <878v819kok.fsf@gmx.de> <83fw28uj9c.fsf@gnu.org> <87ip73n3xl.fsf@gmx.de> <87libz2v76.fsf@gmx.de> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1357990562 20291 80.91.229.3 (12 Jan 2013 11:36:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 12 Jan 2013 11:36:02 +0000 (UTC) Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Michael Albinus Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jan 12 12:36:19 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 1TtzNl-0003wB-6N for ged-emacs-devel@m.gmane.org; Sat, 12 Jan 2013 12:36:13 +0100 Original-Received: from localhost ([::1]:56575 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TtzNU-0000AE-Pr for ged-emacs-devel@m.gmane.org; Sat, 12 Jan 2013 06:35:56 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:42855) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TtzNO-00009x-G1 for emacs-devel@gnu.org; Sat, 12 Jan 2013 06:35:55 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TtzNI-00089W-6R for emacs-devel@gnu.org; Sat, 12 Jan 2013 06:35:50 -0500 Original-Received: from mtaout21.012.net.il ([80.179.55.169]:49759) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TtzNH-00089E-Sb for emacs-devel@gnu.org; Sat, 12 Jan 2013 06:35:44 -0500 Original-Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0MGI00J00FZ40N00@a-mtaout21.012.net.il> for emacs-devel@gnu.org; Sat, 12 Jan 2013 13:35:42 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MGI00IPEG7HYU60@a-mtaout21.012.net.il>; Sat, 12 Jan 2013 13:35:42 +0200 (IST) In-reply-to: <87libz2v76.fsf@gmx.de> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 80.179.55.169 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:156261 Archived-At: > From: Michael Albinus > Date: Fri, 11 Jan 2013 23:47:41 +0100 > Cc: Eli Zaretskii , emacs-devel@gnu.org > > Stefan Monnier writes: > > >> Will do for the inotify case. It is a simple bit easier, because you can > >> install a file watch for exactly one file, and you can expect it returns > >> for that file only. > > > > BTW, what happens if the file gets overwritten without touching its > > inode (e.g. use auto-revert-mode on ~/foo and then do "mv ~/bar ~/foo" > > and then "echo toto >>~/foo")? > > > > You'll presumably get some notification of the "mv" itself, but will you > > subsequently get the notification of the "echo" (which is now modifying > > another inode than the original ~/foo)? > > No further notifications. I've realized it just now, because this is the > scenario when you save a file with `backup-by-copying' set to nil. You > will loose further notifications, because the file was moved away. > > Tested in the inotify case. For w32notify, I don't know. Windows is at advantage here, since it watches the entire directory. So when the new "foo" is created and gets updated, the notifications come in and the file is auto-reverted. Perhaps the inotify implementation should watch the parent directory instead of the file. The rename notification doesn't come in, because we didn't request it. To request it (if we need that), wee should add 'file-name' to the list of w32notify filters. AFAIU, with inotify we need to use 'move' to get notifications about renames.