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: Tue, 08 Sep 2015 22:19:38 +0300 Message-ID: <831te87m7p.fsf@gnu.org> References: <87y4gh47sr.fsf@gnu.org> <83k2s07vaf.fsf@gnu.org> <87wpw0g2ar.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1441740041 837 80.91.229.3 (8 Sep 2015 19:20:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 8 Sep 2015 19:20:41 +0000 (UTC) Cc: 21435@debbugs.gnu.org To: Tassilo Horn Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Sep 08 21:20:29 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 1ZZORC-0000qg-Bk for geb-bug-gnu-emacs@m.gmane.org; Tue, 08 Sep 2015 21:20:14 +0200 Original-Received: from localhost ([::1]:36841 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZORC-0002om-5M for geb-bug-gnu-emacs@m.gmane.org; Tue, 08 Sep 2015 15:20:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45112) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZOR7-0002oA-QE for bug-gnu-emacs@gnu.org; Tue, 08 Sep 2015 15:20:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZZOR2-0006qt-C2 for bug-gnu-emacs@gnu.org; Tue, 08 Sep 2015 15:20:09 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:60762) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZOR2-0006qW-9h for bug-gnu-emacs@gnu.org; Tue, 08 Sep 2015 15:20:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZZOR1-0007w0-Cg for bug-gnu-emacs@gnu.org; Tue, 08 Sep 2015 15:20:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 08 Sep 2015 19:20:03 +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.144173997030450 (code B ref 21435); Tue, 08 Sep 2015 19:20:03 +0000 Original-Received: (at 21435) by debbugs.gnu.org; 8 Sep 2015 19:19:30 +0000 Original-Received: from localhost ([127.0.0.1]:52972 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZZOQT-0007v4-Sb for submit@debbugs.gnu.org; Tue, 08 Sep 2015 15:19:30 -0400 Original-Received: from mtaout21.012.net.il ([80.179.55.169]:42629) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZZOQR-0007uu-2V for 21435@debbugs.gnu.org; Tue, 08 Sep 2015 15:19:28 -0400 Original-Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0NUD00K00H88AY00@a-mtaout21.012.net.il> for 21435@debbugs.gnu.org; Tue, 08 Sep 2015 22:19:25 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([84.94.185.246]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NUD00K7MHOD8G80@a-mtaout21.012.net.il>; Tue, 08 Sep 2015 22:19:25 +0300 (IDT) In-reply-to: <87wpw0g2ar.fsf@gnu.org> 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:106268 Archived-At: > From: Tassilo Horn > Cc: 21435@debbugs.gnu.org > Date: Tue, 08 Sep 2015 21:05:00 +0200 > > I stepped through inotify_callback in inotify.c which can read 64 byte > from inotifyfd where the size of one inotify event is 32 and that > produces 2 emacs events (although I cannot see which events are > created). The Locals GUD frame always shows just nil for the `event' > local variable even after the assignments to it and I stepped into the > then-branch of an `if (!NILP(event.arg))' which makes it pretty clear > that it cannot be nil. Why is that? Could be some gud bug. Do you see the same when you invoke GDB from the shell? > Then I turned to `file-notify-callback'. That receives one `move-from' > event and one `move-to' event which I figured out by adding a message. > The problem is that as soon as I edebug the function, I can only see the > first call for the `mode-from' event. After stepping through it, I > won't be put into the debugger for the second event as if it has been > discarded in the meantime. My handle function is also not run when > edebugging. Is that expected that when edebugging event handlers one > might miss events? I always use 'message' when debugging event-driven code. I just don't trust edebug enough in these cases. > Anyway, eventually I found and fixed the culprit which simply was that > the watch descriptors of the pending and the current event were compared > with `eq' which is not valid because inotify descriptors are conses. > I've changed the comparison to `equal' which fixes the double-reporting > issue. Thanks. But meanwhile Michale explained that this behavior was on purpose, due to a recent change. Do you see 2 events only when a file was moved to a different directory, or also when it is renamed in the same directory?