]> git.eshelyaron.com Git - emacs.git/commit
Add file notification handler for Tramp's "smb" method.
authorMichael Albinus <michael.albinus@gmx.de>
Sat, 5 Jul 2025 17:21:48 +0000 (19:21 +0200)
committerEshel Yaron <me@eshelyaron.com>
Thu, 24 Jul 2025 07:42:27 +0000 (09:42 +0200)
commitc16d9780be4c90edc4dab15e0040640b35208854
tree384be724d0c5ed004f2e43ebd753aec14c8ca674
parent8015d1d0070f1c32fb013dd4289cbaec4478b4a3
Add file notification handler for Tramp's "smb" method.

* etc/NEWS: Mention new file notification handler for Tramp "smb".

* lisp/filenotify.el (file-notify--expand-file-name): Fix the
remote case.
(file-notify-callback): Extend for "smb-notify".
(file-notify--call-handler): Fix debug message.

* lisp/net/tramp-gvfs.el (tramp-gvfs-handle-file-notify-add-watch):
* lisp/net/tramp-sh.el (tramp-sh-gio-monitor-process-filter):
Use connection property "file-monitor".

* lisp/net/tramp-smb.el (tramp-smb-file-name-handler-alist):
Use `tramp-smb-handle-file-notify-add-watch'.
(tramp-smb-handle-delete-directory): Do not error if there is a
pending deletion of a directory under file-watch.
(tramp-smb-handle-file-notify-add-watch)
(tramp-smb-notify-process-filter): New defuns.
(tramp-smb-send-command): New optional argument NOOUTPUT.
(tramp-smb-wait-for-output): Improve debug message.

* lisp/net/tramp.el (tramp-directory-watched): New defun.
(tramp-accept-process-output, tramp-wait-for-regexp):
Improve debug message.

* test/lisp/filenotify-tests.el (top): Filter also for
"smb-notify".  Set some other Tramp related variables.
(file-notify--test-wait-for-events)
(file-notify--test-with-actions-check)
(file-notify--test-with-actions): Add debug message.
(file-notify--test-cleanup, file-notify--deftest-remote):
Keep Tramp debugs buffer.
(file-notify--test-monitor): Check for "smb-notify".
(file-notify--deftest-remote): Call `file-notify-rm-all-watches'.
(file-notify--test-make-temp-name): Use a better name for parent
directory.
(file-notify--test-event-handler): Use `string-match-p'.
(file-notify--test-with-actions): Check also for the `stopped'
event as limit.
(file-notify-test03-events, file-notify-test04-autorevert)
(file-notify-test05-file-validity)
(file-notify-test07-many-events, file-notify-test08-backup)
(file-notify-test09-watched-file-in-watched-dir): Adapt tests for
"smb-notify".
(file-notify-test12-unmount): Skip for "smb-notify".

(cherry picked from commit aa8afabd493ce67924685bc6cfafec551380a094)
lisp/filenotify.el
lisp/net/tramp-gvfs.el
lisp/net/tramp-sh.el
lisp/net/tramp-smb.el
lisp/net/tramp.el
test/lisp/filenotify-tests.el