From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#21435: 25.0.50; file-notify has problems after renames Date: Wed, 09 Sep 2015 22:21:17 +0300 Message-ID: <83h9n35rgy.fsf@gnu.org> References: <87y4gh47sr.fsf@gnu.org> <83k2s07vaf.fsf@gnu.org> <87fv2ovlcr.fsf@gmx.de> <83613k7owe.fsf@gnu.org> <8737ynv3ik.fsf@gmx.de> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1441826553 4585 80.91.229.3 (9 Sep 2015 19:22:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 9 Sep 2015 19:22:33 +0000 (UTC) Cc: 21435@debbugs.gnu.org, tsdh@gnu.org To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Sep 09 21:22:21 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1ZZkwc-0007Em-DP for geb-bug-gnu-emacs@m.gmane.org; Wed, 09 Sep 2015 21:22:10 +0200 Original-Received: from localhost ([::1]:45134 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZkwb-0003dO-Tk for geb-bug-gnu-emacs@m.gmane.org; Wed, 09 Sep 2015 15:22:09 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53976) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZkwX-0003bP-Ki for bug-gnu-emacs@gnu.org; Wed, 09 Sep 2015 15:22:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZZkwU-00069b-HQ for bug-gnu-emacs@gnu.org; Wed, 09 Sep 2015 15:22:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:33761) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZkwU-00069P-EF for bug-gnu-emacs@gnu.org; Wed, 09 Sep 2015 15:22:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZZkwT-0006sC-Vl for bug-gnu-emacs@gnu.org; Wed, 09 Sep 2015 15:22:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 09 Sep 2015 19:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21435 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 21435-submit@debbugs.gnu.org id=B21435.144182649026372 (code B ref 21435); Wed, 09 Sep 2015 19:22:01 +0000 Original-Received: (at 21435) by debbugs.gnu.org; 9 Sep 2015 19:21:30 +0000 Original-Received: from localhost ([127.0.0.1]:54203 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZZkvx-0006rH-Eq for submit@debbugs.gnu.org; Wed, 09 Sep 2015 15:21:29 -0400 Original-Received: from mtaout29.012.net.il ([80.179.55.185]:50411) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZZkvu-0006r8-Eb for 21435@debbugs.gnu.org; Wed, 09 Sep 2015 15:21:27 -0400 Original-Received: from conversion-daemon.mtaout29.012.net.il by mtaout29.012.net.il (HyperSendmail v2007.08) id <0NUF00I00C2V0300@mtaout29.012.net.il> for 21435@debbugs.gnu.org; Wed, 09 Sep 2015 22:21:47 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([84.94.185.246]) by mtaout29.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NUF00DMXCGACN50@mtaout29.012.net.il>; Wed, 09 Sep 2015 22:21:46 +0300 (IDT) In-reply-to: <8737ynv3ik.fsf@gmx.de> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:106324 Archived-At: > From: Michael Albinus > Cc: tsdh@gnu.org, 21435@debbugs.gnu.org > Date: Wed, 09 Sep 2015 20:41:55 +0200 > > >> I couldn't test this for w32notify, but it should behave like this since > >> Sunday. > > > > If you can show some simple test case, I can run it. > > Well, something like this: > > --8<---------------cut here---------------start------------->8--- > (progn > (require 'filenotify) > (defalias 'myhandler1 'ignore) > (defalias 'myhandler2 'ignore) > (file-notify-add-watch "/tmp" '(change) 'myhandler1) > (file-notify-add-watch "~/tmp" '(change) 'myhandler2) > (trace-function 'file-notify-handle-event) > (trace-function 'myhandler1) > (trace-function 'myhandler2)) > --8<---------------cut here---------------end--------------->8--- > > Then you do outside Emacs (inotify case): > > --8<---------------cut here---------------start------------->8--- > # echo xxx >/tmp/xxx > > ====================================================================== > 1 -> (file-notify-handle-event (file-notify (1 (create) "xxx" 0) file-notify-callback)) > | 2 -> (myhandler1 ((1) created "/tmp/xxx")) > | 2 <- myhandler1: nil > 1 <- file-notify-handle-event: nil > ====================================================================== > 1 -> (file-notify-handle-event (file-notify (1 (modify) "xxx" 0) file-notify-callback)) > | 2 -> (myhandler1 ((1) changed "/tmp/xxx")) > | 2 <- myhandler1: nil > 1 <- file-notify-handle-event: nil This behaves the same on w32: ====================================================================== 1 -> (file-notify-handle-event (file-notify (100286560 added "xxx") file-notify-callback)) | 2 -> (myhandler1 (100286560 created "d:/tmp/xxx")) | 2 <- myhandler1: nil 1 <- file-notify-handle-event: nil ====================================================================== 1 -> (file-notify-handle-event (file-notify (100286560 modified "xxx") file-notify-callback)) | 2 -> (myhandler1 (100286560 changed "d:/tmp/xxx")) | 2 <- myhandler1: nil 1 <- file-notify-handle-event: nil > # mv /tmp/xxx ~/tmp/ > > ====================================================================== > 1 -> (file-notify-handle-event (file-notify (1 (moved-from) "xxx" 49278) file-notify-callback)) > 1 <- file-notify-handle-event: nil > ====================================================================== > 1 -> (file-notify-handle-event (file-notify (2 (moved-to) "xxx" 49278) file-notify-callback)) > | 2 -> (myhandler1 ((1) renamed "/tmp/xxx" "/home/albinus/tmp/xxx")) > | 2 <- myhandler1: nil > | 2 -> (myhandler2 ((2) renamed "/tmp/xxx" "/home/albinus/tmp/xxx")) > | 2 <- myhandler2: nil > 1 <- file-notify-handle-event: nil > --8<---------------cut here---------------end--------------->8--- > > That looks good. This doesn't work at all on w32 (I used d:/usr/eli/data instead of ~/tmp), it reports removal and addition (and also a bogus 2nd removal): ====================================================================== 1 -> (file-notify-handle-event (file-notify (100286608 removed "xxx") file-notify-callback)) | 2 -> (myhandler2 (100286608 deleted "d:/usr/eli/data/xxx")) | 2 <- myhandler2: nil 1 <- file-notify-handle-event: nil ====================================================================== 1 -> (file-notify-handle-event (file-notify (100286608 added "xxx") file-notify-callback)) | 2 -> (myhandler2 (100286608 created "d:/usr/eli/data/xxx")) | 2 <- myhandler2: nil 1 <- file-notify-handle-event: nil ====================================================================== 1 -> (file-notify-handle-event (file-notify (100286560 removed "xxx") file-notify-callback)) | 2 -> (myhandler1 (100286560 deleted "d:/tmp/xxx")) | 2 <- myhandler1: nil 1 <- file-notify-handle-event: nil Let me know what I should look into or which additional information I can give you about this.