all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 66381@debbugs.gnu.org, daniel.jacobowitz@gmail.com
Subject: bug#66381: 29.1; Auto-revert not polling files when notifications are enabled
Date: Sun, 15 Oct 2023 15:58:56 +0200	[thread overview]
Message-ID: <87edhwm1gf.fsf@gmx.de> (raw)
In-Reply-To: <83a5smu3r2.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 13 Oct 2023 15:05:21 +0300")

Eli Zaretskii <eliz@gnu.org> writes:

Hi Eli,

>> I've checked the other file notification backends, and it turns out,
>> that none of them reports unmount events. So I have extended the patch,
>> the unmount event is propagated now in all backends (under different
>> event names), and it causes to stop the respective file notification
>> watch.
>>
>> This works for all but the w32notify backend. I dont know whether this
>> library supports a kind of unmount events, and even in case it does, I
>> wouldn't be able to implement this. Eli, do we want to do something
>> here?
>
> I don't know, I will have to test this.
>
> Could you please help me by showing some Lisp I could use to see if
> unmounting a volume gets reported in some way to the
> file-notifications machinery?  I have very little free time these
> days, for more than one good reason, but would like not to postpone
> investigating this for too long, which will happen if I need to find
> the recipe myself.  TIA.

I would apply the following recipe:

- Use a mounted share. In my environment, "z:" is a Samba mount.

- Call

--8<---------------cut here---------------start------------->8---
$ emacs -l filenotify --eval '(setq file-notify-debug t)' --eval '(file-notify-add-watch "z:/123" (quote (change attribute-change)) (quote ignore))'
--8<---------------cut here---------------end--------------->8---

- In another shell outside Emacs, call

--8<---------------cut here---------------start------------->8---
$ touch z:/123
--8<---------------cut here---------------end--------------->8---

- You'll see in Emacs the messages

--8<---------------cut here---------------start------------->8---
file-notify-handle-event (file-notify (541405157192 modified "123") file-notify--callback-w32notify)
file-notify-callback 541405157192 changed "z:/123" nil #s(file-notify--watch "z:/" "123" ignore) "z:/123" "z:/"
--8<---------------cut here---------------end--------------->8---

- Unmount the share. There shall be another file notification, but there
  isn't.

In a similar scenario I use with Emacs/inotify, I see the meesages

--8<---------------cut here---------------start------------->8---
file-notify-handle-event (file-notify ((1 . 0) (attrib) "123" 0) file-notify--callback-inotify)
file-notify-callback (1 . 0) attribute-changed "/tmp/tramp.sshfs.detlef/home/albinus/123" nil #s(file-notify--watch "/tmp/tramp.sshfs.detlef/home/albinus" "123" ignore) "/tmp/tramp.sshfs.detlef/home/albinus/123" "/tmp/tramp.sshfs.detlef/home/albinus"
file-notify-handle-event (file-notify ((1 . 0) (unmount isdir) "/tmp/tramp.sshfs.detlef/home/albinus" 0) file-notify--callback-inotify)
file-notify-handle-event (file-notify ((1 . 0) stopped "/tmp/tramp.sshfs.detlef/home/albinus/123") ignore)
file-notify-handle-event (file-notify ((1 . 0) (ignored) "/tmp/tramp.sshfs.detlef/home/albinus" 0) file-notify--callback-inotify)
--8<---------------cut here---------------end--------------->8---

"/tmp/tramp.sshfs.detlef" is the mount point in that case.

Best regards, Michael.





  reply	other threads:[~2023-10-15 13:58 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-06 17:13 bug#66381: 29.1; Auto-revert not polling files when notifications are enabled Daniel Jacobowitz
2023-10-07  6:17 ` Eli Zaretskii
2023-10-07 15:15   ` Michael Albinus
2023-10-07 16:14     ` Daniel Jacobowitz
2023-10-07 17:02       ` Michael Albinus
     [not found]         ` <CAN9gPaEi7yPgC4cA9fR-TtSmsVg6CoTOZ=bbZFa1gjQA_B1vGA@mail.gmail.com>
2023-10-07 17:59           ` Michael Albinus
2023-10-07 18:14             ` Daniel Jacobowitz
2023-10-07 18:28               ` Eli Zaretskii
2023-10-07 18:41                 ` Daniel Jacobowitz
2023-10-07 18:48                   ` Daniel Jacobowitz
2023-10-07 19:00                   ` Eli Zaretskii
2023-10-08  8:24                     ` Michael Albinus
2023-10-08 12:38                       ` Michael Albinus
2023-10-09 18:17                         ` Daniel Jacobowitz
2023-10-10 18:03                           ` Michael Albinus
2023-10-13 12:05                             ` Eli Zaretskii
2023-10-15 13:58                               ` Michael Albinus [this message]
2023-10-16 12:38                                 ` Eli Zaretskii
2023-10-16 14:29                                   ` Michael Albinus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87edhwm1gf.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=66381@debbugs.gnu.org \
    --cc=daniel.jacobowitz@gmail.com \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.