GNU bug report logs - #21435
25.0.50; file-notify has problems after renames

Previous Next

Package: emacs;

Reported by: Tassilo Horn <tsdh <at> gnu.org>

Date: Tue, 8 Sep 2015 08:48:01 UTC

Severity: normal

Found in version 25.0.50

Done: Michael Albinus <michael.albinus <at> gmx.de>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 21435 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 21435 <at> debbugs.gnu.org, Tassilo Horn <tsdh <at> gnu.org>
Subject: Re: bug#21435: 25.0.50; file-notify has problems after renames
Date: Tue, 08 Sep 2015 20:04:20 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

> IOW, technically, the file/directory you watched disappeared from the
> filesystem, so what is reported afterwards is IMO entirely resonable
> at this low level.

Well, inotify sends then the low-level event `delete-self', which is
different from the usual `delete'. filenotify.el translates both to the
upper-level event `deleted'. In case of `delete-self', filenotify.el
could do something more, like removing the watch. Do we want this?

> One application we have on top of filenotify.el is auto-revert.el.
> Now, if you see some user-level problems there when files are
> renamed/deleted, please report them.
>
>> Another thing is that renames always seem to be reported twice (although
>> the example in the manual lists only one event but that example has
>> probably gathered with the gfilenotify backend).
>
> This doesn't happen with w32notify.  filenotify.el includes some code
> to produce a single notification out of the 2 reported by back-ends in
> this case; perhaps something doesn't work there with inotify.  Can you
> step through the code and see why?

Two days ago (commit dbdc459a48091f5953faf14bcaaa7e6d37fbf024), I've
changed filenotify.el to fire 2 events `renamed' in case the directories
of the source and target are different. This was triggered by a user
report, that he wants to have auto-revert-mode for two different
directories under dired control. So the event is sent for the two
different handlers activated by the respective *-add-watch calls.

I've tested for inotify, it works (confirmed by that user). The use case
of that user was, that a file has been moved outside Emacs from one
directory to the other. An he wanted to see it in both dired buffers,
immediately.

I couldn't test this for w32notify, but it should behave like this since
Sunday. I haven't changed it in gfilenotify yet, it's on my todo
list. And the manual must be adapted, as Tassilo has said.

Best regards, Michael.

PS: Tassilo, you write great test cases. Do you want to contribute to
test/automated/file-notify-tests.el?

PPS: Forgive me slow progress; I'm still suffering from health problems.




This bug report was last modified 9 years and 307 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.