bug#81531: 30.2; filenotify: moving file out of watched directory delays the "deleted" event until file is later moved back in

Eli Zaretskii <[email protected]>
Newsgroups gmane.emacs.bugs
Message-ID <[email protected]>
> Cc: [email protected]
> Date: Tue, 04 Aug 2026 16:14:07 +0200
> From: Michael Albinus via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <[email protected]>
> 
> >     3 -> `mv bar ..`
> 
> --8<---------------cut here---------------start------------->8---
> file-notify-handle-event (file-notify ((1 . 0) (moved-from) "bar" 370367) file-notify--callback-inotify)
> --8<---------------cut here---------------end--------------->8---
> 
> This is the problematic action. We get from inotify only a 'moved-from
> "bar"' event. The corresponding 'moved-to' event is not returned,
> because the file path is ouside of the watched directory.
> 
> filenotify.el is instructed, to wait for the next backend event after
> 'moved-from'. This is needed to decide what to do. Since no second
> backend event arrives, nothing is sent to the handler. This is what you
> have observed.

Maybe we should report both the low-level original events "moved-from"
and "moved-to", and the higher-level "renamed" events?  Then at least
the moved-from event will not be lost.  WDYT?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.